summaryrefslogtreecommitdiffstats
path: root/devtools/client/webconsole/test/browser_webconsole_autocomplete_popup_close_on_tab_switch.js
blob: b57b1ce925e438b0c4d0525676fdeebe801a5b6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/publicdomain/zero/1.0/ */

// Test that the autocomplete popup closes on switching tabs. See bug 900448.

"use strict";

const TEST_URI = "data:text/html;charset=utf-8,<p>bug 900448 - autocomplete " +
                 "popup closes on tab switch";

add_task(function* () {
  yield loadTab(TEST_URI);
  let hud = yield openConsole();
  let popup = hud.jsterm.autocompletePopup;
  let popupShown = once(popup, "popup-opened");

  hud.jsterm.setInputValue("sc");
  EventUtils.synthesizeKey("r", {});

  yield popupShown;

  yield loadTab("data:text/html;charset=utf-8,<p>testing autocomplete closes");

  ok(!popup.isOpen, "Popup closes on tab switch");
});