browser/devtools/debugger/test/browser_dbg_variables-view-popup-14.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* Any copyright is dedicated to the Public Domain.
     2    http://creativecommons.org/publicdomain/zero/1.0/ */
     4 /**
     5  * Tests that the variable inspection popup is hidden when
     6  * selecting text in the editor.
     7  */
     9 const TAB_URL = EXAMPLE_URL + "doc_frame-parameters.html";
    11 function test() {
    12   Task.spawn(function*() {
    13     let [tab, debuggee, panel] = yield initDebugger(TAB_URL);
    14     let win = panel.panelWin;
    15     let bubble = win.DebuggerView.VariableBubble;
    17     // Allow this generator function to yield first.
    18     executeSoon(() => debuggee.start());
    19     yield waitForSourceAndCaretAndScopes(panel, ".html", 24);
    21     // Select some text.
    22     let cursor = win.DebuggerView.editor.getOffset({ line: 15, ch: 12 });
    23     let [ anchor, head ] = win.DebuggerView.editor.getPosition(
    24       cursor,
    25       cursor + 3
    26     );
    27     win.DebuggerView.editor.setSelection(anchor, head);
    29     // Try to Inspect variable during selection.
    30     let popupOpened = yield intendOpenVarPopup(panel, { line: 15, ch: 12 }, true);
    32     // Ensure the bubble is not there
    33     ok(!popupOpened,
    34       "The popup is not opened");
    35     ok(!bubble._markedText,
    36       "The marked text in the editor is not there.");
    38     // Try to Inspect variable after selection.
    39     popupOpened = yield intendOpenVarPopup(panel, { line: 15, ch: 12 }, false);
    41     // Ensure the bubble is not there
    42     ok(popupOpened,
    43       "The popup is opened");
    44     ok(bubble._markedText,
    45       "The marked text in the editor is there.");
    47     yield resumeDebuggerThenCloseAndFinish(panel);
    48   });
    49 }

mercurial