Bug 1223634 - Support exclude_globs/include_globs in webext manifests. r=kmag
☠☠ backed out by 970a2294eb5f ☠ ☠
authorTom Schuster <evilpies@gmail.com>
Wed, 16 Mar 2016 14:59:20 +0100
changeset 288976 41042ab2e4bc95244aede30bd5dcf26772e979be
parent 288975 1789a471b2d50ce505326b86a6931b8b2b3c0b08
child 288977 970a2294eb5f43f9d66d77c1d7165169e26d1a60
push id73641
push userevilpies@gmail.com
push dateWed, 16 Mar 2016 13:59:52 +0000
treeherdermozilla-inbound@41042ab2e4bc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag
bugs1223634
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 1223634 - Support exclude_globs/include_globs in webext manifests. r=kmag
browser/components/extensions/ext-windows.js
browser/components/extensions/schemas/windows.json
browser/components/extensions/test/browser/browser_ext_windows_update.js
--- a/browser/components/extensions/ext-windows.js
+++ b/browser/components/extensions/ext-windows.js
@@ -188,16 +188,21 @@ extensions.registerSchemaAPI("windows", 
         if (updateInfo.focused) {
           Services.focus.activeWindow = window;
         }
 
         if (updateInfo.state !== null) {
           WindowManager.setState(window, updateInfo.state);
         }
 
+        if (updateInfo.drawAttention) {
+          // Firefox can't cancel attention actions.
+          window.getAttention();
+        }
+
         // TODO: All the other properties, focused=false...
 
         return Promise.resolve(WindowManager.convert(extension, window));
       },
 
       remove: function(windowId) {
         let window = WindowManager.getWindow(windowId, context);
         window.close();
--- a/browser/components/extensions/schemas/windows.json
+++ b/browser/components/extensions/schemas/windows.json
@@ -404,17 +404,16 @@
                 "description": "The height to resize the window to in pixels. This value is ignored for panels."
               },
               "focused": {
                 "type": "boolean",
                 "optional": true,
                 "description": "If true, brings the window to the front. If false, brings the next window in the z-order to the front."
               },
               "drawAttention": {
-                "unsupported": true,
                 "type": "boolean",
                 "optional": true,
                 "description": "If true, causes the window to be displayed in a manner that draws the user's attention to the window, without changing the focused window. The effect lasts until the user changes focus to the window. This option has no effect if the window already has focus. Set to false to cancel a previous draw attention request."
               },
               "state": {
                 "$ref": "WindowState",
                 "optional": true,
                 "description": "The new state of the window. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined with 'left', 'top', 'width' or 'height'."
--- a/browser/components/extensions/test/browser/browser_ext_windows_update.js
+++ b/browser/components/extensions/test/browser/browser_ext_windows_update.js
@@ -120,8 +120,32 @@ add_task(function* testWindowUpdate() {
 
     extension.sendMessage("checked-window");
   });
 
   yield extension.startup();
   yield extension.awaitFinish("window-update");
   yield extension.unload();
 });
+
+add_task(function* () {
+  let window1 = window;
+  let window2 = yield BrowserTestUtils.openNewBrowserWindow();
+
+  let extension = ExtensionTestUtils.loadExtension({
+    background: function() {
+      browser.windows.getAll(undefined, function(wins) {
+        browser.test.assertEq(wins.length, 2, "should have two windows");
+
+        let unfocused = wins.find(win => !win.focused);
+        browser.windows.update(unfocused.id, {drawAttention: true}, function() {
+          browser.test.sendMessage("check");
+        });
+      });
+    },
+  });
+
+  yield Promise.all([extension.startup(), extension.awaitMessage("check")]);
+
+  yield extension.unload();
+
+  yield BrowserTestUtils.closeWindow(window2);
+});