michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: /** michael@0: * Tests if the slider in the calls list view works as advertised. michael@0: */ michael@0: michael@0: function ifTestingSupported() { michael@0: let [target, debuggee, panel] = yield initCanavsDebuggerFrontend(SIMPLE_CANVAS_URL); michael@0: let { window, $, EVENTS, SnapshotsListView, CallsListView } = panel.panelWin; michael@0: michael@0: yield reload(target); michael@0: michael@0: let recordingFinished = once(window, EVENTS.SNAPSHOT_RECORDING_FINISHED); michael@0: let callListPopulated = once(window, EVENTS.CALL_LIST_POPULATED); michael@0: SnapshotsListView._onRecordButtonClick(); michael@0: yield promise.all([recordingFinished, callListPopulated]); michael@0: michael@0: is(CallsListView.selectedIndex, -1, michael@0: "No item in the function calls list should be initially selected."); michael@0: michael@0: is($("#calls-slider").value, 0, michael@0: "The slider should be moved all the way to the start."); michael@0: is($("#calls-slider").min, 0, michael@0: "The slider minimum value should be 0."); michael@0: is($("#calls-slider").max, 7, michael@0: "The slider maximum value should be 7."); michael@0: michael@0: CallsListView.selectedIndex = 1; michael@0: is($("#calls-slider").value, 1, michael@0: "The slider should be changed according to the current selection."); michael@0: michael@0: $("#calls-slider").value = 2; michael@0: is(CallsListView.selectedIndex, 2, michael@0: "The calls selection should be changed according to the current slider value."); michael@0: michael@0: yield teardown(panel); michael@0: finish(); michael@0: }