|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 /** |
|
5 * Tests if the slider in the calls list view works as advertised. |
|
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.selectedIndex, -1, |
|
20 "No item in the function calls list should be initially selected."); |
|
21 |
|
22 is($("#calls-slider").value, 0, |
|
23 "The slider should be moved all the way to the start."); |
|
24 is($("#calls-slider").min, 0, |
|
25 "The slider minimum value should be 0."); |
|
26 is($("#calls-slider").max, 7, |
|
27 "The slider maximum value should be 7."); |
|
28 |
|
29 CallsListView.selectedIndex = 1; |
|
30 is($("#calls-slider").value, 1, |
|
31 "The slider should be changed according to the current selection."); |
|
32 |
|
33 $("#calls-slider").value = 2; |
|
34 is(CallsListView.selectedIndex, 2, |
|
35 "The calls selection should be changed according to the current slider value."); |
|
36 |
|
37 yield teardown(panel); |
|
38 finish(); |
|
39 } |