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

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* Any copyright is dedicated to the Public Domain.
     2    http://creativecommons.org/publicdomain/zero/1.0/ */
     4 /**
     5  * Tests if the slider in the calls list view works as advertised.
     6  */
     8 function ifTestingSupported() {
     9   let [target, debuggee, panel] = yield initCanavsDebuggerFrontend(SIMPLE_CANVAS_URL);
    10   let { window, $, EVENTS, SnapshotsListView, CallsListView } = panel.panelWin;
    12   yield reload(target);
    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]);
    19   is(CallsListView.selectedIndex, -1,
    20     "No item in the function calls list should be initially selected.");
    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.");
    29   CallsListView.selectedIndex = 1;
    30   is($("#calls-slider").value, 1,
    31     "The slider should be changed according to the current selection.");
    33   $("#calls-slider").value = 2;
    34   is(CallsListView.selectedIndex, 2,
    35     "The calls selection should be changed according to the current slider value.");
    37   yield teardown(panel);
    38   finish();
    39 }

mercurial