|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 /** |
|
5 * Tests whether the frontend displays the correct info for a snapshot |
|
6 * after finishing recording. |
|
7 */ |
|
8 |
|
9 function ifTestingSupported() { |
|
10 let [target, debuggee, panel] = yield initCanavsDebuggerFrontend(SIMPLE_CANVAS_URL); |
|
11 let { window, EVENTS, $, SnapshotsListView } = panel.panelWin; |
|
12 |
|
13 yield reload(target); |
|
14 |
|
15 let recordingFinished = once(window, EVENTS.SNAPSHOT_RECORDING_FINISHED); |
|
16 SnapshotsListView._onRecordButtonClick(); |
|
17 |
|
18 yield recordingFinished; |
|
19 ok(true, "Finished recording a snapshot of the animation loop."); |
|
20 |
|
21 let item = SnapshotsListView.getItemAtIndex(0); |
|
22 |
|
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)."); |
|
27 |
|
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."); |
|
34 |
|
35 yield teardown(panel); |
|
36 finish(); |
|
37 } |