summaryrefslogtreecommitdiffstats
path: root/devtools/client/debugger/test/mochitest/browser_dbg-expressions-focus.js
blob: 07054fd80f2213908da18dbc813b2b5999bc1305 (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
27
28
29
30
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */

// Ensures the input is displayed and focused when "+" is clicked

"use strict";

add_task(async function () {
  const dbg = await initDebugger("doc-script-switching.html");

  info(">> Close the panel");
  clickElementWithSelector(dbg, ".watch-expressions-pane ._header");

  info(">> Click + to add the new expression");
  await waitForElementWithSelector(
    dbg,
    ".watch-expressions-pane ._header .plus"
  );
  clickElementWithSelector(dbg, ".watch-expressions-pane ._header .plus");

  info(">> Ensure element gets focused");
  await waitForElementWithSelector(dbg, ".expression-input-container.focused");

  info(">> Ensure the element is focused");
  is(
    dbg.win.document.activeElement.classList.contains("input-expression"),
    true
  );
});