Bug 1268197 - stub for webcompat fix system add-on r?kmag draft
authorRobert Helmer <rhelmer@mozilla.com>
Wed, 27 Apr 2016 16:11:16 -0700
changeset 357412 4163ecf16df859904a05bbdcd65c90fe3c21733b
parent 356126 352d365eb4eda3aab7c3680b0e80ce17e178b5ee
child 519633 ccec5cd725734cbab743285109448cd90cc78a71
push id16769
push userrhelmer@mozilla.com
push dateThu, 28 Apr 2016 16:53:03 +0000
reviewerskmag
bugs1268197
milestone48.0a1
Bug 1268197 - stub for webcompat fix system add-on r?kmag MozReview-Commit-ID: K56apkJhP3p
browser/extensions/moz.build
browser/extensions/webcompat/bootstrap.js
browser/extensions/webcompat/install.rdf.in
browser/extensions/webcompat/moz.build
browser/extensions/webcompat/test/browser.ini
browser/extensions/webcompat/test/browser_webcompat_stub_check.js
--- a/browser/extensions/moz.build
+++ b/browser/extensions/moz.build
@@ -4,9 +4,10 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 DIRS += [
     'e10srollout',
     'loop',
     'pdfjs',
     'pocket',
+    'webcompat',
 ]
new file mode 100644
--- /dev/null
+++ b/browser/extensions/webcompat/bootstrap.js
@@ -0,0 +1,10 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+// for now we ship a stub, that can be upgraded as-needed after release
+function startup() {}
+function shutdown() {}
+function install() {}
+function uninstall() {}
new file mode 100644
--- /dev/null
+++ b/browser/extensions/webcompat/install.rdf.in
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this
+   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
+#filter substitution
+
+<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+
+  <Description about="urn:mozilla:install-manifest">
+    <em:id>webcompat@mozilla.org</em:id>
+    <em:version>1.0</em:version>
+    <em:type>2</em:type>
+    <em:bootstrap>true</em:bootstrap>
+
+    <!-- Target Application this theme can install into,
+        with minimum and maximum supported versions. -->
+    <em:targetApplication>
+      <Description>
+        <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
+        <em:minVersion>@FIREFOX_VERSION@</em:minVersion>
+        <em:maxVersion>@FIREFOX_VERSION@</em:maxVersion>
+      </Description>
+    </em:targetApplication>
+
+    <!-- Front End MetaData -->
+    <em:name>Web Compat</em:name>
+    <em:description>Urgent post-release fixes for web compatibility.</em:description>
+  </Description>
+</RDF>
new file mode 100644
--- /dev/null
+++ b/browser/extensions/webcompat/moz.build
@@ -0,0 +1,15 @@
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+FINAL_TARGET_FILES.features['webcompat@mozilla.org'] += [
+  'bootstrap.js'
+]
+
+FINAL_TARGET_PP_FILES.features['webcompat@mozilla.org'] += [
+  'install.rdf.in'
+]
+
+BROWSER_CHROME_MANIFESTS += ['test/browser.ini']
new file mode 100644
--- /dev/null
+++ b/browser/extensions/webcompat/test/browser.ini
@@ -0,0 +1,3 @@
+[DEFAULT]
+
+[browser_webcompat_stub_check.js]
new file mode 100644
--- /dev/null
+++ b/browser/extensions/webcompat/test/browser_webcompat_stub_check.js
@@ -0,0 +1,15 @@
+"use strict";
+
+// make sure that the stub is present and enabled
+add_task(function* stub_enabled() {
+  let addon = yield new Promise(
+    resolve => AddonManager.getAddonByID("webcompat@mozilla.org", resolve)
+  );
+  isnot(addon, null, "Webcompat stub addon should exist");
+  is(addon.version, "1.0");
+  is(addon.name, "Web Compat");
+  ok(addon.isCompatible, "Webcompat stub addon is compatible with Firefox");
+  ok(!addon.appDisabled, "Webcompat stub addon is not app disabled");
+  ok(addon.isActive, "Webcompat stub addon is active");
+  is(addon.type, "extension", "Webcompat stub addon is type extension");
+});