michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/publicdomain/zero/1.0/ michael@0: */ michael@0: michael@0: let content = "line 1\nline 2\nline 3"; michael@0: let runningPlainText = false; michael@0: michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: michael@0: testViewSourceWindow("data:text/html," + encodeURIComponent(content), checkViewSource, function() { michael@0: testViewSourceWindow("data:text/plain," + encodeURIComponent(content), checkViewSource, finish); michael@0: }); michael@0: } michael@0: michael@0: function checkViewSource(aWindow) { michael@0: is(aWindow.gBrowser.contentDocument.body.textContent, content, "Correct content loaded"); michael@0: michael@0: let selection = aWindow.gBrowser.contentWindow.getSelection(); michael@0: let statusPanel = aWindow.document.getElementById("statusbar-line-col"); michael@0: is(statusPanel.getAttribute("label"), "", "Correct status bar text"); michael@0: for (let i = 1; i <= 3; i++) { michael@0: aWindow.goToLine(i); michael@0: is(selection.toString(), "line " + i, "Correct text selected"); michael@0: is(statusPanel.getAttribute("label"), "Line " + i + ", Col 1", "Correct status bar text"); michael@0: } michael@0: }