author | Nicolas Chevobbe <nchevobbe@mozilla.com> |
Wed, 10 Feb 2021 09:43:52 +0000 | |
changeset 566811 | 9363c9d95f6c9c36fd88ebc5c630c0a0eada2c8b |
parent 566810 | 373160bb04a5ba02d06c6c09468fe4fe4696eef8 |
child 566812 | 9ce8fc97afa5a65d4799296bd3184608f8a53160 |
push id | 136129 |
push user | nchevobbe@mozilla.com |
push date | Wed, 10 Feb 2021 10:55:01 +0000 |
treeherder | autoland@9363c9d95f6c [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | bomsy |
bugs | 1691096 |
milestone | 87.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
devtools/client/webconsole/test/browser/browser_jsterm_screenshot_command_clipboard.js | file | annotate | diff | comparison | revisions |
--- a/devtools/client/webconsole/test/browser/browser_jsterm_screenshot_command_clipboard.js +++ b/devtools/client/webconsole/test/browser/browser_jsterm_screenshot_command_clipboard.js @@ -15,19 +15,16 @@ const dpr = "--dpr 1"; add_task(async function() { const hud = await openNewTabAndConsole(TEST_URI); ok(hud, "web console opened"); await testClipboard(hud); await testFullpageClipboard(hud); await testSelectorClipboard(hud); - - // overflow - await createScrollbarOverflow(); await testFullpageClipboardScrollbar(hud); }); async function testClipboard(hud) { const command = `:screenshot --clipboard ${dpr}`; await executeScreenshotClipboardCommand(hud, command); const contentSize = await getContentSize(); const imgSize = await getImageSizeFromClipboard(); @@ -80,16 +77,19 @@ async function testSelectorClipboard(hud imgSize.height, img.clientHeight, "Selector Clipboard: Image height matches element size" ); }); } async function testFullpageClipboardScrollbar(hud) { + info("Test taking a fullpage image that overflows"); + await createScrollbarOverflow(); + const command = `:screenshot --fullpage --clipboard ${dpr}`; await executeScreenshotClipboardCommand(hud, command); const contentSize = await getContentSize(); const scrollbarSize = await getScrollbarSize(); const imgSize = await getImageSizeFromClipboard(); is( imgSize.width, @@ -128,16 +128,19 @@ async function createScrollbarOverflow() // Trigger scrollbars by forcing document to overflow // This only affects results on OSes with scrollbars that reduce document size // (non-floating scrollbars). With default OS settings, this means Windows // and Linux are affected, but Mac is not. For Mac to exhibit this behavior, // change System Preferences -> General -> Show scroll bars to Always. await SpecialPowers.spawn(gBrowser.selectedBrowser, [], function() { content.document.body.classList.add("overflow"); }); + + // Let's wait for next tick so scrollbars have the time to be rendered + await waitForTick(); } async function getScrollbarSize() { const scrollbarSize = await SpecialPowers.spawn( gBrowser.selectedBrowser, [], function() { const winUtils = content.windowUtils;