browser/devtools/canvasdebugger/test/browser_canvas-frontend-slider-01.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:e3f953146f87
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 }

mercurial