browser_markup_screenshot_node.js (815B)
1 /* Any copyright is dedicated to the Public Domain. 2 http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 "use strict"; 5 6 const TEST_URL = `data:text/html;charset=utf8, 7 <div id="blue-node" style="width:30px;height:30px;background:rgb(0, 0, 255)"></div>`; 8 9 // Test that the "Screenshot Node" feature works with a regular node in the main document. 10 add_task(async function () { 11 const { inspector, toolbox } = await openInspectorForURL(encodeURI(TEST_URL)); 12 13 info("Select the blue node"); 14 await selectNode("#blue-node", inspector); 15 16 info("Take a screenshot of the blue node and verify it looks as expected"); 17 const blueScreenshot = await takeNodeScreenshot(inspector); 18 await assertSingleColorScreenshotImage(blueScreenshot, 30, 30, { 19 r: 0, 20 g: 0, 21 b: 255, 22 }); 23 24 await toolbox.destroy(); 25 });