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: var source = '

This is a paragraph.

'; michael@0: michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: testHTML(); michael@0: } michael@0: michael@0: function testHTML() { michael@0: openDocumentSelect("data:text/html," + source, "p", function(aWindow) { michael@0: is(aWindow.gBrowser.contentDocument.body.textContent, michael@0: "

This is a paragraph.

", michael@0: "Correct source for text/html"); michael@0: closeViewSourceWindow(aWindow, testXHTML); michael@0: }); michael@0: } michael@0: michael@0: function testXHTML() { michael@0: openDocumentSelect("data:application/xhtml+xml," + source, "p", function(aWindow) { michael@0: is(aWindow.gBrowser.contentDocument.body.textContent, michael@0: '

This is a paragraph.

', michael@0: "Correct source for application/xhtml+xml"); michael@0: closeViewSourceWindow(aWindow, finish); michael@0: }); michael@0: }