|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 * http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 /** |
|
5 * Test that width and height attributes don't get set by widget code on the highlight panel. |
|
6 */ |
|
7 |
|
8 "use strict"; |
|
9 |
|
10 let gTestTab; |
|
11 let gContentAPI; |
|
12 let gContentWindow; |
|
13 let highlight = document.getElementById("UITourHighlightContainer"); |
|
14 let tooltip = document.getElementById("UITourTooltip"); |
|
15 |
|
16 Components.utils.import("resource:///modules/UITour.jsm"); |
|
17 |
|
18 function test() { |
|
19 UITourTest(); |
|
20 } |
|
21 |
|
22 let tests = [ |
|
23 function test_highlight_size_attributes(done) { |
|
24 gContentAPI.showHighlight("appMenu"); |
|
25 waitForElementToBeVisible(highlight, function moveTheHighlight() { |
|
26 gContentAPI.showHighlight("urlbar"); |
|
27 waitForElementToBeVisible(highlight, function checkPanelAttributes() { |
|
28 SimpleTest.executeSoon(() => { |
|
29 ise(highlight.height, "", "Highlight panel should have no explicit height set"); |
|
30 ise(highlight.width, "", "Highlight panel should have no explicit width set"); |
|
31 done(); |
|
32 }); |
|
33 }, "Highlight should be moved to the urlbar"); |
|
34 }, "Highlight should be shown after showHighlight() for the appMenu"); |
|
35 }, |
|
36 |
|
37 function test_info_size_attributes(done) { |
|
38 gContentAPI.showInfo("appMenu", "test title", "test text"); |
|
39 waitForElementToBeVisible(tooltip, function moveTheTooltip() { |
|
40 gContentAPI.showInfo("urlbar", "new title", "new text"); |
|
41 waitForElementToBeVisible(tooltip, function checkPanelAttributes() { |
|
42 SimpleTest.executeSoon(() => { |
|
43 ise(tooltip.height, "", "Info panel should have no explicit height set"); |
|
44 ise(tooltip.width, "", "Info panel should have no explicit width set"); |
|
45 done(); |
|
46 }); |
|
47 }, "Tooltip should be moved to the urlbar"); |
|
48 }, "Tooltip should be shown after showInfo() for the appMenu"); |
|
49 }, |
|
50 |
|
51 ]; |