browser/devtools/canvasdebugger/test/browser_canvas-frontend-img-thumbnails-01.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

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 thumbnails are properly displayed in the UI.
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, $, $all, EVENTS, SnapshotsListView } = 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 let thumbnailsDisplayed = once(window, EVENTS.THUMBNAILS_DISPLAYED);
michael@0 17 SnapshotsListView._onRecordButtonClick();
michael@0 18 yield promise.all([recordingFinished, callListPopulated, thumbnailsDisplayed]);
michael@0 19
michael@0 20 is($all(".filmstrip-thumbnail").length, 4,
michael@0 21 "There should be 4 thumbnails displayed in the UI.");
michael@0 22
michael@0 23 let firstThumbnail = $(".filmstrip-thumbnail[index='0']");
michael@0 24 ok(firstThumbnail,
michael@0 25 "The first thumbnail element should be for the function call at index 0.");
michael@0 26 is(firstThumbnail.width, 50,
michael@0 27 "The first thumbnail's width is correct.");
michael@0 28 is(firstThumbnail.height, 50,
michael@0 29 "The first thumbnail's height is correct.");
michael@0 30 is(firstThumbnail.getAttribute("flipped"), "false",
michael@0 31 "The first thumbnail should not be flipped vertically.");
michael@0 32
michael@0 33 let secondThumbnail = $(".filmstrip-thumbnail[index='2']");
michael@0 34 ok(secondThumbnail,
michael@0 35 "The second thumbnail element should be for the function call at index 2.");
michael@0 36 is(secondThumbnail.width, 50,
michael@0 37 "The second thumbnail's width is correct.");
michael@0 38 is(secondThumbnail.height, 50,
michael@0 39 "The second thumbnail's height is correct.");
michael@0 40 is(secondThumbnail.getAttribute("flipped"), "false",
michael@0 41 "The second thumbnail should not be flipped vertically.");
michael@0 42
michael@0 43 let thirdThumbnail = $(".filmstrip-thumbnail[index='4']");
michael@0 44 ok(thirdThumbnail,
michael@0 45 "The third thumbnail element should be for the function call at index 4.");
michael@0 46 is(thirdThumbnail.width, 50,
michael@0 47 "The third thumbnail's width is correct.");
michael@0 48 is(thirdThumbnail.height, 50,
michael@0 49 "The third thumbnail's height is correct.");
michael@0 50 is(thirdThumbnail.getAttribute("flipped"), "false",
michael@0 51 "The third thumbnail should not be flipped vertically.");
michael@0 52
michael@0 53 let fourthThumbnail = $(".filmstrip-thumbnail[index='6']");
michael@0 54 ok(fourthThumbnail,
michael@0 55 "The fourth thumbnail element should be for the function call at index 6.");
michael@0 56 is(fourthThumbnail.width, 50,
michael@0 57 "The fourth thumbnail's width is correct.");
michael@0 58 is(fourthThumbnail.height, 50,
michael@0 59 "The fourth thumbnail's height is correct.");
michael@0 60 is(fourthThumbnail.getAttribute("flipped"), "false",
michael@0 61 "The fourth thumbnail should not be flipped vertically.");
michael@0 62
michael@0 63 yield teardown(panel);
michael@0 64 finish();
michael@0 65 }

mercurial