browser/base/content/test/general/browser_bug329212.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/base/content/test/general/browser_bug329212.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,43 @@
     1.4 +function test () {
     1.5 +
     1.6 +  waitForExplicitFinish();
     1.7 +  gBrowser.selectedTab = gBrowser.addTab();
     1.8 +  gBrowser.selectedBrowser.addEventListener("load", function () {
     1.9 +    gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
    1.10 +
    1.11 +    let doc = gBrowser.contentDocument;
    1.12 +    let tooltip = document.getElementById("aHTMLTooltip");
    1.13 +
    1.14 +    ok(tooltip.fillInPageTooltip(doc.getElementById("svg1")), "should get title");
    1.15 +    is(tooltip.getAttribute("label"), "This is a non-root SVG element title");
    1.16 +
    1.17 +    ok(tooltip.fillInPageTooltip(doc.getElementById("text1")), "should get title");
    1.18 +    is(tooltip.getAttribute("label"), "\n\n\n    This            is a title\n\n    ");
    1.19 +
    1.20 +    ok(!tooltip.fillInPageTooltip(doc.getElementById("text2")), "should not get title");
    1.21 +
    1.22 +    ok(!tooltip.fillInPageTooltip(doc.getElementById("text3")), "should not get title");
    1.23 +
    1.24 +    ok(tooltip.fillInPageTooltip(doc.getElementById("link1")), "should get title");
    1.25 +    is(tooltip.getAttribute("label"), "\n      This is a title\n    ");
    1.26 +    ok(tooltip.fillInPageTooltip(doc.getElementById("text4")), "should get title");
    1.27 +    is(tooltip.getAttribute("label"), "\n      This is a title\n    ");
    1.28 +
    1.29 +    ok(!tooltip.fillInPageTooltip(doc.getElementById("link2")), "should not get title");
    1.30 +
    1.31 +    ok(tooltip.fillInPageTooltip(doc.getElementById("link3")), "should get title");
    1.32 +    isnot(tooltip.getAttribute("label"), "");
    1.33 +
    1.34 +    ok(tooltip.fillInPageTooltip(doc.getElementById("link4")), "should get title");
    1.35 +    is(tooltip.getAttribute("label"), "This is an xlink:title attribute");
    1.36 +
    1.37 +    ok(!tooltip.fillInPageTooltip(doc.getElementById("text5")), "should not get title");
    1.38 +
    1.39 +    gBrowser.removeCurrentTab();
    1.40 +    finish();
    1.41 +  }, true);
    1.42 +
    1.43 +  content.location = 
    1.44 +    "http://mochi.test:8888/browser/browser/base/content/test/general/title_test.svg";
    1.45 +}
    1.46 +

mercurial