toolkit/components/viewsource/test/browser/browser_bug713810.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/components/viewsource/test/browser/browser_bug713810.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,28 @@
     1.4 +/* Any copyright is dedicated to the Public Domain.
     1.5 + * http://creativecommons.org/publicdomain/zero/1.0/
     1.6 + */
     1.7 +
     1.8 +var source = '<html xmlns="http://www.w3.org/1999/xhtml"><body><p>This is a paragraph.</p></body></html>';
     1.9 +
    1.10 +function test() {
    1.11 +  waitForExplicitFinish();
    1.12 +  testHTML();
    1.13 +}
    1.14 +
    1.15 +function testHTML() {
    1.16 +  openDocumentSelect("data:text/html," + source, "p", function(aWindow) {
    1.17 +    is(aWindow.gBrowser.contentDocument.body.textContent,
    1.18 +       "<p>This is a paragraph.</p>",
    1.19 +       "Correct source for text/html");
    1.20 +    closeViewSourceWindow(aWindow, testXHTML);
    1.21 +  });
    1.22 +}
    1.23 +
    1.24 +function testXHTML() {
    1.25 +  openDocumentSelect("data:application/xhtml+xml," + source, "p", function(aWindow) {
    1.26 +    is(aWindow.gBrowser.contentDocument.body.textContent,
    1.27 +       '<p xmlns="http://www.w3.org/1999/xhtml">This is a paragraph.</p>',
    1.28 +       "Correct source for application/xhtml+xml");
    1.29 +    closeViewSourceWindow(aWindow, finish);
    1.30 +  });
    1.31 +}

mercurial