browser/modules/test/browser_UITour_annotation_size_attributes.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

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

mercurial