tor-browser

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

browser_styleeditor_sourcemap_large.js (973B)


      1 /* Any copyright is dedicated to the Public Domain.
      2   http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 // Covers the case from Bug 1128747, where loading a sourcemapped
      7 // file prevents the correct editor from being selected on load,
      8 // and causes a second iframe to be appended when the user clicks
      9 // editor in the list.
     10 
     11 const TESTCASE_URI = TEST_BASE_HTTPS + "sourcemaps-large.html";
     12 
     13 add_task(async function () {
     14  const { ui } = await openStyleEditorForURL(TESTCASE_URI);
     15 
     16  await openEditor(ui.editors[0]);
     17  const iframes = ui.selectedEditor.details.querySelectorAll("iframe");
     18 
     19  is(iframes.length, 1, "There is only one editor iframe");
     20  ok(
     21    ui.selectedEditor.summary.classList.contains("splitview-active"),
     22    "The editor is selected"
     23  );
     24 });
     25 
     26 function openEditor(editor) {
     27  getLinkFor(editor).click();
     28 
     29  return editor.getSourceEditor();
     30 }
     31 
     32 function getLinkFor(editor) {
     33  return editor.summary.querySelector(".stylesheet-name");
     34 }