Bug 1253565 - [webext] Add "UnrecognizedProperty" to commands manifest properties. r=kmag
☠☠ backed out by 21077a8abccf ☠ ☠
authorLuca Greco <lgreco@mozilla.com>
Mon, 14 Mar 2016 12:03:46 +0100
changeset 288531 d50f024f55d81364ead7bdb729b01746399325c5
parent 288530 8a78c738b882f9d8a4171a038fa1b4d71c958394
child 288532 59d67fe6d470d246b3c15236563c42736b41a288
push id30083
push userkwierso@gmail.com
push dateTue, 15 Mar 2016 00:32:08 +0000
treeherdermozilla-central@21077a8abccf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag
bugs1253565
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1253565 - [webext] Add "UnrecognizedProperty" to commands manifest properties. r=kmag MozReview-Commit-ID: 9r2MaceQ4Kk
browser/components/extensions/schemas/commands.json
browser/components/extensions/test/browser/browser_ext_commands_onCommand.js
--- a/browser/components/extensions/schemas/commands.json
+++ b/browser/components/extensions/schemas/commands.json
@@ -22,16 +22,17 @@
       {
         "$extend": "WebExtensionManifest",
         "properties": {
           "commands": {
             "type": "object",
             "optional": true,
             "additionalProperties": {
               "type": "object",
+              "additionalProperties": { "$ref": "UnrecognizedProperty" },
               "properties": {
                 "suggested_key": {
                   "type": "object",
                   "optional": true,
                   "properties": {
                     "default": {
                       "$ref": "KeyName",
                       "optional": true
@@ -138,9 +139,9 @@
               }
             ],
             "description": "Called to return the registered commands."
           }
         ]
       }
     ]
   }
-]
\ No newline at end of file
+]
--- a/browser/components/extensions/test/browser/browser_ext_commands_onCommand.js
+++ b/browser/components/extensions/test/browser/browser_ext_commands_onCommand.js
@@ -16,28 +16,37 @@ add_task(function* () {
           "suggested_key": {
             "default": "Alt+Shift+3",
           },
         },
         "toggle-feature-using-alt-shift-comma": {
           "suggested_key": {
             "default": "Alt+Shift+Comma",
           },
+          "unrecognized_property": "with-a-random-value",
         },
       },
     },
 
     background: function() {
       browser.commands.onCommand.addListener((message) => {
         browser.test.sendMessage("oncommand", message);
       });
       browser.test.sendMessage("ready");
     },
   });
 
+
+  SimpleTest.waitForExplicitFinish();
+  let waitForConsole = new Promise(resolve => {
+    SimpleTest.monitorConsole(resolve, [{
+      message: /Reading manifest: Error processing commands.*.unrecognized_property: An unexpected property was found/,
+    }]);
+  });
+
   yield extension.startup();
   yield extension.awaitMessage("ready");
 
   // Create another window after the extension is loaded.
   let win2 = yield BrowserTestUtils.openNewBrowserWindow();
   yield BrowserTestUtils.loadURI(win2.gBrowser.selectedBrowser, "about:config");
   yield BrowserTestUtils.browserLoaded(win2.gBrowser.selectedBrowser);
 
@@ -66,9 +75,12 @@ add_task(function* () {
   keyset = win1.document.getElementById(keysetID);
   is(keyset, null, "Expected keyset to be removed from the window");
 
   keyset = win2.document.getElementById(keysetID);
   is(keyset, null, "Expected keyset to be removed from the window");
 
   yield BrowserTestUtils.closeWindow(win1);
   yield BrowserTestUtils.closeWindow(win2);
+
+  SimpleTest.endMonitorConsole();
+  yield waitForConsole;
 });