diff --git a/b2g/chrome/content/devtools.js b/b2g/chrome/content/devtools.js index 862f27417352..e2b5ab5e5e21 100644 --- a/b2g/chrome/content/devtools.js +++ b/b2g/chrome/content/devtools.js @@ -7,7 +7,7 @@ const DEVELOPER_HUD_LOG_PREFIX = 'DeveloperHUD'; XPCOMUtils.defineLazyGetter(this, 'devtools', function() { - const {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}); + const {devtools} = Cu.import('resource://gre/modules/devtools/Loader.jsm', {}); return devtools; }); @@ -16,15 +16,15 @@ XPCOMUtils.defineLazyGetter(this, 'DebuggerClient', function() { }); XPCOMUtils.defineLazyGetter(this, 'WebConsoleUtils', function() { - return devtools.require("devtools/toolkit/webconsole/utils").Utils; + return devtools.require('devtools/toolkit/webconsole/utils').Utils; }); XPCOMUtils.defineLazyGetter(this, 'EventLoopLagFront', function() { - return devtools.require("devtools/server/actors/eventlooplag").EventLoopLagFront; + return devtools.require('devtools/server/actors/eventlooplag').EventLoopLagFront; }); XPCOMUtils.defineLazyGetter(this, 'MemoryFront', function() { - return devtools.require("devtools/server/actors/memory").MemoryFront; + return devtools.require('devtools/server/actors/memory').MemoryFront; }); @@ -47,7 +47,7 @@ let developerHUD = { * on app frames that are being tracked. A watcher must implement the * `trackTarget(target)` and `untrackTarget(target)` methods, register * observed metrics with `target.register(metric)`, and keep them up-to-date - * with `target.update(metric, value, message)` when necessary. + * with `target.update(metric, message)` when necessary. */ registerWatcher: function dwp_registerWatcher(watcher) { this._watchers.unshift(watcher); @@ -210,15 +210,24 @@ Target.prototype = { * Modify one of a target's metrics, and send out an event to notify relevant * parties (e.g. the developer HUD, automated tests, etc). */ - update: function target_update(metric, value = 0, message) { + update: function target_update(metric, message) { + if (!metric.name) { + throw new Error('Missing metric.name'); + } + + if (!metric.value) { + metric.value = 0; + } + let metrics = this.metrics; - metrics.set(metric, value); + if (metrics) { + metrics.set(metric.name, metric.value); + } let data = { metrics: [], // FIXME(Bug 982066) Remove this field. manifest: this.frame.appManifestURL, metric: metric, - value: value, message: message }; @@ -240,7 +249,8 @@ Target.prototype = { * to be incremented. */ bump: function target_bump(metric, message) { - this.update(metric, this.metrics.get(metric) + 1, message); + metric.value = (this.metrics.get(metric.name) || 0) + 1; + this.update(metric, message); }, /** @@ -248,7 +258,8 @@ Target.prototype = { * anymore. */ clear: function target_clear(metric) { - this.update(metric, 0); + metric.value = 0; + this.update(metric); }, /** @@ -307,7 +318,7 @@ let consoleWatcher = { // If unwatched, remove any existing widgets for that metric. for (let target of this._targets.values()) { - target.clear(metric); + target.clear({name: metric}); } }); } @@ -345,7 +356,7 @@ let consoleWatcher = { consoleListener: function cw_consoleListener(type, packet) { let target = this._targets.get(packet.from); - let metric; + let metric = {}; let output = ''; switch (packet.type) { @@ -354,15 +365,15 @@ let consoleWatcher = { let pageError = packet.pageError; if (pageError.warning || pageError.strict) { - metric = 'warnings'; + metric.name = 'warnings'; output += 'warning ('; } else { - metric = 'errors'; + metric.name = 'errors'; output += 'error ('; } if (this._security.indexOf(pageError.category) > -1) { - metric = 'security'; + metric.name = 'security'; } let {errorMessage, sourceName, category, lineNumber, columnNumber} = pageError; @@ -374,12 +385,12 @@ let consoleWatcher = { switch (packet.message.level) { case 'error': - metric = 'errors'; + metric.name = 'errors'; output += 'error (console)'; break; case 'warn': - metric = 'warnings'; + metric.name = 'warnings'; output += 'warning (console)'; break; @@ -389,18 +400,22 @@ let consoleWatcher = { break; case 'reflowActivity': - metric = 'reflows'; + metric.name = 'reflows'; - let {start, end, sourceURL} = packet; + let {start, end, sourceURL, interruptible} = packet; + metric.interruptible = interruptible; let duration = Math.round((end - start) * 100) / 100; output += 'reflow: ' + duration + 'ms'; if (sourceURL) { output += ' ' + this.formatSourceURL(packet); } break; + + default: + return; } - if (!this._watching[metric]) { + if (!this._watching[metric.name]) { return; } @@ -446,7 +461,7 @@ let eventLoopLagWatcher = { fronts.get(target).start(); } else { fronts.get(target).stop(); - target.clear('jank'); + target.clear({name: 'jank'}); } } }, @@ -458,7 +473,7 @@ let eventLoopLagWatcher = { this._fronts.set(target, front); front.on('event-loop-lag', time => { - target.update('jank', time, 'jank: ' + time + 'ms'); + target.update({name: 'jank', value: time}, 'jank: ' + time + 'ms'); }); if (this._active) { @@ -514,7 +529,7 @@ let memoryWatcher = { } else { for (let target of this._fronts.keys()) { clearTimeout(this._timers.get(target)); - target.clear('memory'); + target.clear({name: 'memory'}); } } }); @@ -550,7 +565,7 @@ let memoryWatcher = { } // TODO Also count images size (bug #976007). - target.update('memory', total); + target.update({name: 'memory', value: total}); let duration = parseInt(data.jsMilliseconds) + parseInt(data.nonJSMilliseconds); let timer = setTimeout(() => this.measure(target), 100 * duration); this._timers.set(target, timer); diff --git a/browser/base/content/aboutaccounts/fonts.css b/browser/base/content/aboutaccounts/fonts.css index 07bef17e1789..df9da3ad9066 100644 --- a/browser/base/content/aboutaccounts/fonts.css +++ b/browser/base/content/aboutaccounts/fonts.css @@ -4,7 +4,7 @@ font-weight: 400; src: local('Fira Sans'), local('FiraSans'), - url('fonts/firasans-regular.woff') format('woff'); + url('../fonts/FiraSans-Regular.woff') format('woff'); } @font-face { font-family: 'Fira Sans'; @@ -12,7 +12,7 @@ font-weight: 300; src: local('Fira Sans Light'), local('FiraSansLight'), - url('fonts/firasans-light.woff') format('woff'); + url('../fonts/FiraSans-Light.woff') format('woff'); } @font-face { font-family: 'Clear Sans'; @@ -20,6 +20,5 @@ font-weight: 400; src: local('Clear Sans'), local('ClearSans'), - url('fonts/clearsans-regular.woff') format('woff'); + url('../fonts/ClearSans-Regular.woff') format('woff'); } - diff --git a/browser/base/content/browser-places.js b/browser/base/content/browser-places.js index e8a59e975133..bcc5e179deed 100644 --- a/browser/base/content/browser-places.js +++ b/browser/base/content/browser-places.js @@ -63,6 +63,10 @@ var StarUI = { if (!this._element("editBookmarkPanelContent").hidden) this.quitEditMode(); + if (this._anchorToolbarButton) { + this._anchorToolbarButton.removeAttribute("open"); + this._anchorToolbarButton = null; + } this._restoreCommandsState(); this._itemId = -1; if (this._batching) { @@ -186,6 +190,21 @@ var StarUI = { this._itemId = aItemId !== undefined ? aItemId : this._itemId; this.beginBatch(); + if (aAnchorElement) { + // Set the open=true attribute if the anchor is a + // descendent of a toolbarbutton. + let parent = aAnchorElement.parentNode; + while (parent) { + if (parent.localName == "toolbarbutton") { + break; + } + parent = parent.parentNode; + } + if (parent) { + this._anchorToolbarButton = parent; + parent.setAttribute("open", "true"); + } + } this.panel.openPopup(aAnchorElement, aPosition); gEditItemOverlay.initPanel(this._itemId, diff --git a/browser/base/content/browser-syncui.js b/browser/base/content/browser-syncui.js index a7954e872dae..9d55cd6f0c2c 100644 --- a/browser/base/content/browser-syncui.js +++ b/browser/base/content/browser-syncui.js @@ -237,10 +237,6 @@ let gSyncUI = { }, _getAppName: function () { - try { - let syncStrings = new StringBundle("chrome://browser/locale/sync.properties"); - return syncStrings.getFormattedString("sync.defaultAccountApplication", [brandName]); - } catch (ex) {} let brand = new StringBundle("chrome://branding/locale/brand.properties"); return brand.get("brandShortName"); }, diff --git a/browser/base/content/aboutaccounts/fonts/clearsans-regular.woff b/browser/base/content/fonts/ClearSans-Regular.woff similarity index 100% rename from browser/base/content/aboutaccounts/fonts/clearsans-regular.woff rename to browser/base/content/fonts/ClearSans-Regular.woff diff --git a/browser/base/content/aboutaccounts/fonts/firasans-light.woff b/browser/base/content/fonts/FiraSans-Light.woff similarity index 100% rename from browser/base/content/aboutaccounts/fonts/firasans-light.woff rename to browser/base/content/fonts/FiraSans-Light.woff diff --git a/browser/base/content/aboutaccounts/fonts/firasans-regular.woff b/browser/base/content/fonts/FiraSans-Regular.woff similarity index 100% rename from browser/base/content/aboutaccounts/fonts/firasans-regular.woff rename to browser/base/content/fonts/FiraSans-Regular.woff diff --git a/browser/base/jar.mn b/browser/base/jar.mn index 61ac60625e33..026cadcb5d64 100644 --- a/browser/base/jar.mn +++ b/browser/base/jar.mn @@ -56,9 +56,6 @@ browser.jar: content/browser/aboutaccounts/main.css (content/aboutaccounts/main.css) content/browser/aboutaccounts/normalize.css (content/aboutaccounts/normalize.css) content/browser/aboutaccounts/fonts.css (content/aboutaccounts/fonts.css) - content/browser/aboutaccounts/fonts/clearsans-regular.woff (content/aboutaccounts/fonts/clearsans-regular.woff) - content/browser/aboutaccounts/fonts/firasans-light.woff (content/aboutaccounts/fonts/firasans-light.woff) - content/browser/aboutaccounts/fonts/firasans-regular.woff (content/aboutaccounts/fonts/firasans-regular.woff) content/browser/aboutaccounts/images/fox.png (content/aboutaccounts/images/fox.png) content/browser/aboutaccounts/images/graphic_sync_intro.png (content/aboutaccounts/images/graphic_sync_intro.png) content/browser/aboutaccounts/images/graphic_sync_intro@2x.png (content/aboutaccounts/images/graphic_sync_intro@2x.png) @@ -77,6 +74,9 @@ browser.jar: * content/browser/browser-tabPreviews.xml (content/browser-tabPreviews.xml) * content/browser/chatWindow.xul (content/chatWindow.xul) content/browser/content.js (content/content.js) + content/browser/fonts/ClearSans-Regular.woff (content/fonts/ClearSans-Regular.woff) + content/browser/fonts/FiraSans-Regular.woff (content/fonts/FiraSans-Regular.woff) + content/browser/fonts/FiraSans-Light.woff (content/fonts/FiraSans-Light.woff) content/browser/newtab/newTab.xul (content/newtab/newTab.xul) * content/browser/newtab/newTab.js (content/newtab/newTab.js) content/browser/newtab/newTab.css (content/newtab/newTab.css) diff --git a/browser/components/customizableui/src/CustomizableUI.jsm b/browser/components/customizableui/src/CustomizableUI.jsm index 01c12ddcf985..61b8b4c6b905 100644 --- a/browser/components/customizableui/src/CustomizableUI.jsm +++ b/browser/components/customizableui/src/CustomizableUI.jsm @@ -297,11 +297,12 @@ let CustomizableUIInternal = { let areaIsKnown = gAreas.has(aName); let props = areaIsKnown ? gAreas.get(aName) : new Map(); - if (areaIsKnown && aProperties["type"] && - props.get("type") != aProperties["type"]) { - throw new Error("An area cannot change types"); - } + const kImmutableProperties = new Set(["type", "legacy", "overflowable"]); for (let key in aProperties) { + if (areaIsKnown && kImmutableProperties.has(key) && + props.get(key) != aProperties[key]) { + throw new Error("An area cannot change the property for '" + key + "'"); + } //XXXgijs for special items, we need to make sure they have an appropriate ID // so we aren't perpetually in a non-default state: if (key == "defaultPlacements" && Array.isArray(aProperties[key])) { @@ -3458,8 +3459,8 @@ function WidgetSingleWrapper(aWidget, aNode) { this[prop] = aWidget[prop]; } - const nodeProps = ["label", "tooltiptext"]; - for (let prop of nodeProps) { + const kNodeProps = ["label", "tooltiptext"]; + for (let prop of kNodeProps) { let propertyName = prop; // Look at the node for these, instead of the widget data, to ensure the // wrapper always reflects this live instance. diff --git a/browser/components/customizableui/test/browser.ini b/browser/components/customizableui/test/browser.ini index 900fef499337..f3bbfd204fea 100644 --- a/browser/components/customizableui/test/browser.ini +++ b/browser/components/customizableui/test/browser.ini @@ -105,6 +105,6 @@ skip-if = os == "linux" [browser_992747_toggle_noncustomizable_toolbar.js] [browser_993322_widget_notoolbar.js] [browser_995164_registerArea_during_customize_mode.js] -[browser_996364_defaultCollapsed.js] +[browser_996364_registerArea_different_properties.js] [browser_bootstrapped_custom_toolbar.js] [browser_panel_toggle.js] diff --git a/browser/components/customizableui/test/browser_995164_registerArea_during_customize_mode.js b/browser/components/customizableui/test/browser_995164_registerArea_during_customize_mode.js index f10f8fd17ea4..04b2896a6ecb 100644 --- a/browser/components/customizableui/test/browser_995164_registerArea_during_customize_mode.js +++ b/browser/components/customizableui/test/browser_995164_registerArea_during_customize_mode.js @@ -58,7 +58,19 @@ add_task(function*() { let otherTB = otherWin.document.createElementNS(kNSXUL, "toolbar"); otherTB.id = TOOLBARID; otherTB.setAttribute("customizable", "true"); + let wasInformedCorrectlyOfAreaAppearing = false; + let listener = { + onAreaNodeRegistered: function(aArea, aNode) { + if (aNode == otherTB) { + wasInformedCorrectlyOfAreaAppearing = true; + } + } + }; + CustomizableUI.addListener(listener); otherWin.gNavToolbox.appendChild(otherTB); + ok(wasInformedCorrectlyOfAreaAppearing, "Should have been told area was registered."); + CustomizableUI.removeListener(listener); + ok(otherTB.querySelector("#sync-button"), "Sync button is on other toolbar, too."); simulateItemDrag(syncButton, gNavToolbox.palette); @@ -73,18 +85,25 @@ add_task(function*() { ok(otherTB.querySelector("#sync-button"), "Sync button is on other toolbar, too."); let wasInformedCorrectlyOfAreaDisappearing = false; - let listener = { + let windowClosed = null; + listener = { onAreaNodeUnregistered: function(aArea, aNode, aReason) { if (aArea == TOOLBARID) { is(aNode, otherTB, "Should be informed about other toolbar"); is(aReason, CustomizableUI.REASON_WINDOW_CLOSED, "Reason should be correct."); wasInformedCorrectlyOfAreaDisappearing = (aReason === CustomizableUI.REASON_WINDOW_CLOSED); } - } + }, + onWindowClosed: function(aWindow) { + if (aWindow == otherWin) { + windowClosed = aWindow; + } + }, }; CustomizableUI.addListener(listener); yield promiseWindowClosed(otherWin); + is(windowClosed, otherWin, "Window should have sent onWindowClosed notification."); ok(wasInformedCorrectlyOfAreaDisappearing, "Should be told about window closing."); CustomizableUI.removeListener(listener); // Closing the other window should not be counted against this window's customize mode: diff --git a/browser/components/customizableui/test/browser_996364_defaultCollapsed.js b/browser/components/customizableui/test/browser_996364_defaultCollapsed.js deleted file mode 100644 index 95ada210f57a..000000000000 --- a/browser/components/customizableui/test/browser_996364_defaultCollapsed.js +++ /dev/null @@ -1,56 +0,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/. */ - -"use strict"; - -// Calling CustomizableUI.registerArea twice with no -// properties should not throw an exception. -add_task(function() { - try { - CustomizableUI.registerArea("area-996364", {}); - CustomizableUI.registerArea("area-996364", {}); - } catch (ex) { - ok(false, ex.message); - } - - CustomizableUI.unregisterArea("area-996364", true); -}); - -add_task(function() { - let exceptionThrown = false; - try { - CustomizableUI.registerArea("area-996364-2", {"type": CustomizableUI.TYPE_TOOLBAR, "defaultCollapsed": "false"}); - } catch (ex) { - exceptionThrown = true; - } - ok(exceptionThrown, "defaultCollapsed is not allowed as an external property"); - - // No need to unregister the area because registration fails. -}); - -add_task(function() { - let exceptionThrown; - try { - CustomizableUI.registerArea("area-996364-3", {"type": CustomizableUI.TYPE_TOOLBAR}); - CustomizableUI.registerArea("area-996364-3", {"type": CustomizableUI.TYPE_MENU_PANEL}); - } catch (ex) { - exceptionThrown = ex; - } - ok(exceptionThrown, "Exception expected, an area cannot change types: " + (exceptionThrown ? exceptionThrown : "[no exception]")); - - CustomizableUI.unregisterArea("area-996364-3", true); -}); - -add_task(function() { - let exceptionThrown; - try { - CustomizableUI.registerArea("area-996364-4", {"type": CustomizableUI.TYPE_MENU_PANEL}); - CustomizableUI.registerArea("area-996364-4", {"type": CustomizableUI.TYPE_TOOLBAR}); - } catch (ex) { - exceptionThrown = ex; - } - ok(exceptionThrown, "Exception expected, an area cannot change types: " + (exceptionThrown ? exceptionThrown : "[no exception]")); - - CustomizableUI.unregisterArea("area-996364-4", true); -}); diff --git a/browser/components/customizableui/test/browser_996364_registerArea_different_properties.js b/browser/components/customizableui/test/browser_996364_registerArea_different_properties.js new file mode 100644 index 000000000000..7444b65a327d --- /dev/null +++ b/browser/components/customizableui/test/browser_996364_registerArea_different_properties.js @@ -0,0 +1,112 @@ +/* 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/. */ + +"use strict"; + +// Calling CustomizableUI.registerArea twice with no +// properties should not throw an exception. +add_task(function() { + try { + CustomizableUI.registerArea("area-996364", {}); + CustomizableUI.registerArea("area-996364", {}); + } catch (ex) { + ok(false, ex.message); + } + + CustomizableUI.unregisterArea("area-996364", true); +}); + +add_task(function() { + let exceptionThrown = false; + try { + CustomizableUI.registerArea("area-996364-2", {type: CustomizableUI.TYPE_TOOLBAR, defaultCollapsed: "false"}); + } catch (ex) { + exceptionThrown = true; + } + ok(exceptionThrown, "defaultCollapsed is not allowed as an external property"); + + // No need to unregister the area because registration fails. +}); + +add_task(function() { + let exceptionThrown; + try { + CustomizableUI.registerArea("area-996364-3", {type: CustomizableUI.TYPE_TOOLBAR}); + CustomizableUI.registerArea("area-996364-3", {type: CustomizableUI.TYPE_MENU_PANEL}); + } catch (ex) { + exceptionThrown = ex; + } + ok(exceptionThrown, "Exception expected, an area cannot change types: " + (exceptionThrown ? exceptionThrown : "[no exception]")); + + CustomizableUI.unregisterArea("area-996364-3", true); +}); + +add_task(function() { + let exceptionThrown; + try { + CustomizableUI.registerArea("area-996364-4", {type: CustomizableUI.TYPE_MENU_PANEL}); + CustomizableUI.registerArea("area-996364-4", {type: CustomizableUI.TYPE_TOOLBAR}); + } catch (ex) { + exceptionThrown = ex; + } + ok(exceptionThrown, "Exception expected, an area cannot change types: " + (exceptionThrown ? exceptionThrown : "[no exception]")); + + CustomizableUI.unregisterArea("area-996364-4", true); +}); + +add_task(function() { + let exceptionThrown; + try { + CustomizableUI.registerArea("area-996899-1", { anchor: "PanelUI-menu-button", + type: CustomizableUI.TYPE_MENU_PANEL, + defaultPlacements: [] }); + CustomizableUI.registerArea("area-996899-1", { anchor: "home-button", + type: CustomizableUI.TYPE_MENU_PANEL, + defaultPlacements: [] }); + } catch (ex) { + exceptionThrown = ex; + } + ok(!exceptionThrown, "Changing anchors shouldn't throw an exception: " + (exceptionThrown ? exceptionThrown : "[no exception]")); + CustomizableUI.unregisterArea("area-996899-1", true); +}); + +add_task(function() { + let exceptionThrown; + try { + CustomizableUI.registerArea("area-996899-2", { anchor: "PanelUI-menu-button", + type: CustomizableUI.TYPE_MENU_PANEL, + defaultPlacements: [] }); + CustomizableUI.registerArea("area-996899-2", { anchor: "PanelUI-menu-button", + type: CustomizableUI.TYPE_MENU_PANEL, + defaultPlacements: ["feed-button"] }); + } catch (ex) { + exceptionThrown = ex; + } + ok(!exceptionThrown, "Changing defaultPlacements shouldn't throw an exception: " + (exceptionThrown ? exceptionThrown : "[no exception]")); + CustomizableUI.unregisterArea("area-996899-2", true); +}); + +add_task(function() { + let exceptionThrown; + try { + CustomizableUI.registerArea("area-996899-3", { legacy: true }); + CustomizableUI.registerArea("area-996899-3", { legacy: false }); + } catch (ex) { + exceptionThrown = ex; + } + ok(exceptionThrown, "Changing 'legacy' should throw an exception: " + (exceptionThrown ? exceptionThrown : "[no exception]")); + CustomizableUI.unregisterArea("area-996899-3", true); +}); + +add_task(function() { + let exceptionThrown; + try { + CustomizableUI.registerArea("area-996899-4", { overflowable: true }); + CustomizableUI.registerArea("area-996899-4", { overflowable: false }); + } catch (ex) { + exceptionThrown = ex; + } + ok(exceptionThrown, "Changing 'overflowable' should throw an exception: " + (exceptionThrown ? exceptionThrown : "[no exception]")); + CustomizableUI.unregisterArea("area-996899-4", true); +}); diff --git a/browser/components/sessionstore/src/SessionStore.jsm b/browser/components/sessionstore/src/SessionStore.jsm index b7bf3519f549..9fb38addf13a 100644 --- a/browser/components/sessionstore/src/SessionStore.jsm +++ b/browser/components/sessionstore/src/SessionStore.jsm @@ -678,8 +678,6 @@ let SessionStoreInternal = { debug("received unknown message '" + aMessage.name + "'"); break; } - - this._clearRestoringWindows(); }, /** @@ -3400,6 +3398,15 @@ let SessionStoreInternal = { this._closedWindows.splice(spliceTo, this._closedWindows.length); }, + /** + * Clears the set of windows that are "resurrected" before writing to disk to + * make closing windows one after the other until shutdown work as expected. + * + * This function should only be called when we are sure that there has been + * a user action that indicates the browser is actively being used and all + * windows that have been closed before are not part of a series of closing + * windows. + */ _clearRestoringWindows: function ssi_clearRestoringWindows() { for (let i = 0; i < this._closedWindows.length; i++) { delete this._closedWindows[i]._shouldRestore; diff --git a/browser/components/sessionstore/test/browser_819510_perwindowpb.js b/browser/components/sessionstore/test/browser_819510_perwindowpb.js index fc4e93a0003d..562c5aed9f37 100644 --- a/browser/components/sessionstore/test/browser_819510_perwindowpb.js +++ b/browser/components/sessionstore/test/browser_819510_perwindowpb.js @@ -115,25 +115,27 @@ function test_3() { is(curState.selectedWindow, 4, "Last window opened is the one selected"); waitForWindowClose(normalWindow, function() { - // Load another tab before checking the written state so that + // Pin and unpin a tab before checking the written state so that // the list of restoring windows gets cleared. Otherwise the // window we just closed would be marked as not closed. - waitForTabLoad(aWindow, "http://www.example.com/", function() { - forceWriteState(function(state) { - is(state.windows.length, 2, - "sessionstore state: 2 windows in data being written to disk"); - is(state.selectedWindow, 2, - "Selected window is updated to match one of the saved windows"); - state.windows.forEach(function(win) { - is(!win.isPrivate, true, "Saved window is not private"); - }); - is(state._closedWindows.length, 1, - "sessionstore state: 1 closed window in data being written to disk"); - state._closedWindows.forEach(function(win) { - is(!win.isPrivate, true, "Closed window is not private"); - }); - runNextTest(); + let tab = aWindow.gBrowser.tabs[0]; + aWindow.gBrowser.pinTab(tab); + aWindow.gBrowser.unpinTab(tab); + + forceWriteState(function(state) { + is(state.windows.length, 2, + "sessionstore state: 2 windows in data being written to disk"); + is(state.selectedWindow, 2, + "Selected window is updated to match one of the saved windows"); + state.windows.forEach(function(win) { + is(!win.isPrivate, true, "Saved window is not private"); }); + is(state._closedWindows.length, 1, + "sessionstore state: 1 closed window in data being written to disk"); + state._closedWindows.forEach(function(win) { + is(!win.isPrivate, true, "Closed window is not private"); + }); + runNextTest(); }); }); }); diff --git a/browser/devtools/debugger/test/addon-source/browser_dbg_addon4/chrome.manifest b/browser/devtools/debugger/test/addon-source/browser_dbg_addon4/chrome.manifest new file mode 100644 index 000000000000..ccb88ddf1410 --- /dev/null +++ b/browser/devtools/debugger/test/addon-source/browser_dbg_addon4/chrome.manifest @@ -0,0 +1 @@ +content browser_dbg_addon4 . diff --git a/browser/devtools/debugger/test/addon-source/browser_dbg_addon4/test.xul b/browser/devtools/debugger/test/addon-source/browser_dbg_addon4/test.xul new file mode 100644 index 000000000000..733817ad81ea --- /dev/null +++ b/browser/devtools/debugger/test/addon-source/browser_dbg_addon4/test.xul @@ -0,0 +1,8 @@ + + + + + +