tor-browser

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

browser_styleeditor_selectstylesheet.js (758B)


      1 /* Any copyright is dedicated to the Public Domain.
      2   http://creativecommons.org/publicdomain/zero/1.0/ */
      3 "use strict";
      4 
      5 // Test that StyleEditorUI.selectStyleSheet selects the correct sheet, line and
      6 // column.
      7 
      8 const TESTCASE_URI = TEST_BASE_HTTPS + "simple.html";
      9 
     10 const LINE_NO = 5;
     11 const COL_NO = 0;
     12 
     13 add_task(async function () {
     14  const { ui } = await openStyleEditorForURL(TESTCASE_URI);
     15  const editor = ui.editors[1];
     16 
     17  info("Selecting style sheet #1.");
     18  await ui.selectStyleSheet(editor.styleSheet, LINE_NO);
     19 
     20  is(ui.selectedEditor, ui.editors[1], "Second editor is selected.");
     21  const { line, ch } = ui.selectedEditor.sourceEditor.getCursor();
     22 
     23  is(line, LINE_NO, "correct line selected");
     24  is(ch, COL_NO, "correct column selected");
     25 });