michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: function test() michael@0: { michael@0: waitForExplicitFinish(); michael@0: michael@0: let doc; michael@0: michael@0: gBrowser.selectedTab = gBrowser.addTab(); michael@0: gBrowser.selectedBrowser.addEventListener("load", function onload() { michael@0: gBrowser.selectedBrowser.removeEventListener("load", onload, true); michael@0: doc = content.document; michael@0: waitForFocus(performTest, content); michael@0: }, true); michael@0: michael@0: content.location = "data:text/html,word1 word2 word3"; michael@0: michael@0: function performTest() michael@0: { michael@0: let link = doc.querySelector("a");; michael@0: let text = gatherTextUnder(link); michael@0: is(text, "word1 word2 word3", "Text under link is correctly computed."); michael@0: doc = null; michael@0: gBrowser.removeCurrentTab(); michael@0: finish(); michael@0: } michael@0: } michael@0: