browser/devtools/canvasdebugger/test/browser_canvas-actor-test-05.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 draw calls inside a single animation frame generate and retrieve
     6  * the correct "end result" screenshot.
     7  */
     9 function ifTestingSupported() {
    10   let [target, debuggee, front] = yield initCanavsDebuggerBackend(SIMPLE_CANVAS_URL);
    12   let navigated = once(target, "navigate");
    14   yield front.setup({ reload: true });
    15   ok(true, "The front was setup up successfully.");
    17   yield navigated;
    18   ok(true, "Target automatically navigated when the front was set up.");
    20   let snapshotActor = yield front.recordAnimationFrame();
    21   ok(snapshotActor,
    22     "A snapshot actor was sent after recording.");
    24   let animationOverview = yield snapshotActor.getOverview();
    25   ok(snapshotActor,
    26     "An animation overview could be retrieved after recording.");
    28   let screenshot = animationOverview.screenshot;
    29   ok(screenshot,
    30     "A screenshot was sent after recording.");
    32   is(screenshot.index, 6,
    33     "The screenshot's index is correct.");
    34   is(screenshot.width, 128,
    35     "The screenshot's width is correct.");
    36   is(screenshot.height, 128,
    37     "The screenshot's height is correct.");
    38   is(screenshot.flipped, false,
    39     "The screenshot's flipped flag is correct.");
    40   is([].find.call(screenshot.pixels, e => e > 0), 4290822336,
    41     "The screenshot's pixels seem to not be completely transparent.");
    43   yield removeTab(target.tab);
    44   finish();
    45 }

mercurial