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

     1 /* Any copyright is dedicated to the Public Domain.
     2  * http://creativecommons.org/publicdomain/zero/1.0/ */
     4 /**
     5  * Test that width and height attributes don't get set by widget code on the highlight panel.
     6  */
     8 "use strict";
    10 let gTestTab;
    11 let gContentAPI;
    12 let gContentWindow;
    13 let highlight = document.getElementById("UITourHighlightContainer");
    14 let tooltip = document.getElementById("UITourTooltip");
    16 Components.utils.import("resource:///modules/UITour.jsm");
    18 function test() {
    19   UITourTest();
    20 }
    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   },
    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   },
    51 ];

mercurial