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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* Any copyright is dedicated to the Public Domain.
     2    http://creativecommons.org/publicdomain/zero/1.0/ */
     4 /**
     5  * Tests if screenshots are properly displayed in the UI.
     6  */
     8 function ifTestingSupported() {
     9   let [target, debuggee, panel] = yield initCanavsDebuggerFrontend(SIMPLE_CANVAS_URL);
    10   let { window, $, EVENTS, SnapshotsListView } = panel.panelWin;
    12   yield reload(target);
    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]);
    20   is($("#screenshot-container").hidden, false,
    21     "The screenshot container should now be visible.");
    23   is($("#screenshot-dimensions").getAttribute("value"), "128 x 128",
    24     "The screenshot dimensions label has the expected value.");
    26   is($("#screenshot-image").getAttribute("flipped"), "false",
    27     "The screenshot element should not be flipped vertically.");
    29   ok(window.getComputedStyle($("#screenshot-image")).backgroundImage.contains("#screenshot-rendering"),
    30     "The screenshot element should have an offscreen canvas element as a background.");
    32   yield teardown(panel);
    33   finish();
    34 }

mercurial