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.
michael@0 | 1 | /* Any copyright is dedicated to the Public Domain. |
michael@0 | 2 | http://creativecommons.org/publicdomain/zero/1.0/ */ |
michael@0 | 3 | |
michael@0 | 4 | /** |
michael@0 | 5 | * Tests if the slider in the calls list view works as advertised. |
michael@0 | 6 | */ |
michael@0 | 7 | |
michael@0 | 8 | function ifTestingSupported() { |
michael@0 | 9 | let [target, debuggee, panel] = yield initCanavsDebuggerFrontend(SIMPLE_CANVAS_URL); |
michael@0 | 10 | let { window, $, EVENTS, SnapshotsListView, CallsListView } = panel.panelWin; |
michael@0 | 11 | |
michael@0 | 12 | yield reload(target); |
michael@0 | 13 | |
michael@0 | 14 | let recordingFinished = once(window, EVENTS.SNAPSHOT_RECORDING_FINISHED); |
michael@0 | 15 | let callListPopulated = once(window, EVENTS.CALL_LIST_POPULATED); |
michael@0 | 16 | SnapshotsListView._onRecordButtonClick(); |
michael@0 | 17 | yield promise.all([recordingFinished, callListPopulated]); |
michael@0 | 18 | |
michael@0 | 19 | is(CallsListView.selectedIndex, -1, |
michael@0 | 20 | "No item in the function calls list should be initially selected."); |
michael@0 | 21 | |
michael@0 | 22 | is($("#calls-slider").value, 0, |
michael@0 | 23 | "The slider should be moved all the way to the start."); |
michael@0 | 24 | is($("#calls-slider").min, 0, |
michael@0 | 25 | "The slider minimum value should be 0."); |
michael@0 | 26 | is($("#calls-slider").max, 7, |
michael@0 | 27 | "The slider maximum value should be 7."); |
michael@0 | 28 | |
michael@0 | 29 | CallsListView.selectedIndex = 1; |
michael@0 | 30 | is($("#calls-slider").value, 1, |
michael@0 | 31 | "The slider should be changed according to the current selection."); |
michael@0 | 32 | |
michael@0 | 33 | $("#calls-slider").value = 2; |
michael@0 | 34 | is(CallsListView.selectedIndex, 2, |
michael@0 | 35 | "The calls selection should be changed according to the current slider value."); |
michael@0 | 36 | |
michael@0 | 37 | yield teardown(panel); |
michael@0 | 38 | finish(); |
michael@0 | 39 | } |