Bug 1277686 - For uplift to Aurora and Beta - Issue a warning for manifests with any "incognito" property other than "spanning", r=kmag a=sylvestre
authorBob Silverberg <bsilverberg@mozilla.com>
Mon, 20 Jun 2016 16:50:39 +0100
changeset 341701 153c74d40a43a648d9a60c91af8042f5112be46f
parent 341700 bc5cb981f4b84403b49aa5b28c00d20a17db3c1f
child 341702 35a893677058119066946edb63d8a073178ec4b4
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag, sylvestre
bugs1277686
milestone49.0a2
Bug 1277686 - For uplift to Aurora and Beta - Issue a warning for manifests with any "incognito" property other than "spanning", r=kmag a=sylvestre
toolkit/components/extensions/schemas/manifest.json
toolkit/components/extensions/test/xpcshell/test_ext_manifest_incognito.js
toolkit/components/extensions/test/xpcshell/xpcshell.ini
--- a/toolkit/components/extensions/schemas/manifest.json
+++ b/toolkit/components/extensions/schemas/manifest.json
@@ -74,16 +74,23 @@
           "icons": {
             "type": "object",
             "optional": true,
             "patternProperties": {
               "^[1-9]\\d*$": { "type": "string" }
             }
           },
 
+          "incognito": {
+            "type": "string",
+            "enum": ["spanning"],
+            "optional": true,
+            "onError": "warn"
+          },
+
           "background": {
             "choices": [
               {
                 "type": "object",
                 "properties": {
                   "page": { "$ref": "ExtensionURL" },
                   "persistent": {
                     "optional": true,
new file mode 100644
--- /dev/null
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_manifest_incognito.js
@@ -0,0 +1,27 @@
+/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set sts=2 sw=2 et tw=80: */
+"use strict";
+
+
+add_task(function* test_manifest_incognito() {
+  let normalized = yield normalizeManifest({
+    "incognito": "spanning",
+  });
+
+  equal(normalized.error, undefined, "Should not have an error");
+  equal(normalized.errors.length, 0, "Should not have warnings");
+  equal(normalized.value.incognito,
+        "spanning",
+        "Should have the expected incognito string");
+
+  normalized = yield normalizeManifest({
+    "incognito": "split",
+  });
+
+  equal(normalized.error, undefined, "Should not have an error");
+  Assert.deepEqual(normalized.errors,
+                   ['Error processing incognito: Invalid enumeration value "split"'],
+                   "Should have the expected warning");
+  equal(normalized.value.incognito, null,
+        "Invalid incognito string should be omitted");
+});
--- a/toolkit/components/extensions/test/xpcshell/xpcshell.ini
+++ b/toolkit/components/extensions/test/xpcshell/xpcshell.ini
@@ -6,10 +6,11 @@ skip-if = toolkit == 'gonk' || appname =
 
 [test_csp_custom_policies.js]
 [test_csp_validator.js]
 [test_locale_data.js]
 [test_locale_converter.js]
 [test_ext_contexts.js]
 [test_ext_json_parser.js]
 [test_ext_manifest_content_security_policy.js]
+[test_ext_manifest_incognito.js]
 [test_ext_schemas.js]
 [test_getAPILevelForWindow.js]