tor-browser

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

browser_flexbox_item_outline_exists.js (988B)


      1 /* Any copyright is dedicated to the Public Domain.
      2 http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 // Test that the flex item outline exists when a flex item is selected.
      7 
      8 const TEST_URI = URL_ROOT + "doc_flexbox_specific_cases.html";
      9 
     10 add_task(async function () {
     11  await addTab(TEST_URI);
     12  const { inspector, flexboxInspector } = await openLayoutView();
     13  const { document: doc } = flexboxInspector;
     14 
     15  // Select a flex item in the test document and wait for the outline to be rendered.
     16  const onFlexItemOutlineRendered = waitForDOM(doc, ".flex-outline-container");
     17  await selectNode(".item", inspector);
     18  const [flexOutlineContainer] = await onFlexItemOutlineRendered;
     19 
     20  ok(flexOutlineContainer, "The flex outline exists in the DOM");
     21 
     22  const [basis, final] = [
     23    ...flexOutlineContainer.querySelectorAll(
     24      ".flex-outline-basis, .flex-outline-final"
     25    ),
     26  ];
     27 
     28  ok(basis, "The basis outline exists");
     29  ok(final, "The final outline exists");
     30 });