tor-browser

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

browser_rules_pseudo-visited.js (1172B)


      1 /* Any copyright is dedicated to the Public Domain.
      2   http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 // Tests for visited/unvisited rule.
      7 
      8 const TEST_URI = URL_ROOT + "doc_visited.html";
      9 
     10 add_task(async () => {
     11  info("Open a url which has a visited and an unvisited link");
     12  const tab = await addTab(TEST_URI);
     13 
     14  info("Wait until the visited link is available");
     15  await waitUntilVisitedState(tab, ["#visited"]);
     16 
     17  info("Open the inspector");
     18  const { inspector, view } = await openRuleView();
     19 
     20  info("Check whether the rule view is shown correctly for visited element");
     21  await selectNode("#visited", inspector);
     22  ok(getRuleViewRule(view, "a:visited"), "Rule of a:visited is shown");
     23  ok(!getRuleViewRule(view, "a:link"), "Rule of a:link is not shown");
     24  ok(getRuleViewRule(view, "a"), "Rule of a is shown");
     25 
     26  info("Check whether the rule view is shown correctly for unvisited element");
     27  await selectNode("#unvisited", inspector);
     28  ok(!getRuleViewRule(view, "a:visited"), "Rule of a:visited is not shown");
     29  ok(getRuleViewRule(view, "a:link"), "Rule of a:link is shown");
     30  ok(getRuleViewRule(view, "a"), "Rule of a is shown");
     31 });