|
1 function test () { |
|
2 |
|
3 waitForExplicitFinish(); |
|
4 gBrowser.selectedTab = gBrowser.addTab(); |
|
5 gBrowser.selectedBrowser.addEventListener("load", function () { |
|
6 gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true); |
|
7 |
|
8 let doc = gBrowser.contentDocument; |
|
9 let tooltip = document.getElementById("aHTMLTooltip"); |
|
10 |
|
11 ok(tooltip.fillInPageTooltip(doc.getElementById("svg1")), "should get title"); |
|
12 is(tooltip.getAttribute("label"), "This is a non-root SVG element title"); |
|
13 |
|
14 ok(tooltip.fillInPageTooltip(doc.getElementById("text1")), "should get title"); |
|
15 is(tooltip.getAttribute("label"), "\n\n\n This is a title\n\n "); |
|
16 |
|
17 ok(!tooltip.fillInPageTooltip(doc.getElementById("text2")), "should not get title"); |
|
18 |
|
19 ok(!tooltip.fillInPageTooltip(doc.getElementById("text3")), "should not get title"); |
|
20 |
|
21 ok(tooltip.fillInPageTooltip(doc.getElementById("link1")), "should get title"); |
|
22 is(tooltip.getAttribute("label"), "\n This is a title\n "); |
|
23 ok(tooltip.fillInPageTooltip(doc.getElementById("text4")), "should get title"); |
|
24 is(tooltip.getAttribute("label"), "\n This is a title\n "); |
|
25 |
|
26 ok(!tooltip.fillInPageTooltip(doc.getElementById("link2")), "should not get title"); |
|
27 |
|
28 ok(tooltip.fillInPageTooltip(doc.getElementById("link3")), "should get title"); |
|
29 isnot(tooltip.getAttribute("label"), ""); |
|
30 |
|
31 ok(tooltip.fillInPageTooltip(doc.getElementById("link4")), "should get title"); |
|
32 is(tooltip.getAttribute("label"), "This is an xlink:title attribute"); |
|
33 |
|
34 ok(!tooltip.fillInPageTooltip(doc.getElementById("text5")), "should not get title"); |
|
35 |
|
36 gBrowser.removeCurrentTab(); |
|
37 finish(); |
|
38 }, true); |
|
39 |
|
40 content.location = |
|
41 "http://mochi.test:8888/browser/browser/base/content/test/general/title_test.svg"; |
|
42 } |
|
43 |