browser_flexbox_container_and_item.js (1329B)
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 container accordion and flex item accordion are both rendered when 7 // the selected element is both a flex container and item. 8 9 const TEST_URI = ` 10 <style type='text/css'> 11 .container { 12 display: flex; 13 } 14 </style> 15 <div id="container" class="container"> 16 <div id="item" class="container"> 17 <div></div> 18 </div> 19 </div> 20 `; 21 22 add_task(async function () { 23 await addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI)); 24 const { inspector, flexboxInspector } = await openLayoutView(); 25 const { document: doc } = flexboxInspector; 26 27 const onAccordionsRendered = waitForDOM(doc, ".accordion-item", 4); 28 await selectNode("#item", inspector); 29 const [flexItemPane, flexContainerPane] = await onAccordionsRendered; 30 31 ok(flexItemPane, "The flex item accordion pane is rendered."); 32 ok(flexContainerPane, "The flex container accordion pane is rendered."); 33 is( 34 flexItemPane.children[0].textContent, 35 "Flex Item of div#container.container", 36 "Got the correct header for the flex item pane." 37 ); 38 is( 39 flexContainerPane.children[0].textContent, 40 "Flex Container", 41 "Got the correct header for the flex container pane." 42 ); 43 });