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