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 a placeholder snapshot while recording.
6 */
8 function ifTestingSupported() {
9 let [target, debuggee, panel] = yield initCanavsDebuggerFrontend(SIMPLE_CANVAS_URL);
10 let { window, EVENTS, L10N, $, SnapshotsListView } = panel.panelWin;
12 yield reload(target);
14 let recordingStarted = once(window, EVENTS.SNAPSHOT_RECORDING_STARTED);
15 let recordingFinished = once(window, EVENTS.SNAPSHOT_RECORDING_FINISHED);
16 let recordingSelected = once(window, EVENTS.SNAPSHOT_RECORDING_SELECTED);
17 SnapshotsListView._onRecordButtonClick();
19 yield recordingStarted;
20 ok(true, "Started recording a snapshot of the animation loop.");
22 let item = SnapshotsListView.getItemAtIndex(0);
24 is($(".snapshot-item-title", item.target).getAttribute("value"),
25 L10N.getFormatStr("snapshotsList.itemLabel", 1),
26 "The placeholder item's title label is correct.");
28 is($(".snapshot-item-calls", item.target).getAttribute("value"),
29 L10N.getStr("snapshotsList.loadingLabel"),
30 "The placeholder item's calls label is correct.");
32 is($(".snapshot-item-save", item.target).getAttribute("value"), "",
33 "The placeholder item's save label should not have a value yet.");
35 is($("#reload-notice").getAttribute("hidden"), "true",
36 "The reload notice should now be hidden.");
37 is($("#empty-notice").getAttribute("hidden"), "true",
38 "The empty notice should now be hidden.");
39 is($("#import-notice").hasAttribute("hidden"), false,
40 "The import notice should now be visible.");
42 is($("#screenshot-container").getAttribute("hidden"), "true",
43 "The screenshot container should still be hidden.");
44 is($("#snapshot-filmstrip").getAttribute("hidden"), "true",
45 "The snapshot filmstrip should still be hidden.");
47 is($("#debugging-pane-contents").getAttribute("hidden"), "true",
48 "The rest of the UI should still be hidden.");
50 yield recordingFinished;
51 ok(true, "Finished recording a snapshot of the animation loop.");
53 yield recordingSelected;
54 ok(true, "Finished selecting a snapshot of the animation loop.");
56 is($("#reload-notice").getAttribute("hidden"), "true",
57 "The reload notice should now be hidden.");
58 is($("#empty-notice").getAttribute("hidden"), "true",
59 "The empty notice should now be hidden.");
60 is($("#import-notice").getAttribute("hidden"), "true",
61 "The import notice should now be hidden.");
63 is($("#screenshot-container").hasAttribute("hidden"), false,
64 "The screenshot container should now be visible.");
65 is($("#snapshot-filmstrip").hasAttribute("hidden"), false,
66 "The snapshot filmstrip should now be visible.");
68 is($("#debugging-pane-contents").hasAttribute("hidden"), false,
69 "The rest of the UI should now be visible.");
71 yield teardown(panel);
72 finish();
73 }