browser/devtools/canvasdebugger/test/browser_canvas-frontend-img-screenshots.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:eba36ee27102
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
3
4 /**
5 * Tests if screenshots are properly displayed in the UI.
6 */
7
8 function ifTestingSupported() {
9 let [target, debuggee, panel] = yield initCanavsDebuggerFrontend(SIMPLE_CANVAS_URL);
10 let { window, $, EVENTS, SnapshotsListView } = panel.panelWin;
11
12 yield reload(target);
13
14 let recordingFinished = once(window, EVENTS.SNAPSHOT_RECORDING_FINISHED);
15 let callListPopulated = once(window, EVENTS.CALL_LIST_POPULATED);
16 let screenshotDisplayed = once(window, EVENTS.CALL_SCREENSHOT_DISPLAYED);
17 SnapshotsListView._onRecordButtonClick();
18 yield promise.all([recordingFinished, callListPopulated, screenshotDisplayed]);
19
20 is($("#screenshot-container").hidden, false,
21 "The screenshot container should now be visible.");
22
23 is($("#screenshot-dimensions").getAttribute("value"), "128 x 128",
24 "The screenshot dimensions label has the expected value.");
25
26 is($("#screenshot-image").getAttribute("flipped"), "false",
27 "The screenshot element should not be flipped vertically.");
28
29 ok(window.getComputedStyle($("#screenshot-image")).backgroundImage.contains("#screenshot-rendering"),
30 "The screenshot element should have an offscreen canvas element as a background.");
31
32 yield teardown(panel);
33 finish();
34 }

mercurial