browser/devtools/canvasdebugger/test/browser_canvas-frontend-clear.js

Wed, 31 Dec 2014 06:55:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:50 +0100
changeset 2
7e26c7da4463
permissions
-rw-r--r--

Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2

     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