michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: /** michael@0: * Tests if screenshots are properly displayed in the UI. michael@0: */ michael@0: michael@0: function ifTestingSupported() { michael@0: let [target, debuggee, panel] = yield initCanavsDebuggerFrontend(SIMPLE_CANVAS_URL); michael@0: let { window, $, EVENTS, SnapshotsListView } = panel.panelWin; michael@0: michael@0: yield reload(target); michael@0: michael@0: let recordingFinished = once(window, EVENTS.SNAPSHOT_RECORDING_FINISHED); michael@0: let callListPopulated = once(window, EVENTS.CALL_LIST_POPULATED); michael@0: let screenshotDisplayed = once(window, EVENTS.CALL_SCREENSHOT_DISPLAYED); michael@0: SnapshotsListView._onRecordButtonClick(); michael@0: yield promise.all([recordingFinished, callListPopulated, screenshotDisplayed]); michael@0: michael@0: is($("#screenshot-container").hidden, false, michael@0: "The screenshot container should now be visible."); michael@0: michael@0: is($("#screenshot-dimensions").getAttribute("value"), "128 x 128", michael@0: "The screenshot dimensions label has the expected value."); michael@0: michael@0: is($("#screenshot-image").getAttribute("flipped"), "false", michael@0: "The screenshot element should not be flipped vertically."); michael@0: michael@0: ok(window.getComputedStyle($("#screenshot-image")).backgroundImage.contains("#screenshot-rendering"), michael@0: "The screenshot element should have an offscreen canvas element as a background."); michael@0: michael@0: yield teardown(panel); michael@0: finish(); michael@0: }