Wed, 31 Dec 2014 06:09:35 +0100
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 whether the frontend displays the correct info for a snapshot
6 * after finishing recording.
7 */
9 function ifTestingSupported() {
10 let [target, debuggee, panel] = yield initCanavsDebuggerFrontend(SIMPLE_CANVAS_URL);
11 let { window, EVENTS, $, SnapshotsListView } = panel.panelWin;
13 yield reload(target);
15 let recordingFinished = once(window, EVENTS.SNAPSHOT_RECORDING_FINISHED);
16 SnapshotsListView._onRecordButtonClick();
18 yield recordingFinished;
19 ok(true, "Finished recording a snapshot of the animation loop.");
21 let item = SnapshotsListView.getItemAtIndex(0);
23 is(SnapshotsListView.selectedItem, item,
24 "The first item should now be selected in the snapshots list view (1).");
25 is(SnapshotsListView.selectedIndex, 0,
26 "The first item should now be selected in the snapshots list view (2).");
28 is($(".snapshot-item-calls", item.target).getAttribute("value"), "4 draws, 8 calls",
29 "The placeholder item's calls label is correct.");
30 is($(".snapshot-item-save", item.target).getAttribute("value"), "Save",
31 "The placeholder item's save label is correct.");
32 is($(".snapshot-item-save", item.target).getAttribute("disabled"), "false",
33 "The placeholder item's save label should be clickable.");
35 yield teardown(panel);
36 finish();
37 }