From 52e365bb7b009e8a946d1c1338f1afabb58faa06 Mon Sep 17 00:00:00 2001 From: Shu-yu Guo Date: Tue, 6 Oct 2015 14:00:30 -0700 Subject: [PATCH] Bug 1202902 - Fix the world. (r=ato for marionette, rs=Mossop for rest) --- accessible/tests/mochitest/relations.js | 40 +++++------ .../source/test/fixtures/addon/bootstrap.js | 2 +- addon-sdk/source/test/test-content-script.js | 2 +- browser/base/content/browser.js | 2 + .../test/general/healthreport_pingData.js | 2 +- browser/base/content/urlbarBindings.xml | 18 +++-- .../customizableui/content/panelUI.js | 2 + ...browser_1096763_seen_widgets_post_reset.js | 7 +- .../components/downloads/content/downloads.js | 14 +++- .../components/downloads/content/indicator.js | 5 ++ .../loop/modules/LoopRoomsCache.jsm | 1 + .../loop/modules/MozLoopService.jsm | 8 +++ .../sessionstore/test/browser_privatetabs.js | 4 -- browser/experiments/Experiments.jsm | 1 + browser/modules/Windows8WindowFrameColor.jsm | 2 +- .../client/canvasdebugger/canvasdebugger.js | 1 + .../client/debugger/debugger-controller.js | 3 + devtools/client/debugger/debugger-view.js | 13 ++++ .../browser_dbg_break-on-next-console.js | 6 +- .../mochitest/browser_dbg_break-on-next.js | 20 ++++-- .../browser_dbg_pause-exceptions-01.js | 12 ++-- .../browser_dbg_pause-exceptions-02.js | 8 +-- .../browser_dbg_variables-view-06.js | 2 +- .../browser_dbg_variables-view-filter-01.js | 24 +++++-- .../browser_dbg_variables-view-filter-02.js | 20 +++++- .../browser_dbg_variables-view-filter-03.js | 20 +++++- .../browser_dbg_variables-view-filter-04.js | 69 +++++++++++-------- .../browser_dbg_variables-view-filter-05.js | 44 ++++++++---- ..._dbg_variables-view-frame-parameters-01.js | 14 +++- ..._dbg_variables-view-frame-parameters-03.js | 8 +-- .../browser_dbg_variables-view-override-01.js | 11 ++- .../browser_dbg_variables-view-popup-16.js | 2 +- .../browser_dbg_variables-view-reexpand-01.js | 17 ++++- .../browser_dbg_variables-view-reexpand-02.js | 17 ++++- .../browser_dbg_variables-view-webidl.js | 4 +- .../test/mochitest/doc_function-search.html | 6 +- devtools/client/debugger/utils.js | 4 +- devtools/client/inspector/inspector-panel.js | 4 +- .../markupview/test/actor_events_form.js | 4 +- .../netmonitor/netmonitor-controller.js | 4 ++ .../performance/performance-controller.js | 5 ++ devtools/client/performance/test/head.js | 5 +- devtools/client/performance/views/overview.js | 2 +- devtools/client/responsivedesign/test/head.js | 2 +- devtools/client/scratchpad/scratchpad.js | 7 ++ .../test/browser_scratchpad_files.js | 4 -- .../test/browser_scratchpad_modeline.js | 7 -- .../test/browser_scratchpad_recent_files.js | 6 -- .../test/browser_scratchpad_reset_undo.js | 6 -- .../browser_scratchpad_revert_to_saved.js | 6 -- devtools/client/shadereditor/shadereditor.js | 1 + devtools/client/shared/test/test-actor.js | 4 +- devtools/client/shared/widgets/TableWidget.js | 5 ++ devtools/client/webaudioeditor/includes.js | 1 + .../client/webaudioeditor/views/context.js | 5 ++ ...-properties-with-non-alphanumeric-names.js | 6 +- devtools/client/webide/content/webide.js | 10 +++ .../server/tests/mochitest/hello-actor.js | 2 +- .../tests/mochitest/test_registerActor.html | 2 +- devtools/server/tests/unit/hello-actor.js | 2 +- .../tests/unit/test_framebindings-02.js | 3 +- .../tests/unit/test_framebindings-05.js | 3 +- devtools/shared/apps/Devices.jsm | 5 ++ .../test/test_commands_registration.html | 1 - .../shared/webconsole/test/test_jsterm.html | 1 - devtools/shared/worker-loader.js | 2 +- ..._anonymousContent_append_after_reflow.html | 2 +- .../test/test_anonymousContent_style_csp.html | 2 +- dom/devicestorage/test/test_fs_remove.html | 2 +- dom/html/test/test_checked.html | 16 ++--- dom/ipc/preload.js | 4 +- dom/mobilemessage/gonk/WspPduHelper.jsm | 12 ++++ dom/plugins/test/unit/test_bug455213.js | 2 - dom/plugins/test/unit/test_bug813245.js | 2 - .../test/unit/test_nice_plugin_name.js | 3 - .../test/unit/test_persist_in_prefs.js | 2 - dom/telephony/gonk/TelephonyService.js | 6 ++ dom/tests/mochitest/chrome/489127.html | 2 +- .../mochitest/chrome/queryCaretRectUnix.html | 4 +- .../mochitest/chrome/queryCaretRectWin.html | 4 +- dom/tests/mochitest/chrome/selectAtPoint.html | 4 +- js/xpconnect/loader/XPCOMUtils.jsm | 11 +++ .../tests/unit/test_writeToGlobalPrototype.js | 2 +- .../chrome/test_session_form_data.html | 6 +- testing/marionette/driver.js | 10 +-- testing/marionette/listener.js | 4 +- testing/marionette/server.js | 2 +- testing/mochitest/b2g_start_script.js | 6 +- .../mochitest/tests/SimpleTest/EventUtils.js | 12 ++++ .../components/TalosPowersService.js | 2 +- toolkit/components/places/UnifiedComplete.js | 16 ++--- .../places/tests/unit/test_null_interfaces.js | 2 - .../thumbnails/BackgroundPageThumbs.jsm | 30 +++++--- .../test/browser_thumbnails_expiration.js | 3 +- toolkit/content/contentAreaUtils.js | 5 ++ toolkit/content/widgets/autocomplete.xml | 8 ++- toolkit/content/widgets/tabbox.xml | 8 ++- toolkit/modules/WindowsRegistry.jsm | 2 +- .../extensions/internal/GMPProvider.jsm | 1 + .../extensions/internal/XPIProvider.jsm | 1 + 100 files changed, 502 insertions(+), 246 deletions(-) diff --git a/accessible/tests/mochitest/relations.js b/accessible/tests/mochitest/relations.js index f34786df5a98..2f46c8d043cc 100644 --- a/accessible/tests/mochitest/relations.js +++ b/accessible/tests/mochitest/relations.js @@ -1,26 +1,26 @@ //////////////////////////////////////////////////////////////////////////////// // Constants -const RELATION_CONTROLLED_BY = nsIAccessibleRelation.RELATION_CONTROLLED_BY; -const RELATION_CONTROLLER_FOR = nsIAccessibleRelation.RELATION_CONTROLLER_FOR; -const RELATION_DEFAULT_BUTTON = nsIAccessibleRelation.RELATION_DEFAULT_BUTTON; -const RELATION_DESCRIBED_BY = nsIAccessibleRelation.RELATION_DESCRIBED_BY; -const RELATION_DESCRIPTION_FOR = nsIAccessibleRelation.RELATION_DESCRIPTION_FOR; -const RELATION_EMBEDDED_BY = nsIAccessibleRelation.RELATION_EMBEDDED_BY; -const RELATION_EMBEDS = nsIAccessibleRelation.RELATION_EMBEDS; -const RELATION_FLOWS_FROM = nsIAccessibleRelation.RELATION_FLOWS_FROM; -const RELATION_FLOWS_TO = nsIAccessibleRelation.RELATION_FLOWS_TO; -const RELATION_LABEL_FOR = nsIAccessibleRelation.RELATION_LABEL_FOR; -const RELATION_LABELLED_BY = nsIAccessibleRelation.RELATION_LABELLED_BY; -const RELATION_MEMBER_OF = nsIAccessibleRelation.RELATION_MEMBER_OF; -const RELATION_NODE_CHILD_OF = nsIAccessibleRelation.RELATION_NODE_CHILD_OF; -const RELATION_NODE_PARENT_OF = nsIAccessibleRelation.RELATION_NODE_PARENT_OF; -const RELATION_PARENT_WINDOW_OF = nsIAccessibleRelation.RELATION_PARENT_WINDOW_OF; -const RELATION_POPUP_FOR = nsIAccessibleRelation.RELATION_POPUP_FOR; -const RELATION_SUBWINDOW_OF = nsIAccessibleRelation.RELATION_SUBWINDOW_OF; -const RELATION_CONTAINING_DOCUMENT = nsIAccessibleRelation.RELATION_CONTAINING_DOCUMENT; -const RELATION_CONTAINING_TAB_PANE = nsIAccessibleRelation.RELATION_CONTAINING_TAB_PANE; -const RELATION_CONTAINING_APPLICATION = nsIAccessibleRelation.RELATION_CONTAINING_APPLICATION; +var RELATION_CONTROLLED_BY = nsIAccessibleRelation.RELATION_CONTROLLED_BY; +var RELATION_CONTROLLER_FOR = nsIAccessibleRelation.RELATION_CONTROLLER_FOR; +var RELATION_DEFAULT_BUTTON = nsIAccessibleRelation.RELATION_DEFAULT_BUTTON; +var RELATION_DESCRIBED_BY = nsIAccessibleRelation.RELATION_DESCRIBED_BY; +var RELATION_DESCRIPTION_FOR = nsIAccessibleRelation.RELATION_DESCRIPTION_FOR; +var RELATION_EMBEDDED_BY = nsIAccessibleRelation.RELATION_EMBEDDED_BY; +var RELATION_EMBEDS = nsIAccessibleRelation.RELATION_EMBEDS; +var RELATION_FLOWS_FROM = nsIAccessibleRelation.RELATION_FLOWS_FROM; +var RELATION_FLOWS_TO = nsIAccessibleRelation.RELATION_FLOWS_TO; +var RELATION_LABEL_FOR = nsIAccessibleRelation.RELATION_LABEL_FOR; +var RELATION_LABELLED_BY = nsIAccessibleRelation.RELATION_LABELLED_BY; +var RELATION_MEMBER_OF = nsIAccessibleRelation.RELATION_MEMBER_OF; +var RELATION_NODE_CHILD_OF = nsIAccessibleRelation.RELATION_NODE_CHILD_OF; +var RELATION_NODE_PARENT_OF = nsIAccessibleRelation.RELATION_NODE_PARENT_OF; +var RELATION_PARENT_WINDOW_OF = nsIAccessibleRelation.RELATION_PARENT_WINDOW_OF; +var RELATION_POPUP_FOR = nsIAccessibleRelation.RELATION_POPUP_FOR; +var RELATION_SUBWINDOW_OF = nsIAccessibleRelation.RELATION_SUBWINDOW_OF; +var RELATION_CONTAINING_DOCUMENT = nsIAccessibleRelation.RELATION_CONTAINING_DOCUMENT; +var RELATION_CONTAINING_TAB_PANE = nsIAccessibleRelation.RELATION_CONTAINING_TAB_PANE; +var RELATION_CONTAINING_APPLICATION = nsIAccessibleRelation.RELATION_CONTAINING_APPLICATION; //////////////////////////////////////////////////////////////////////////////// // General diff --git a/addon-sdk/source/test/fixtures/addon/bootstrap.js b/addon-sdk/source/test/fixtures/addon/bootstrap.js index 988927418268..9134b4d92860 100644 --- a/addon-sdk/source/test/fixtures/addon/bootstrap.js +++ b/addon-sdk/source/test/fixtures/addon/bootstrap.js @@ -6,4 +6,4 @@ const { utils: Cu } = Components; const {require} = Cu.import(`${ROOT}/toolkit/require.js`, {}); const {Bootstrap} = require(`${ROOT}/sdk/addon/bootstrap.js`); -const {startup, shutdown, install, uninstall} = new Bootstrap(); +var {startup, shutdown, install, uninstall} = new Bootstrap(); diff --git a/addon-sdk/source/test/test-content-script.js b/addon-sdk/source/test/test-content-script.js index 295a4cad505a..ecb7338941d0 100644 --- a/addon-sdk/source/test/test-content-script.js +++ b/addon-sdk/source/test/test-content-script.js @@ -727,7 +727,7 @@ exports["test requestAnimationFrame"] = createProxyTest("", function (helper) { exports["testGlobalScope"] = createProxyTest("", function (helper) { helper.createWorker( - 'let toplevelScope = true;' + + 'var toplevelScope = true;' + 'assert(window.toplevelScope, "variables in toplevel scope are set to `window` object");' + 'assert(this.toplevelScope, "variables in toplevel scope are set to `this` object");' + 'done();' diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index c3e933b338e8..2a1a574dec25 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -3722,6 +3722,8 @@ const BrowserSearch = { } }; +XPCOMUtils.defineConstant(this, "BrowserSearch", BrowserSearch); + function FillHistoryMenu(aParent) { // Lazily add the hover listeners on first showing and never remove them if (!aParent.hasStatusListener) { diff --git a/browser/base/content/test/general/healthreport_pingData.js b/browser/base/content/test/general/healthreport_pingData.js index e880c31538ac..1737baba13ef 100644 --- a/browser/base/content/test/general/healthreport_pingData.js +++ b/browser/base/content/test/general/healthreport_pingData.js @@ -1,4 +1,4 @@ -const TEST_PINGS = [ +var TEST_PINGS = [ { type: "test-telemetryArchive-1", payload: { foo: "bar" }, diff --git a/browser/base/content/urlbarBindings.xml b/browser/base/content/urlbarBindings.xml index 8c83f49aa116..a2cd28e10bc9 100644 --- a/browser/base/content/urlbarBindings.xml +++ b/browser/base/content/urlbarBindings.xml @@ -1594,9 +1594,11 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. document.getElementById("addon-progress-notification-progresstext"); - let utils = {}; - Components.utils.import("resource://gre/modules/DownloadUtils.jsm", utils); - utils.DownloadUtils; + { + let utils = {}; + Components.utils.import("resource://gre/modules/DownloadUtils.jsm", utils); + utils.DownloadUtils; + } @@ -2676,11 +2678,13 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. ]]> document.getAnonymousElementByAttribute(this, "anonid", "promo-message"); diff --git a/browser/components/customizableui/content/panelUI.js b/browser/components/customizableui/content/panelUI.js index d8722b2734d0..b03a44aca7a9 100644 --- a/browser/components/customizableui/content/panelUI.js +++ b/browser/components/customizableui/content/panelUI.js @@ -510,6 +510,8 @@ const PanelUI = { }, }; +XPCOMUtils.defineConstant(this, "PanelUI", PanelUI); + /** * Gets the currently selected locale for display. * @return the selected locale or "en-US" if none is selected diff --git a/browser/components/customizableui/test/browser_1096763_seen_widgets_post_reset.js b/browser/components/customizableui/test/browser_1096763_seen_widgets_post_reset.js index 7f4e0e28d326..b707ca10e3c4 100644 --- a/browser/components/customizableui/test/browser_1096763_seen_widgets_post_reset.js +++ b/browser/components/customizableui/test/browser_1096763_seen_widgets_post_reset.js @@ -9,17 +9,18 @@ add_task(function*() { defaultArea: CustomizableUI.AREA_NAVBAR }); + const kPrefCustomizationState = "browser.uiCustomization.state"; let bsPass = Cu.import("resource:///modules/CustomizableUI.jsm", {}); ok(bsPass.gSeenWidgets.has(BUTTONID), "Widget should be seen after createWidget is called."); CustomizableUI.reset(); ok(bsPass.gSeenWidgets.has(BUTTONID), "Widget should still be seen after reset."); - ok(!Services.prefs.prefHasUserValue(bsPass.kPrefCustomizationState), "Pref shouldn't be set right now, because that'd break undo."); + ok(!Services.prefs.prefHasUserValue(kPrefCustomizationState), "Pref shouldn't be set right now, because that'd break undo."); CustomizableUI.addWidgetToArea(BUTTONID, CustomizableUI.AREA_NAVBAR); gCustomizeMode.removeFromArea(document.getElementById(BUTTONID)); - let hasUserValue = Services.prefs.prefHasUserValue(bsPass.kPrefCustomizationState); + let hasUserValue = Services.prefs.prefHasUserValue(kPrefCustomizationState); ok(hasUserValue, "Pref should be set right now."); if (hasUserValue) { - let seenArray = JSON.parse(Services.prefs.getCharPref(bsPass.kPrefCustomizationState)).seen; + let seenArray = JSON.parse(Services.prefs.getCharPref(kPrefCustomizationState)).seen; isnot(seenArray.indexOf(BUTTONID), -1, "Widget should be in saved 'seen' list."); } }); diff --git a/browser/components/downloads/content/downloads.js b/browser/components/downloads/content/downloads.js index 276bdda3deda..de17c5d760bb 100644 --- a/browser/components/downloads/content/downloads.js +++ b/browser/components/downloads/content/downloads.js @@ -580,6 +580,8 @@ const DownloadsPanel = { }, }; +XPCOMUtils.defineConstant(this, "DownloadsPanel", DownloadsPanel); + //////////////////////////////////////////////////////////////////////////////// //// DownloadsOverlayLoader @@ -658,6 +660,8 @@ const DownloadsOverlayLoader = { }, }; +XPCOMUtils.defineConstant(this, "DownloadsOverlayLoader", DownloadsOverlayLoader); + //////////////////////////////////////////////////////////////////////////////// //// DownloadsView @@ -1004,6 +1008,8 @@ const DownloadsView = { }, } +XPCOMUtils.defineConstant(this, "DownloadsView", DownloadsView); + //////////////////////////////////////////////////////////////////////////////// //// DownloadsViewItem @@ -1142,6 +1148,8 @@ const DownloadsViewController = { } }; +XPCOMUtils.defineConstant(this, "DownloadsViewController", DownloadsViewController); + //////////////////////////////////////////////////////////////////////////////// //// DownloadsViewItemController @@ -1488,7 +1496,9 @@ const DownloadsSummary = { delete this._detailsNode; return this._detailsNode = node; } -} +}; + +XPCOMUtils.defineConstant(this, "DownloadsSummary", DownloadsSummary); //////////////////////////////////////////////////////////////////////////////// //// DownloadsFooter @@ -1542,3 +1552,5 @@ const DownloadsFooter = { return this._footerNode = node; } }; + +XPCOMUtils.defineConstant(this, "DownloadsFooter", DownloadsFooter); diff --git a/browser/components/downloads/content/indicator.js b/browser/components/downloads/content/indicator.js index 9261c4997386..b4df74c6067d 100644 --- a/browser/components/downloads/content/indicator.js +++ b/browser/components/downloads/content/indicator.js @@ -577,3 +577,8 @@ const DownloadsIndicatorView = { }, }; +Object.defineProperty(this, "DownloadsIndicatorView", { + value: DownloadsIndicatorView, + enumerable: true, + writable: false +}); diff --git a/browser/components/loop/modules/LoopRoomsCache.jsm b/browser/components/loop/modules/LoopRoomsCache.jsm index c1915723c755..16e37dd256b9 100644 --- a/browser/components/loop/modules/LoopRoomsCache.jsm +++ b/browser/components/loop/modules/LoopRoomsCache.jsm @@ -17,6 +17,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm this.EXPORTED_SYMBOLS = ["LoopRoomsCache"]; const LOOP_ROOMS_CACHE_FILENAME = "loopRoomsCache.json"; +XPCOMUtils.defineConstant(this, "LOOP_ROOMS_CACHE_FILENAME", LOOP_ROOMS_CACHE_FILENAME); /** * RoomsCache is a cache for saving simple rooms data to the disk in case we diff --git a/browser/components/loop/modules/MozLoopService.jsm b/browser/components/loop/modules/MozLoopService.jsm index ef63a91e2c46..7de2d97d5ff6 100644 --- a/browser/components/loop/modules/MozLoopService.jsm +++ b/browser/components/loop/modules/MozLoopService.jsm @@ -112,6 +112,14 @@ this.EXPORTED_SYMBOLS = ["MozLoopService", "LOOP_SESSION_TYPE", "TWO_WAY_MEDIA_CONN_LENGTH", "SHARING_STATE_CHANGE", "SHARING_ROOM_URL", "ROOM_CREATE", "ROOM_DELETE", "ROOM_CONTEXT_ADD"]; +XPCOMUtils.defineConstant(this, "LOOP_SESSION_TYPE", LOOP_SESSION_TYPE); +XPCOMUtils.defineConstant(this, "TWO_WAY_MEDIA_CONN_LENGTH", TWO_WAY_MEDIA_CONN_LENGTH); +XPCOMUtils.defineConstant(this, "SHARING_STATE_CHANGE", SHARING_STATE_CHANGE); +XPCOMUtils.defineConstant(this, "SHARING_ROOM_URL", SHARING_ROOM_URL); +XPCOMUtils.defineConstant(this, "ROOM_CREATE", ROOM_CREATE); +XPCOMUtils.defineConstant(this, "ROOM_DELETE", ROOM_DELETE); +XPCOMUtils.defineConstant(this, "ROOM_CONTEXT_ADD", ROOM_CONTEXT_ADD); + XPCOMUtils.defineLazyModuleGetter(this, "injectLoopAPI", "resource:///modules/loop/MozLoopAPI.jsm"); diff --git a/browser/components/sessionstore/test/browser_privatetabs.js b/browser/components/sessionstore/test/browser_privatetabs.js index 12d8a7bfe89e..7b296bbbf05d 100644 --- a/browser/components/sessionstore/test/browser_privatetabs.js +++ b/browser/components/sessionstore/test/browser_privatetabs.js @@ -1,10 +1,6 @@ /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ -var Imports = {}; -Cu.import("resource:///modules/sessionstore/SessionSaver.jsm", Imports); -var {SessionSaver} = Imports; - add_task(function cleanup() { info("Forgetting closed tabs"); while (ss.getClosedTabCount(window)) { diff --git a/browser/experiments/Experiments.jsm b/browser/experiments/Experiments.jsm index f91ab3778840..739ed5bb8fca 100644 --- a/browser/experiments/Experiments.jsm +++ b/browser/experiments/Experiments.jsm @@ -94,6 +94,7 @@ const TELEMETRY_LOG = { RECHECK: "RECHECK", }, }; +XPCOMUtils.defineConstant(this, "TELEMETRY_LOG", TELEMETRY_LOG); const gPrefs = new Preferences(PREF_BRANCH); const gPrefsTelemetry = new Preferences(PREF_BRANCH_TELEMETRY); diff --git a/browser/modules/Windows8WindowFrameColor.jsm b/browser/modules/Windows8WindowFrameColor.jsm index cb52ad62696d..429d970ca954 100644 --- a/browser/modules/Windows8WindowFrameColor.jsm +++ b/browser/modules/Windows8WindowFrameColor.jsm @@ -11,7 +11,7 @@ Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); var Registry = Cu.import("resource://gre/modules/WindowsRegistry.jsm").WindowsRegistry; -const Windows8WindowFrameColor = { +var Windows8WindowFrameColor = { _windowFrameColor: null, get: function() { diff --git a/devtools/client/canvasdebugger/canvasdebugger.js b/devtools/client/canvasdebugger/canvasdebugger.js index 11d5835034e9..c39bd04dc212 100644 --- a/devtools/client/canvasdebugger/canvasdebugger.js +++ b/devtools/client/canvasdebugger/canvasdebugger.js @@ -77,6 +77,7 @@ const EVENTS = { SOURCE_SHOWN_IN_JS_DEBUGGER: "CanvasDebugger:SourceShownInJsDebugger", SOURCE_NOT_FOUND_IN_JS_DEBUGGER: "CanvasDebugger:SourceNotFoundInJsDebugger" }; +XPCOMUtils.defineConstant(this, "EVENTS", EVENTS); const HTML_NS = "http://www.w3.org/1999/xhtml"; const STRINGS_URI = "chrome://browser/locale/devtools/canvasdebugger.properties"; diff --git a/devtools/client/debugger/debugger-controller.js b/devtools/client/debugger/debugger-controller.js index cd1fee18e070..6fc0137b6ff2 100644 --- a/devtools/client/debugger/debugger-controller.js +++ b/devtools/client/debugger/debugger-controller.js @@ -104,6 +104,7 @@ Cu.import("resource:///modules/devtools/client/shared/widgets/ViewHelpers.jsm"); Cu.import("resource:///modules/devtools/client/shared/browser-loader.js"); const require = BrowserLoader("resource:///modules/devtools/client/debugger/", this).require; +XPCOMUtils.defineConstant(this, "require", require); const {TargetFactory} = require("devtools/client/framework/target"); const {Toolbox} = require("devtools/client/framework/toolbox"); @@ -114,6 +115,8 @@ const DebuggerEditor = require("devtools/client/sourceeditor/debugger"); const {Tooltip} = require("devtools/client/shared/widgets/Tooltip"); const FastListWidget = require("devtools/client/shared/widgets/FastListWidget"); +XPCOMUtils.defineConstant(this, "EVENTS", EVENTS); + XPCOMUtils.defineLazyModuleGetter(this, "Task", "resource://gre/modules/Task.jsm"); diff --git a/devtools/client/debugger/debugger-view.js b/devtools/client/debugger/debugger-view.js index 1dcf5d5aaa8f..47afbe9c9e07 100644 --- a/devtools/client/debugger/debugger-view.js +++ b/devtools/client/debugger/debugger-view.js @@ -49,6 +49,19 @@ const services = { const EventListenersView = require('./content/views/event-listeners-view'); const actions = require('./content/actions/event-listeners'); +Object.defineProperties(this, { + "store": { + value: store, + enumerable: true, + writable: false + }, + "services": { + value: services, + enumerable: true, + writable: false + } +}); + /** * Object defining the debugger view components. */ diff --git a/devtools/client/debugger/test/mochitest/browser_dbg_break-on-next-console.js b/devtools/client/debugger/test/mochitest/browser_dbg_break-on-next-console.js index ff259780cc2e..4fe42eb6438f 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg_break-on-next-console.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg_break-on-next-console.js @@ -40,11 +40,13 @@ function test() { let updatedFrame = yield waitForDebuggerEvents(gPanel, gDebugger.EVENTS.FETCHED_SCOPES); let variables = gDebugger.DebuggerView.Variables; - is(variables._store.length, 2, "Correct number of scopes available"); + is(variables._store.length, 3, "Correct number of scopes available"); is(variables.getScopeAtIndex(0).name, "With scope [Object]", "Paused with correct scope (0)"); - is(variables.getScopeAtIndex(1).name, "Global scope [Window]", + is(variables.getScopeAtIndex(1).name, "Block scope", "Paused with correct scope (1)"); + is(variables.getScopeAtIndex(2).name, "Global scope [Window]", + "Paused with correct scope (2)"); let onceResumed = gTarget.once("thread-resumed"); EventUtils.sendMouseEvent({ type: "mousedown" }, gResumeButton, gDebugger); diff --git a/devtools/client/debugger/test/mochitest/browser_dbg_break-on-next.js b/devtools/client/debugger/test/mochitest/browser_dbg_break-on-next.js index af7064ee8c62..edded224faa2 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg_break-on-next.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg_break-on-next.js @@ -49,13 +49,15 @@ function test() { let updatedFrame = yield waitForDebuggerEvents(gPanel, gDebugger.EVENTS.FETCHED_SCOPES); let variables = gDebugger.DebuggerView.Variables; - is(variables._store.length, 3, "Correct number of scopes available"); + is(variables._store.length, 4, "Correct number of scopes available"); is(variables.getScopeAtIndex(0).name, "Function scope [interval<]", "Paused with correct scope (0)"); is(variables.getScopeAtIndex(1).name, "Block scope", "Paused with correct scope (1)"); - is(variables.getScopeAtIndex(2).name, "Global scope [Window]", + is(variables.getScopeAtIndex(2).name, "Block scope", "Paused with correct scope (2)"); + is(variables.getScopeAtIndex(3).name, "Global scope [Window]", + "Paused with correct scope (3)"); yield evalInTab(gTab, "clearInterval(interval)"); let onceResumed = gTarget.once("thread-resumed"); @@ -76,15 +78,21 @@ function test() { let updatedFrame = yield waitForDebuggerEvents(gPanel, gDebugger.EVENTS.FETCHED_SCOPES); let variables = gDebugger.DebuggerView.Variables; - is(variables._store.length, 4, "Correct number of scopes available"); + is(variables._store.length, 6, "Correct number of scopes available"); is(variables.getScopeAtIndex(0).name, "Function scope [onclick]", "Paused with correct scope (0)"); - is(variables.getScopeAtIndex(1).name, "With scope [HTMLButtonElement]", + // Non-syntactic lexical scope introduced by non-syntactic scope chain. + is(variables.getScopeAtIndex(1).name, "Block scope", "Paused with correct scope (1)"); - is(variables.getScopeAtIndex(2).name, "With scope [HTMLDocument]", + is(variables.getScopeAtIndex(2).name, "With scope [HTMLButtonElement]", "Paused with correct scope (2)"); - is(variables.getScopeAtIndex(3).name, "Global scope [Window]", + is(variables.getScopeAtIndex(3).name, "With scope [HTMLDocument]", "Paused with correct scope (3)"); + // Global lexical scope. + is(variables.getScopeAtIndex(4).name, "Block scope", + "Paused with correct scope (4)"); + is(variables.getScopeAtIndex(5).name, "Global scope [Window]", + "Paused with correct scope (5)"); let onceResumed = gTarget.once("thread-resumed"); EventUtils.sendMouseEvent({ type: "mousedown" }, gResumeButton, gDebugger); diff --git a/devtools/client/debugger/test/mochitest/browser_dbg_pause-exceptions-01.js b/devtools/client/debugger/test/mochitest/browser_dbg_pause-exceptions-01.js index edfb63dc161e..bb0775590ea7 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg_pause-exceptions-01.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg_pause-exceptions-01.js @@ -53,8 +53,8 @@ function testPauseOnExceptionsDisabled() { is(gFrames.itemCount, 1, "Should have one frame."); - is(gVariables._store.length, 3, - "Should have three scopes."); + is(gVariables._store.length, 4, + "Should have four scopes."); is(innerNodes[0].querySelector(".name").getAttribute("value"), "this", "Should have the right property name for 'this'."); @@ -96,8 +96,8 @@ function testPauseOnExceptionsEnabled() { is(gFrames.itemCount, 1, "Should have one frame."); - is(gVariables._store.length, 3, - "Should have three scopes."); + is(gVariables._store.length, 4, + "Should have four scopes."); is(innerNodes[0].querySelector(".name").getAttribute("value"), "", "Should have the right property name for ."); @@ -117,8 +117,8 @@ function testPauseOnExceptionsEnabled() { is(gFrames.itemCount, 1, "Should have one frame."); - is(gVariables._store.length, 3, - "Should have three scopes."); + is(gVariables._store.length, 4, + "Should have four scopes."); is(innerNodes[0].querySelector(".name").getAttribute("value"), "this", "Should have the right property name for 'this'."); diff --git a/devtools/client/debugger/test/mochitest/browser_dbg_pause-exceptions-02.js b/devtools/client/debugger/test/mochitest/browser_dbg_pause-exceptions-02.js index f44f6c3ddb48..547e86b5c273 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg_pause-exceptions-02.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg_pause-exceptions-02.js @@ -52,8 +52,8 @@ function testPauseOnExceptionsAfterReload() { is(gFrames.itemCount, 1, "Should have one frame."); - is(gVariables._store.length, 3, - "Should have three scopes."); + is(gVariables._store.length, 4, + "Should have four scopes."); is(innerNodes[0].querySelector(".name").getAttribute("value"), "", "Should have the right property name for ."); @@ -73,8 +73,8 @@ function testPauseOnExceptionsAfterReload() { is(gFrames.itemCount, 1, "Should have one frame."); - is(gVariables._store.length, 3, - "Should have three scopes."); + is(gVariables._store.length, 4, + "Should have four scopes."); is(innerNodes[0].querySelector(".name").getAttribute("value"), "this", "Should have the right property name for 'this'."); diff --git a/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-06.js b/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-06.js index fa6901d081bd..f02a03ff386e 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-06.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-06.js @@ -7,7 +7,7 @@ const TAB_URL = EXAMPLE_URL + "doc_promise.html"; -const test = Task.async(function* () { +var test = Task.async(function* () { const [tab,, panel] = yield initDebugger(TAB_URL); yield ensureSourceIs(panel, "doc_promise.html", true); diff --git a/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-filter-01.js b/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-filter-01.js index b3f1bd49ab94..cc864c9a04a8 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-filter-01.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-filter-01.js @@ -44,7 +44,8 @@ function testVariablesAndPropertiesFiltering() { let localScope = gVariables.getScopeAtIndex(0); let withScope = gVariables.getScopeAtIndex(1); let functionScope = gVariables.getScopeAtIndex(2); - let globalScope = gVariables.getScopeAtIndex(3); + let globalLexicalScope = gVariables.getScopeAtIndex(3); + let globalScope = gVariables.getScopeAtIndex(4); let protoVar = localScope.get("__proto__"); let constrVar = protoVar.get("constructor"); let proto2Var = constrVar.get("__proto__"); @@ -57,6 +58,8 @@ function testVariablesAndPropertiesFiltering() { "The withScope should be expanded."); is(functionScope.expanded, true, "The functionScope should be expanded."); + is(globalLexicalScope.expanded, true, + "The globalLexicalScope should be expanded."); is(globalScope.expanded, true, "The globalScope should be expanded."); @@ -75,6 +78,8 @@ function testVariablesAndPropertiesFiltering() { "There should be 0 variables displayed in the with scope."); is(functionScope.target.querySelectorAll(".variables-view-variable:not([unmatched])").length, 0, "There should be 0 variables displayed in the function scope."); + is(globalLexicalScope.target.querySelectorAll(".variables-view-variable:not([unmatched])").length, 0, + "There should be 0 variables displayed in the global lexical scope."); is(globalScope.target.querySelectorAll(".variables-view-variable:not([unmatched])").length, 0, "There should be 0 variables displayed in the global scope."); @@ -82,6 +87,8 @@ function testVariablesAndPropertiesFiltering() { "There should be 0 properties displayed in the with scope."); is(functionScope.target.querySelectorAll(".variables-view-property:not([unmatched])").length, 0, "There should be 0 properties displayed in the function scope."); + is(globalLexicalScope.target.querySelectorAll(".variables-view-property:not([unmatched])").length, 0, + "There should be 0 properties displayed in the global lexical scope."); is(globalScope.target.querySelectorAll(".variables-view-property:not([unmatched])").length, 0, "There should be 0 properties displayed in the global scope."); @@ -106,6 +113,7 @@ function testVariablesAndPropertiesFiltering() { localScope.collapse(); withScope.collapse(); functionScope.collapse(); + globalLexicalScope.collapse(); globalScope.collapse(); protoVar.collapse(); constrVar.collapse(); @@ -118,6 +126,8 @@ function testVariablesAndPropertiesFiltering() { "The withScope should not be expanded."); is(functionScope.expanded, false, "The functionScope should not be expanded."); + is(globalLexicalScope.expanded, false, + "The globalLexicalScope should not be expanded."); is(globalScope.expanded, false, "The globalScope should not be expanded."); @@ -145,14 +155,17 @@ function prepareVariablesAndProperties() { let localScope = gVariables.getScopeAtIndex(0); let withScope = gVariables.getScopeAtIndex(1); let functionScope = gVariables.getScopeAtIndex(2); - let globalScope = gVariables.getScopeAtIndex(3); + let globalLexicalScope = gVariables.getScopeAtIndex(3); + let globalScope = gVariables.getScopeAtIndex(4); is(localScope.expanded, true, "The localScope should be expanded."); is(withScope.expanded, false, "The withScope should not be expanded yet."); is(functionScope.expanded, false, - "The functionScope should not be expanded yet."); + "The functionScope should not be expanded yet."); + is(globalLexicalScope.expanded, false, + "The globalLexicalScope should not be expanded yet."); is(globalScope.expanded, false, "The globalScope should not be expanded yet."); @@ -164,7 +177,9 @@ function prepareVariablesAndProperties() { is(withScope.expanded, true, "The withScope should now be expanded."); is(functionScope.expanded, true, - "The functionScope should now be expanded."); + "The functionScope should now be expanded."); + is(globalLexicalScope.expanded, true, + "The globalLexicalScope should be expanded."); is(globalScope.expanded, true, "The globalScope should now be expanded."); @@ -206,6 +221,7 @@ function prepareVariablesAndProperties() { withScope.expand(); functionScope.expand(); + globalLexicalScope.expand(); globalScope.expand(); return deferred.promise; diff --git a/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-filter-02.js b/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-filter-02.js index 240147089a1b..80c9095327b9 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-filter-02.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-filter-02.js @@ -44,7 +44,8 @@ function testVariablesAndPropertiesFiltering() { let localScope = gVariables.getScopeAtIndex(0); let withScope = gVariables.getScopeAtIndex(1); let functionScope = gVariables.getScopeAtIndex(2); - let globalScope = gVariables.getScopeAtIndex(3); + let globalLexicalScope = gVariables.getScopeAtIndex(3); + let globalScope = gVariables.getScopeAtIndex(4); let protoVar = localScope.get("__proto__"); let constrVar = protoVar.get("constructor"); let proto2Var = constrVar.get("__proto__"); @@ -57,6 +58,8 @@ function testVariablesAndPropertiesFiltering() { "The withScope should be expanded."); is(functionScope.expanded, true, "The functionScope should be expanded."); + is(globalLexicalScope.expanded, true, + "The globalScope should be expanded."); is(globalScope.expanded, true, "The globalScope should be expanded."); @@ -75,6 +78,8 @@ function testVariablesAndPropertiesFiltering() { "There should be 0 variables displayed in the with scope."); is(functionScope.target.querySelectorAll(".variables-view-variable:not([unmatched])").length, 0, "There should be 0 variables displayed in the function scope."); + is(globalLexicalScope.target.querySelectorAll(".variables-view-variable:not([unmatched])").length, 0, + "There should be no variables displayed in the global lexical scope."); is(globalScope.target.querySelectorAll(".variables-view-variable:not([unmatched])").length, 0, "There should be no variables displayed in the global scope."); @@ -84,6 +89,8 @@ function testVariablesAndPropertiesFiltering() { "There should be 0 properties displayed in the with scope."); is(functionScope.target.querySelectorAll(".variables-view-property:not([unmatched])").length, 0, "There should be 0 properties displayed in the function scope."); + is(globalLexicalScope.target.querySelectorAll(".variables-view-property:not([unmatched])").length, 0, + "There should be 0 properties displayed in the global lexical scope."); is(globalScope.target.querySelectorAll(".variables-view-property:not([unmatched])").length, 0, "There should be 0 properties displayed in the global scope."); @@ -113,6 +120,7 @@ function testVariablesAndPropertiesFiltering() { localScope.collapse(); withScope.collapse(); functionScope.collapse(); + globalLexicalScope.collapse(); globalScope.collapse(); protoVar.collapse(); constrVar.collapse(); @@ -125,6 +133,8 @@ function testVariablesAndPropertiesFiltering() { "The withScope should not be expanded."); is(functionScope.expanded, false, "The functionScope should not be expanded."); + is(globalLexicalScope.expanded, false, + "The globalScope should not be expanded."); is(globalScope.expanded, false, "The globalScope should not be expanded."); @@ -153,7 +163,8 @@ function prepareVariablesAndProperties() { let localScope = gVariables.getScopeAtIndex(0); let withScope = gVariables.getScopeAtIndex(1); let functionScope = gVariables.getScopeAtIndex(2); - let globalScope = gVariables.getScopeAtIndex(3); + let globalLexicalScope = gVariables.getScopeAtIndex(3); + let globalScope = gVariables.getScopeAtIndex(4); is(localScope.expanded, true, "The localScope should be expanded."); @@ -161,6 +172,8 @@ function prepareVariablesAndProperties() { "The withScope should not be expanded yet."); is(functionScope.expanded, false, "The functionScope should not be expanded yet."); + is(globalLexicalScope.expanded, false, + "The globalScope should not be expanded yet."); is(globalScope.expanded, false, "The globalScope should not be expanded yet."); @@ -173,6 +186,8 @@ function prepareVariablesAndProperties() { "The withScope should now be expanded."); is(functionScope.expanded, true, "The functionScope should now be expanded."); + is(globalLexicalScope.expanded, true, + "The globalScope should now be expanded."); is(globalScope.expanded, true, "The globalScope should now be expanded."); @@ -214,6 +229,7 @@ function prepareVariablesAndProperties() { withScope.expand(); functionScope.expand(); + globalLexicalScope.expand(); globalScope.expand(); return deferred.promise; diff --git a/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-filter-03.js b/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-filter-03.js index 88f5ff8cb99f..a444b7e60a7e 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-filter-03.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-filter-03.js @@ -43,7 +43,8 @@ function testVariablesAndPropertiesFiltering() { let localScope = gVariables.getScopeAtIndex(0); let withScope = gVariables.getScopeAtIndex(1); let functionScope = gVariables.getScopeAtIndex(2); - let globalScope = gVariables.getScopeAtIndex(3); + let globalLexicalScope = gVariables.getScopeAtIndex(3); + let globalScope = gVariables.getScopeAtIndex(4); function testFiltered() { is(localScope.expanded, true, @@ -52,6 +53,8 @@ function testVariablesAndPropertiesFiltering() { "The withScope should be expanded."); is(functionScope.expanded, true, "The functionScope should be expanded."); + is(globalLexicalScope.expanded, true, + "The globalScope should be expanded."); is(globalScope.expanded, true, "The globalScope should be expanded."); @@ -61,6 +64,8 @@ function testVariablesAndPropertiesFiltering() { "There should be 0 variables displayed in the with scope."); is(functionScope.target.querySelectorAll(".variables-view-variable:not([unmatched])").length, 0, "There should be 0 variables displayed in the function scope."); + is(globalLexicalScope.target.querySelectorAll(".variables-view-variable:not([unmatched])").length, 0, + "There should be 0 variables displayed in the global scope."); is(globalScope.target.querySelectorAll(".variables-view-variable:not([unmatched])").length, 0, "There should be 0 variables displayed in the global scope."); @@ -70,6 +75,8 @@ function testVariablesAndPropertiesFiltering() { "There should be 0 properties displayed in the with scope."); is(functionScope.target.querySelectorAll(".variables-view-property:not([unmatched])").length, 0, "There should be 0 properties displayed in the function scope."); + is(globalLexicalScope.target.querySelectorAll(".variables-view-property:not([unmatched])").length, 0, + "There should be 0 properties displayed in the global scope."); is(globalScope.target.querySelectorAll(".variables-view-property:not([unmatched])").length, 0, "There should be 0 properties displayed in the global scope."); } @@ -86,6 +93,7 @@ function testVariablesAndPropertiesFiltering() { localScope.collapse(); withScope.collapse(); functionScope.collapse(); + globalLexicalScope.collapse(); globalScope.collapse(); is(localScope.expanded, false, @@ -94,6 +102,8 @@ function testVariablesAndPropertiesFiltering() { "The withScope should not be expanded."); is(functionScope.expanded, false, "The functionScope should not be expanded."); + is(globalLexicalScope.expanded, false, + "The globalScope should not be expanded."); is(globalScope.expanded, false, "The globalScope should not be expanded."); @@ -115,7 +125,8 @@ function prepareVariablesAndProperties() { let localScope = gVariables.getScopeAtIndex(0); let withScope = gVariables.getScopeAtIndex(1); let functionScope = gVariables.getScopeAtIndex(2); - let globalScope = gVariables.getScopeAtIndex(3); + let globalLexicalScope = gVariables.getScopeAtIndex(3); + let globalScope = gVariables.getScopeAtIndex(4); is(localScope.expanded, true, "The localScope should be expanded."); @@ -123,6 +134,8 @@ function prepareVariablesAndProperties() { "The withScope should not be expanded yet."); is(functionScope.expanded, false, "The functionScope should not be expanded yet."); + is(globalLexicalScope.expanded, false, + "The globalScope should not be expanded yet."); is(globalScope.expanded, false, "The globalScope should not be expanded yet."); @@ -135,6 +148,8 @@ function prepareVariablesAndProperties() { "The withScope should now be expanded."); is(functionScope.expanded, true, "The functionScope should now be expanded."); + is(globalLexicalScope.expanded, true, + "The globalScope should now be expanded."); is(globalScope.expanded, true, "The globalScope should now be expanded."); @@ -143,6 +158,7 @@ function prepareVariablesAndProperties() { withScope.expand(); functionScope.expand(); + globalLexicalScope.expand(); globalScope.expand(); return deferred.promise; diff --git a/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-filter-04.js b/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-filter-04.js index 1eb4748efbab..ed69dbc6f831 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-filter-04.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-filter-04.js @@ -44,108 +44,110 @@ function testVariablesAndPropertiesFiltering() { let localScope = gVariables.getScopeAtIndex(0); let withScope = gVariables.getScopeAtIndex(1); let functionScope = gVariables.getScopeAtIndex(2); - let globalScope = gVariables.getScopeAtIndex(3); + let globalLexicalScope = gVariables.getScopeAtIndex(3); + let globalScope = gVariables.getScopeAtIndex(4); let step = 0; let tests = [ function() { - assertExpansion([true, false, false, false]); + assertExpansion([true, false, false, false, false]); EventUtils.sendKey("RETURN", gDebugger); }, function() { - assertExpansion([true, false, false, false]); + assertExpansion([true, false, false, false, false]); EventUtils.sendKey("RETURN", gDebugger); }, function() { - assertExpansion([true, false, false, false]); + assertExpansion([true, false, false, false, false]); gEditor.focus(); }, function() { - assertExpansion([true, false, false, false]); + assertExpansion([true, false, false, false, false]); typeText(gSearchBox, "*"); }, function() { - assertExpansion([true, true, true, true]); + assertExpansion([true, true, true, true, true]); EventUtils.sendKey("RETURN", gDebugger); }, function() { - assertExpansion([true, true, true, true]); + assertExpansion([true, true, true, true, true]); EventUtils.sendKey("RETURN", gDebugger); }, function() { - assertExpansion([true, true, true, true]); + assertExpansion([true, true, true, true, true]); gEditor.focus(); }, function() { - assertExpansion([true, true, true, true]); + assertExpansion([true, true, true, true, true]); backspaceText(gSearchBox, 1); }, function() { - assertExpansion([true, true, true, true]); + assertExpansion([true, true, true, true, true]); EventUtils.sendKey("RETURN", gDebugger); }, function() { - assertExpansion([true, true, true, true]); + assertExpansion([true, true, true, true, true]); EventUtils.sendKey("RETURN", gDebugger); }, function() { - assertExpansion([true, true, true, true]); + assertExpansion([true, true, true, true, true]); gEditor.focus(); }, function() { - assertExpansion([true, true, true, true]); + assertExpansion([true, true, true, true, true]); localScope.collapse(); withScope.collapse(); functionScope.collapse(); + globalLexicalScope.collapse(); globalScope.collapse(); }, function() { - assertExpansion([false, false, false, false]); + assertExpansion([false, false, false, false, false]); EventUtils.sendKey("RETURN", gDebugger); }, function() { - assertExpansion([false, false, false, false]); + assertExpansion([false, false, false, false, false]); EventUtils.sendKey("RETURN", gDebugger); }, function() { - assertExpansion([false, false, false, false]); + assertExpansion([false, false, false, false, false]); gEditor.focus(); }, function() { - assertExpansion([false, false, false, false]); + assertExpansion([false, false, false, false, false]); clearText(gSearchBox); typeText(gSearchBox, "*"); }, function() { - assertExpansion([true, true, true, true]); + assertExpansion([true, true, true, true, true]); EventUtils.sendKey("RETURN", gDebugger); }, function() { - assertExpansion([true, true, true, true]); + assertExpansion([true, true, true, true, true]); EventUtils.sendKey("RETURN", gDebugger); }, function() { - assertExpansion([true, true, true, true]); + assertExpansion([true, true, true, true, true]); gEditor.focus(); }, function() { - assertExpansion([true, true, true, true]); + assertExpansion([true, true, true, true, true]); backspaceText(gSearchBox, 1); }, function() { - assertExpansion([true, true, true, true]); + assertExpansion([true, true, true, true, true]); EventUtils.sendKey("RETURN", gDebugger); }, function() { - assertExpansion([true, true, true, true]); + assertExpansion([true, true, true, true, true]); EventUtils.sendKey("RETURN", gDebugger); }, function() { - assertExpansion([true, true, true, true]); + assertExpansion([true, true, true, true, true]); gEditor.focus(); }, function() { - assertExpansion([true, true, true, true]); + assertExpansion([true, true, true, true, true]); } ]; @@ -162,8 +164,12 @@ function testVariablesAndPropertiesFiltering() { "The functionScope should " + (aFlags[2] ? "" : "not ") + "be expanded at this point (" + step + ")."); - is(globalScope.expanded, aFlags[3], - "The globalScope should " + (aFlags[3] ? "" : "not ") + + is(globalLexicalScope.expanded, aFlags[3], + "The globalLexicalScope should " + (aFlags[3] ? "" : "not ") + + "be expanded at this point (" + step + ")."); + + is(globalScope.expanded, aFlags[4], + "The globalScope should " + (aFlags[4] ? "" : "not ") + "be expanded at this point (" + step + ")."); step++; @@ -178,7 +184,8 @@ function prepareVariablesAndProperties() { let localScope = gVariables.getScopeAtIndex(0); let withScope = gVariables.getScopeAtIndex(1); let functionScope = gVariables.getScopeAtIndex(2); - let globalScope = gVariables.getScopeAtIndex(3); + let globalLexicalScope = gVariables.getScopeAtIndex(3); + let globalScope = gVariables.getScopeAtIndex(4); is(localScope.expanded, true, "The localScope should be expanded."); @@ -186,6 +193,8 @@ function prepareVariablesAndProperties() { "The withScope should not be expanded yet."); is(functionScope.expanded, false, "The functionScope should not be expanded yet."); + is(globalLexicalScope.expanded, false, + "The globalLexicalScope should not be expanded yet."); is(globalScope.expanded, false, "The globalScope should not be expanded yet."); @@ -198,11 +207,14 @@ function prepareVariablesAndProperties() { "The withScope should now be expanded."); is(functionScope.expanded, true, "The functionScope should now be expanded."); + is(globalLexicalScope.expanded, true, + "The globalLexicalScope should now be expanded."); is(globalScope.expanded, true, "The globalScope should now be expanded."); withScope.collapse(); functionScope.collapse(); + globalLexicalScope.collapse(); globalScope.collapse(); deferred.resolve(); @@ -210,6 +222,7 @@ function prepareVariablesAndProperties() { withScope.expand(); functionScope.expand(); + globalLexicalScope.expand(); globalScope.expand(); return deferred.promise; diff --git a/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-filter-05.js b/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-filter-05.js index 8d24fb300ac4..b1ee7d217b37 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-filter-05.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-filter-05.js @@ -43,17 +43,18 @@ function testVariablesAndPropertiesFiltering() { let localScope = gVariables.getScopeAtIndex(0); let withScope = gVariables.getScopeAtIndex(1); let functionScope = gVariables.getScopeAtIndex(2); - let globalScope = gVariables.getScopeAtIndex(3); + let globalLexicalScope = gVariables.getScopeAtIndex(3); + let globalScope = gVariables.getScopeAtIndex(4); let step = 0; let tests = [ function() { - assertScopeExpansion([true, false, false, false]); + assertScopeExpansion([true, false, false, false, false]); typeText(gSearchBox, "*arguments"); }, function() { - assertScopeExpansion([true, true, true, true]); - assertVariablesCountAtLeast([0, 0, 1, 0]); + assertScopeExpansion([true, true, true, true, true]); + assertVariablesCountAtLeast([0, 0, 1, 0, 0]); is(functionScope.target.querySelectorAll(".variables-view-variable:not([unmatched]) > .title > .name")[0].getAttribute("value"), "arguments", "The arguments pseudoarray should be visible."); @@ -63,8 +64,8 @@ function testVariablesAndPropertiesFiltering() { backspaceText(gSearchBox, 6); }, function() { - assertScopeExpansion([true, true, true, true]); - assertVariablesCountAtLeast([0, 0, 1, 1]); + assertScopeExpansion([true, true, true, true, true]); + assertVariablesCountAtLeast([0, 0, 1, 0, 1]); is(functionScope.target.querySelectorAll(".variables-view-variable:not([unmatched]) > .title > .name")[0].getAttribute("value"), "arguments", "The arguments pseudoarray should be visible."); @@ -79,8 +80,8 @@ function testVariablesAndPropertiesFiltering() { backspaceText(gSearchBox, 2); }, function() { - assertScopeExpansion([true, true, true, true]); - assertVariablesCountAtLeast([0, 1, 3, 1]); + assertScopeExpansion([true, true, true, true, true]); + assertVariablesCountAtLeast([0, 1, 3, 0, 1]); is(functionScope.target.querySelectorAll(".variables-view-variable:not([unmatched]) > .title > .name")[0].getAttribute("value"), "aNumber", "The aNumber param should be visible."); @@ -100,8 +101,8 @@ function testVariablesAndPropertiesFiltering() { backspaceText(gSearchBox, 1); }, function() { - assertScopeExpansion([true, true, true, true]); - assertVariablesCountAtLeast([4, 1, 3, 1]); + assertScopeExpansion([true, true, true, true, true]); + assertVariablesCountAtLeast([4, 1, 3, 0, 1]); is(localScope.target.querySelectorAll(".variables-view-variable:not([unmatched]) > .title > .name")[0].getAttribute("value"), "this", "The this reference should be visible."); @@ -153,8 +154,12 @@ function testVariablesAndPropertiesFiltering() { "The functionScope should " + (aFlags[2] ? "" : "not ") + "be expanded at this point (" + step + ")."); - is(globalScope.expanded, aFlags[3], - "The globalScope should " + (aFlags[3] ? "" : "not ") + + is(globalLexicalScope.expanded, aFlags[3], + "The globalLexicalScope should " + (aFlags[3] ? "" : "not ") + + "be expanded at this point (" + step + ")."); + + is(globalScope.expanded, aFlags[4], + "The globalScope should " + (aFlags[4] ? "" : "not ") + "be expanded at this point (" + step + ")."); } @@ -171,8 +176,12 @@ function testVariablesAndPropertiesFiltering() { "There should be " + aCounts[2] + " variable displayed in the function scope (" + step + ")."); - ok(globalScope.target.querySelectorAll(".variables-view-variable:not([unmatched])").length >= aCounts[3], + ok(globalLexicalScope.target.querySelectorAll(".variables-view-variable:not([unmatched])").length >= aCounts[3], "There should be " + aCounts[3] + + " variable displayed in the global scope (" + step + ")."); + + ok(globalScope.target.querySelectorAll(".variables-view-variable:not([unmatched])").length >= aCounts[4], + "There should be " + aCounts[4] + " variable displayed in the global scope (" + step + ")."); step++; @@ -187,7 +196,8 @@ function prepareVariablesAndProperties() { let localScope = gVariables.getScopeAtIndex(0); let withScope = gVariables.getScopeAtIndex(1); let functionScope = gVariables.getScopeAtIndex(2); - let globalScope = gVariables.getScopeAtIndex(3); + let globalLexicalScope = gVariables.getScopeAtIndex(3); + let globalScope = gVariables.getScopeAtIndex(4); is(localScope.expanded, true, "The localScope should be expanded."); @@ -195,6 +205,8 @@ function prepareVariablesAndProperties() { "The withScope should not be expanded yet."); is(functionScope.expanded, false, "The functionScope should not be expanded yet."); + is(globalLexicalScope.expanded, false, + "The globalScope should not be expanded yet."); is(globalScope.expanded, false, "The globalScope should not be expanded yet."); @@ -207,11 +219,14 @@ function prepareVariablesAndProperties() { "The withScope should now be expanded."); is(functionScope.expanded, true, "The functionScope should now be expanded."); + is(globalLexicalScope.expanded, true, + "The globalScope should now be expanded."); is(globalScope.expanded, true, "The globalScope should now be expanded."); withScope.collapse(); functionScope.collapse(); + globalLexicalScope.collapse(); globalScope.collapse(); deferred.resolve(); @@ -219,6 +234,7 @@ function prepareVariablesAndProperties() { withScope.expand(); functionScope.expand(); + globalLexicalScope.expand(); globalScope.expand(); return deferred.promise; diff --git a/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-frame-parameters-01.js b/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-frame-parameters-01.js index 320ee4104d1e..f175f933299b 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-frame-parameters-01.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-frame-parameters-01.js @@ -35,27 +35,35 @@ function test() { function initialChecks() { let scopeNodes = gDebugger.document.querySelectorAll(".variables-view-scope"); - is(scopeNodes.length, 2, - "There should be 2 scopes available."); + is(scopeNodes.length, 3, + "There should be 3 scopes available."); ok(scopeNodes[0].querySelector(".name").getAttribute("value").includes("[test]"), "The local scope should be properly identified."); - ok(scopeNodes[1].querySelector(".name").getAttribute("value").includes("[Window]"), + ok(scopeNodes[1].querySelector(".name").getAttribute("value").includes("Block"), + "The global lexical scope should be properly identified."); + ok(scopeNodes[2].querySelector(".name").getAttribute("value").includes("[Window]"), "The global scope should be properly identified."); is(gVariables.getScopeAtIndex(0).target, scopeNodes[0], "getScopeAtIndex(0) didn't return the expected scope."); is(gVariables.getScopeAtIndex(1).target, scopeNodes[1], "getScopeAtIndex(1) didn't return the expected scope."); + is(gVariables.getScopeAtIndex(2).target, scopeNodes[2], + "getScopeAtIndex(2) didn't return the expected scope."); is(gVariables.getItemForNode(scopeNodes[0]).target, scopeNodes[0], "getItemForNode([0]) didn't return the expected scope."); is(gVariables.getItemForNode(scopeNodes[1]).target, scopeNodes[1], "getItemForNode([1]) didn't return the expected scope."); + is(gVariables.getItemForNode(scopeNodes[2]).target, scopeNodes[2], + "getItemForNode([2]) didn't return the expected scope."); is(gVariables.getItemForNode(scopeNodes[0]).expanded, true, "The local scope should be expanded by default."); is(gVariables.getItemForNode(scopeNodes[1]).expanded, false, + "The global lexical scope should not be collapsed by default."); + is(gVariables.getItemForNode(scopeNodes[2]).expanded, false, "The global scope should not be collapsed by default."); } diff --git a/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-frame-parameters-03.js b/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-frame-parameters-03.js index 7b0768138766..2866c2ce1900 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-frame-parameters-03.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-frame-parameters-03.js @@ -38,7 +38,7 @@ function test() { function expandGlobalScope() { let deferred = promise.defer(); - let globalScope = gVariables.getScopeAtIndex(1); + let globalScope = gVariables.getScopeAtIndex(2); is(globalScope.expanded, false, "The global scope should not be expanded by default."); @@ -52,7 +52,7 @@ function expandGlobalScope() { } function testGlobalScope() { - let globalScope = gVariables.getScopeAtIndex(1); + let globalScope = gVariables.getScopeAtIndex(2); is(globalScope.expanded, true, "The global scope should now be expanded."); @@ -92,7 +92,7 @@ function testGlobalScope() { function expandWindowVariable() { let deferred = promise.defer(); - let windowVar = gVariables.getScopeAtIndex(1).get("window"); + let windowVar = gVariables.getScopeAtIndex(2).get("window"); is(windowVar.expanded, false, "The window variable should not be expanded by default."); @@ -106,7 +106,7 @@ function expandWindowVariable() { } function testWindowVariable() { - let windowVar = gVariables.getScopeAtIndex(1).get("window"); + let windowVar = gVariables.getScopeAtIndex(2).get("window"); is(windowVar.expanded, true, "The window variable should now be expanded."); diff --git a/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-override-01.js b/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-override-01.js index 84391a08fe8e..3b7c08977c8f 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-override-01.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-override-01.js @@ -21,11 +21,13 @@ function test() { let firstScope = variables.getScopeAtIndex(0); let secondScope = variables.getScopeAtIndex(1); let thirdScope = variables.getScopeAtIndex(2); - let globalScope = variables.getScopeAtIndex(3); + let globalLexicalScope = variables.getScopeAtIndex(3); + let globalScope = variables.getScopeAtIndex(4); ok(firstScope, "The first scope is available."); ok(secondScope, "The second scope is available."); ok(thirdScope, "The third scope is available."); + ok(globalLexicalScope, "The global lexical scope is available."); ok(globalScope, "The global scope is available."); is(firstScope.name, "Function scope [secondNest]", @@ -34,6 +36,8 @@ function test() { "The second scope's name is correct."); is(thirdScope.name, "Function scope [test]", "The third scope's name is correct."); + is(globalLexicalScope.name, "Block scope", + "The global lexical scope's name is correct."); is(globalScope.name, "Global scope [Window]", "The global scope's name is correct."); @@ -43,6 +47,8 @@ function test() { "The second scope's expansion state is correct."); is(thirdScope.expanded, false, "The third scope's expansion state is correct."); + is(globalLexicalScope.expanded, false, + "The global lexical scope's expansion state is correct."); is(globalScope.expanded, false, "The global scope's expansion state is correct."); @@ -52,6 +58,8 @@ function test() { "The second scope should have no variables available yet."); is(thirdScope._store.size, 0, "The third scope should have no variables available yet."); + is(globalLexicalScope._store.size, 0, + "The global scope should have no variables available yet."); is(globalScope._store.size, 0, "The global scope should have no variables available yet."); @@ -100,6 +108,7 @@ function test() { fetched = waitForDebuggerEvents(panel, events.FETCHED_VARIABLES); secondScope.expand(); thirdScope.expand(); + globalLexicalScope.expand(); globalScope.expand(); yield fetched; diff --git a/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-popup-16.js b/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-popup-16.js index 4b4e0407e1e0..676878d245cd 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-popup-16.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-popup-16.js @@ -42,7 +42,7 @@ function test() { } function expandGlobalScope() { - let globalScope = variables.getScopeAtIndex(1); + let globalScope = variables.getScopeAtIndex(2); is(globalScope.expanded, false, "The globalScope should not be expanded yet."); diff --git a/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-reexpand-01.js b/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-reexpand-01.js index 5beab91342af..70a638e85e50 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-reexpand-01.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-reexpand-01.js @@ -74,7 +74,8 @@ function testVariablesExpand() { let localScope = gVariables.getScopeAtIndex(0); let withScope = gVariables.getScopeAtIndex(1); let functionScope = gVariables.getScopeAtIndex(2); - let globalScope = gVariables.getScopeAtIndex(3); + let globalLexicalScope = gVariables.getScopeAtIndex(3); + let globalScope = gVariables.getScopeAtIndex(4); let thisVar = localScope.get("this"); let windowVar = thisVar.get("window"); @@ -85,6 +86,8 @@ function testVariablesExpand() { "The withScope arrow should still be expanded."); is(functionScope.target.querySelector(".arrow").hasAttribute("open"), true, "The functionScope arrow should still be expanded."); + is(globalLexicalScope.target.querySelector(".arrow").hasAttribute("open"), true, + "The globalLexicalScope arrow should still be expanded."); is(globalScope.target.querySelector(".arrow").hasAttribute("open"), true, "The globalScope arrow should still be expanded."); is(thisVar.target.querySelector(".arrow").hasAttribute("open"), true, @@ -98,6 +101,8 @@ function testVariablesExpand() { "The withScope enumerables should still be expanded."); is(functionScope.target.querySelector(".variables-view-element-details").hasAttribute("open"), true, "The functionScope enumerables should still be expanded."); + is(globalLexicalScope.target.querySelector(".variables-view-element-details").hasAttribute("open"), true, + "The globalLexicalScope enumerables should still be expanded."); is(globalScope.target.querySelector(".variables-view-element-details").hasAttribute("open"), true, "The globalScope enumerables should still be expanded."); is(thisVar.target.querySelector(".variables-view-element-details").hasAttribute("open"), true, @@ -111,6 +116,8 @@ function testVariablesExpand() { "The withScope expanded getter should return true."); is(functionScope.expanded, true, "The functionScope expanded getter should return true."); + is(globalLexicalScope.expanded, true, + "The globalScope expanded getter should return true."); is(globalScope.expanded, true, "The globalScope expanded getter should return true."); is(thisVar.expanded, true, @@ -125,7 +132,8 @@ function prepareVariablesAndProperties() { let localScope = gVariables.getScopeAtIndex(0); let withScope = gVariables.getScopeAtIndex(1); let functionScope = gVariables.getScopeAtIndex(2); - let globalScope = gVariables.getScopeAtIndex(3); + let globalLexicalScope = gVariables.getScopeAtIndex(3); + let globalScope = gVariables.getScopeAtIndex(4); is(localScope.expanded, true, "The localScope should be expanded."); @@ -133,6 +141,8 @@ function prepareVariablesAndProperties() { "The withScope should not be expanded yet."); is(functionScope.expanded, false, "The functionScope should not be expanded yet."); + is(globalLexicalScope.expanded, false, + "The globalLexicalScope should not be expanded yet."); is(globalScope.expanded, false, "The globalScope should not be expanded yet."); @@ -145,6 +155,8 @@ function prepareVariablesAndProperties() { "The withScope should now be expanded."); is(functionScope.expanded, true, "The functionScope should now be expanded."); + is(globalLexicalScope.expanded, true, + "The globalLexicalScope should now be expanded."); is(globalScope.expanded, true, "The globalScope should now be expanded."); @@ -186,6 +198,7 @@ function prepareVariablesAndProperties() { withScope.expand(); functionScope.expand(); + globalLexicalScope.expand(); globalScope.expand(); return deferred.promise; diff --git a/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-reexpand-02.js b/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-reexpand-02.js index 67e0abe843ce..4da9046db63d 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-reexpand-02.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-reexpand-02.js @@ -75,7 +75,8 @@ function testVariablesExpand() { let localScope = gVariables.getScopeAtIndex(0); let withScope = gVariables.getScopeAtIndex(1); let functionScope = gVariables.getScopeAtIndex(2); - let globalScope = gVariables.getScopeAtIndex(3); + let globalLexicalScope = gVariables.getScopeAtIndex(3); + let globalScope = gVariables.getScopeAtIndex(4); let thisVar = localScope.get("this"); let windowVar = thisVar.get("window"); @@ -88,6 +89,8 @@ function testVariablesExpand() { "The withScope arrow should still be expanded."); is(functionScope.target.querySelector(".arrow").hasAttribute("open"), true, "The functionScope arrow should still be expanded."); + is(globalLexicalScope.target.querySelector(".arrow").hasAttribute("open"), true, + "The globalLexicalScope arrow should still be expanded."); is(globalScope.target.querySelector(".arrow").hasAttribute("open"), true, "The globalScope arrow should still be expanded."); is(thisVar.target.querySelector(".arrow").hasAttribute("open"), true, @@ -105,6 +108,8 @@ function testVariablesExpand() { "The withScope enumerables should still be expanded."); is(functionScope.target.querySelector(".variables-view-element-details").hasAttribute("open"), true, "The functionScope enumerables should still be expanded."); + is(globalLexicalScope.target.querySelector(".variables-view-element-details").hasAttribute("open"), true, + "The globalLexicalScope enumerables should still be expanded."); is(globalScope.target.querySelector(".variables-view-element-details").hasAttribute("open"), true, "The globalScope enumerables should still be expanded."); is(thisVar.target.querySelector(".variables-view-element-details").hasAttribute("open"), true, @@ -122,6 +127,8 @@ function testVariablesExpand() { "The withScope expanded getter should return true."); is(functionScope.expanded, true, "The functionScope expanded getter should return true."); + is(globalLexicalScope.expanded, true, + "The globalLexicalScope expanded getter should return true."); is(globalScope.expanded, true, "The globalScope expanded getter should return true."); is(thisVar.expanded, true, @@ -140,7 +147,8 @@ function prepareVariablesAndProperties() { let localScope = gVariables.getScopeAtIndex(0); let withScope = gVariables.getScopeAtIndex(1); let functionScope = gVariables.getScopeAtIndex(2); - let globalScope = gVariables.getScopeAtIndex(3); + let globalLexicalScope = gVariables.getScopeAtIndex(3); + let globalScope = gVariables.getScopeAtIndex(4); is(localScope.expanded, true, "The localScope should be expanded."); @@ -148,6 +156,8 @@ function prepareVariablesAndProperties() { "The withScope should not be expanded yet."); is(functionScope.expanded, false, "The functionScope should not be expanded yet."); + is(globalLexicalScope.expanded, false, + "The globalLexicalScope should not be expanded yet."); is(globalScope.expanded, false, "The globalScope should not be expanded yet."); @@ -160,6 +170,8 @@ function prepareVariablesAndProperties() { "The withScope should now be expanded."); is(functionScope.expanded, true, "The functionScope should now be expanded."); + is(globalLexicalScope.expanded, true, + "The globalLexicalScope should now be expanded."); is(globalScope.expanded, true, "The globalScope should now be expanded."); @@ -201,6 +213,7 @@ function prepareVariablesAndProperties() { withScope.expand(); functionScope.expand(); + globalLexicalScope.expand(); globalScope.expand(); return deferred.promise; diff --git a/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-webidl.js b/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-webidl.js index 4988755bf1b4..f21c78e41c11 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-webidl.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-webidl.js @@ -36,7 +36,7 @@ function test() { function expandGlobalScope() { let deferred = promise.defer(); - let globalScope = gVariables.getScopeAtIndex(1); + let globalScope = gVariables.getScopeAtIndex(2); is(globalScope.expanded, false, "The global scope should not be expanded by default."); @@ -51,7 +51,7 @@ function expandGlobalScope() { function performTest() { let deferred = promise.defer(); - let globalScope = gVariables.getScopeAtIndex(1); + let globalScope = gVariables.getScopeAtIndex(2); let buttonVar = globalScope.get("button"); let buttonAsProtoVar = globalScope.get("buttonAsProto"); diff --git a/devtools/client/debugger/test/mochitest/doc_function-search.html b/devtools/client/debugger/test/mochitest/doc_function-search.html index 711a873edb73..eb0e7eaeae9d 100644 --- a/devtools/client/debugger/test/mochitest/doc_function-search.html +++ b/devtools/client/debugger/test/mochitest/doc_function-search.html @@ -17,10 +17,10 @@