|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 /** |
|
5 * Tests if certain function calls are properly highlighted in the UI. |
|
6 */ |
|
7 |
|
8 function ifTestingSupported() { |
|
9 let [target, debuggee, panel] = yield initCanavsDebuggerFrontend(SIMPLE_CANVAS_URL); |
|
10 let { window, $, EVENTS, SnapshotsListView, CallsListView } = panel.panelWin; |
|
11 |
|
12 yield reload(target); |
|
13 |
|
14 let recordingFinished = once(window, EVENTS.SNAPSHOT_RECORDING_FINISHED); |
|
15 let callListPopulated = once(window, EVENTS.CALL_LIST_POPULATED); |
|
16 SnapshotsListView._onRecordButtonClick(); |
|
17 yield promise.all([recordingFinished, callListPopulated]); |
|
18 |
|
19 is(CallsListView.itemCount, 8, |
|
20 "All the function calls should now be displayed in the UI."); |
|
21 |
|
22 is($(".call-item-view", CallsListView.getItemAtIndex(0).target).hasAttribute("draw-call"), true, |
|
23 "The first item's node should have a draw-call attribute."); |
|
24 is($(".call-item-view", CallsListView.getItemAtIndex(1).target).hasAttribute("draw-call"), false, |
|
25 "The second item's node should not have a draw-call attribute."); |
|
26 is($(".call-item-view", CallsListView.getItemAtIndex(2).target).hasAttribute("draw-call"), true, |
|
27 "The third item's node should have a draw-call attribute."); |
|
28 is($(".call-item-view", CallsListView.getItemAtIndex(3).target).hasAttribute("draw-call"), false, |
|
29 "The fourth item's node should not have a draw-call attribute."); |
|
30 is($(".call-item-view", CallsListView.getItemAtIndex(4).target).hasAttribute("draw-call"), true, |
|
31 "The fifth item's node should have a draw-call attribute."); |
|
32 is($(".call-item-view", CallsListView.getItemAtIndex(5).target).hasAttribute("draw-call"), false, |
|
33 "The sixth item's node should not have a draw-call attribute."); |
|
34 is($(".call-item-view", CallsListView.getItemAtIndex(6).target).hasAttribute("draw-call"), true, |
|
35 "The seventh item's node should have a draw-call attribute."); |
|
36 is($(".call-item-view", CallsListView.getItemAtIndex(7).target).hasAttribute("draw-call"), false, |
|
37 "The eigth item's node should not have a draw-call attribute."); |
|
38 |
|
39 yield teardown(panel); |
|
40 finish(); |
|
41 } |