1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/devtools/debugger/test/browser_dbg_variables-view-popup-09.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,33 @@ 1.4 +/* Any copyright is dedicated to the Public Domain. 1.5 + http://creativecommons.org/publicdomain/zero/1.0/ */ 1.6 + 1.7 +/** 1.8 + * Tests opening inspecting variables works across scopes. 1.9 + */ 1.10 + 1.11 +const TAB_URL = EXAMPLE_URL + "doc_scope-variable-3.html"; 1.12 + 1.13 +function test() { 1.14 + Task.spawn(function() { 1.15 + let [tab, debuggee, panel] = yield initDebugger(TAB_URL); 1.16 + let win = panel.panelWin; 1.17 + let bubble = win.DebuggerView.VariableBubble; 1.18 + let tooltip = bubble._tooltip.panel; 1.19 + 1.20 + // Allow this generator function to yield first. 1.21 + executeSoon(() => debuggee.test()); 1.22 + yield waitForSourceAndCaretAndScopes(panel, ".html", 15); 1.23 + 1.24 + yield openVarPopup(panel, { line: 12, ch: 10 }); 1.25 + ok(true, "The variable inspection popup was shown for the real variable."); 1.26 + 1.27 + once(tooltip, "popupshown").then(() => { 1.28 + ok(false, "The variable inspection popup shouldn't have been opened."); 1.29 + }); 1.30 + 1.31 + reopenVarPopup(panel, { line: 18, ch: 10 }); 1.32 + yield waitForTime(1000); 1.33 + 1.34 + yield resumeDebuggerThenCloseAndFinish(panel); 1.35 + }); 1.36 +}