browser/modules/test/browser_UITour_annotation_size_attributes.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/modules/test/browser_UITour_annotation_size_attributes.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,51 @@
     1.4 +/* Any copyright is dedicated to the Public Domain.
     1.5 + * http://creativecommons.org/publicdomain/zero/1.0/ */
     1.6 +
     1.7 +/**
     1.8 + * Test that width and height attributes don't get set by widget code on the highlight panel.
     1.9 + */
    1.10 +
    1.11 +"use strict";
    1.12 +
    1.13 +let gTestTab;
    1.14 +let gContentAPI;
    1.15 +let gContentWindow;
    1.16 +let highlight = document.getElementById("UITourHighlightContainer");
    1.17 +let tooltip = document.getElementById("UITourTooltip");
    1.18 +
    1.19 +Components.utils.import("resource:///modules/UITour.jsm");
    1.20 +
    1.21 +function test() {
    1.22 +  UITourTest();
    1.23 +}
    1.24 +
    1.25 +let tests = [
    1.26 +  function test_highlight_size_attributes(done) {
    1.27 +    gContentAPI.showHighlight("appMenu");
    1.28 +    waitForElementToBeVisible(highlight, function moveTheHighlight() {
    1.29 +      gContentAPI.showHighlight("urlbar");
    1.30 +      waitForElementToBeVisible(highlight, function checkPanelAttributes() {
    1.31 +        SimpleTest.executeSoon(() => {
    1.32 +          ise(highlight.height, "", "Highlight panel should have no explicit height set");
    1.33 +          ise(highlight.width, "", "Highlight panel should have no explicit width set");
    1.34 +          done();
    1.35 +        });
    1.36 +      }, "Highlight should be moved to the urlbar");
    1.37 +    }, "Highlight should be shown after showHighlight() for the appMenu");
    1.38 +  },
    1.39 +
    1.40 +  function test_info_size_attributes(done) {
    1.41 +    gContentAPI.showInfo("appMenu", "test title", "test text");
    1.42 +    waitForElementToBeVisible(tooltip, function moveTheTooltip() {
    1.43 +      gContentAPI.showInfo("urlbar", "new title", "new text");
    1.44 +      waitForElementToBeVisible(tooltip, function checkPanelAttributes() {
    1.45 +        SimpleTest.executeSoon(() => {
    1.46 +          ise(tooltip.height, "", "Info panel should have no explicit height set");
    1.47 +          ise(tooltip.width, "", "Info panel should have no explicit width set");
    1.48 +          done();
    1.49 +        });
    1.50 +      }, "Tooltip should be moved to the urlbar");
    1.51 +    }, "Tooltip should be shown after showInfo() for the appMenu");
    1.52 +  },
    1.53 +
    1.54 +];

mercurial