tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

browser_dbg-inline-exceptions-inline-script.js (1194B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
      4 
      5 // This test checks the appearance of an inline exception in inline script
      6 // and the content of the exception tooltip.
      7 
      8 "use strict";
      9 
     10 add_task(async function () {
     11  const dbg = await initDebugger("doc-exceptions-inline-script.html");
     12  await selectSource(dbg, "doc-exceptions-inline-script.html");
     13 
     14  info("Hovers over the inline exception mark text.");
     15  await assertInlineExceptionPreview(dbg, 7, 39, {
     16    fields: [
     17      [
     18        "<anonymous>",
     19        "https://example.com/browser/devtools/client/debugger/test/mochitest/examples/doc-exceptions-inline-script.html:7",
     20      ],
     21    ],
     22    result: "TypeError: [].plop is not a function",
     23    expression: "plop",
     24  });
     25 
     26  const excLineEls = findAllElementsWithSelector(dbg, ".line-exception");
     27  const excTextMarkEls = findAllElementsWithSelector(
     28    dbg,
     29    ".mark-text-exception"
     30  );
     31 
     32  is(excLineEls.length, 1, "The editor has one exception line");
     33  is(excTextMarkEls.length, 1, "One token is marked as an exception.");
     34 });