browser/devtools/canvasdebugger/test/browser_canvas-frontend-clear.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 clearing the snapshots list works as expected.
     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 firstRecordingFinished = once(window, EVENTS.SNAPSHOT_RECORDING_FINISHED);
    15   SnapshotsListView._onRecordButtonClick();
    17   yield firstRecordingFinished;
    18   ok(true, "Finished recording a snapshot of the animation loop.");
    20   is(SnapshotsListView.itemCount, 1,
    21     "There should be one item available in the snapshots list.");
    23   let secondRecordingFinished = once(window, EVENTS.SNAPSHOT_RECORDING_FINISHED);
    24   SnapshotsListView._onRecordButtonClick();
    26   yield secondRecordingFinished;
    27   ok(true, "Finished recording another snapshot of the animation loop.");
    29   is(SnapshotsListView.itemCount, 2,
    30     "There should be two items available in the snapshots list.");
    32   let clearingFinished = once(window, EVENTS.SNAPSHOTS_LIST_CLEARED);
    33   SnapshotsListView._onClearButtonClick();
    35   yield clearingFinished;
    36   ok(true, "Finished recording all snapshots.");
    38   is(SnapshotsListView.itemCount, 0,
    39     "There should be no items available in the snapshots list.");
    41   yield teardown(panel);
    42   finish();
    43 }

mercurial