tor-browser

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

browser_grids_grid-list-no-grids.js (1154B)


      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 no grid list items and a "no grids available" message is displayed when
      7 // there are no grid containers on the page.
      8 
      9 const TEST_URI = `
     10  <style type='text/css'>
     11  </style>
     12  <div id="grid">
     13    <div id="cell1">cell1</div>
     14    <div id="cell2">cell2</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, gridInspector } = await openLayoutView();
     21  const { document: doc } = gridInspector;
     22  const { highlighters } = inspector;
     23 
     24  await selectNode("#grid", inspector);
     25  const noGridList = doc.querySelector(
     26    "#layout-grid-section .devtools-sidepanel-no-result"
     27  );
     28  const gridList = doc.getElementById("grid-list");
     29 
     30  info("Checking the initial state of the Grid Inspector.");
     31  ok(noGridList, "The message no grid containers is displayed.");
     32  ok(!gridList, "No grid containers are listed.");
     33  ok(
     34    !highlighters.gridHighlighters.size,
     35    "No CSS grid highlighter exists in the highlighters overlay."
     36  );
     37 });