browser_dbg_variables-view-popup-15.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
  2. /* Any copyright is dedicated to the Public Domain.
  3. * http://creativecommons.org/publicdomain/zero/1.0/ */
  4. /**
  5. * Tests opening the variable inspection popup directly on literals.
  6. */
  7. const TAB_URL = EXAMPLE_URL + "doc_frame-parameters.html";
  8. function test() {
  9. Task.spawn(function* () {
  10. let options = {
  11. source: TAB_URL,
  12. line: 1
  13. };
  14. let [tab,, panel] = yield initDebugger(TAB_URL, options);
  15. let win = panel.panelWin;
  16. let bubble = win.DebuggerView.VariableBubble;
  17. let tooltip = bubble._tooltip.panel;
  18. let onCaretAndScopes = waitForCaretAndScopes(panel, 24);
  19. callInTab(tab, "start");
  20. yield onCaretAndScopes;
  21. yield openVarPopup(panel, { line: 15, ch: 12 });
  22. ok(true, "The variable inspection popup was shown for the real variable.");
  23. once(tooltip, "popupshown").then(() => {
  24. ok(false, "The variable inspection popup shouldn't have been opened.");
  25. });
  26. reopenVarPopup(panel, { line: 17, ch: 27 });
  27. yield waitForTime(1000);
  28. yield resumeDebuggerThenCloseAndFinish(panel);
  29. });
  30. }