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