tor-browser

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

browser_rules_inherited-properties_04.js (920B)


      1 /* Any copyright is dedicated to the Public Domain.
      2 http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 // Tests that different inherited properties sections are created for rules
      7 // inherited from several elements of the same type.
      8 
      9 const TEST_URI = `
     10  <div style="cursor:pointer">
     11    A
     12    <div style="cursor:pointer">
     13      B<a>Cursor</a>
     14    </div>
     15  </div>
     16 `;
     17 
     18 add_task(async function () {
     19  await addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
     20  const { inspector, view } = await openRuleView();
     21  await selectNode("a", inspector);
     22  await elementStyleInherit(inspector, view);
     23 });
     24 
     25 function elementStyleInherit(inspector, view) {
     26  const gutters = view.element.querySelectorAll(".ruleview-header");
     27  is(gutters.length, 2, "Gutters should contains 2 sections");
     28  ok(gutters[0].textContent, "Inherited from div");
     29  ok(gutters[1].textContent, "Inherited from div");
     30 }