content/base/test/test_title.html

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 <!DOCTYPE HTML>
     2 <html>
     4 <head>
     5   <title>Test for titles</title>
     6   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     7   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
     8   <style type="text/css">
     9   </style>
    10 </head>
    12 <body onload="runTests()">
    14 <p id="display"></p>
    15 <div style="display:none;">
    16   <iframe id="html1" src="data:text/html,<html><head><title id='t'>Test</title></head></html>"></iframe>
    17   <iframe id="html2" src="data:text/html,<html><head><title id='t'>Test</title><title>Foo</title></head></html>"></iframe>
    18   <iframe id="html3" src="data:text/html,<html></html>"></iframe>
    19   <iframe id="xhtml1" src="data:text/xml,<html xmlns='http://www.w3.org/1999/xhtml'><body><title id='t'>Test</title></body></html>"></iframe>
    20   <iframe id="xhtml2" src="data:text/xml,<title xmlns='http://www.w3.org/1999/xhtml'>Test</title>"></iframe>
    21   <iframe id="xhtml3" src="data:text/xml,<title xmlns='http://www.w3.org/1999/xhtml'>Te<div>bogus</div>st</title>"></iframe>
    22   <iframe id="xhtml4" src="data:text/xml,<html xmlns='http://www.w3.org/1999/xhtml'/>"></iframe>
    23   <iframe id="xhtml5" src="data:text/xml,<html xmlns='http://www.w3.org/1999/xhtml'><head/></html>"></iframe>
    24   <iframe id="xhtml6" src="data:text/xml,<html xmlns='http://www.w3.org/1999/xhtml'><head><style/></head></html>"></iframe>
    25   <iframe id="xul1" src="data:application/vnd.mozilla.xul+xml,<window xmlns='http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul' title='Test'/>"></iframe>
    26   <iframe id="xul2" src="data:application/vnd.mozilla.xul+xml,<window xmlns='http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul' title='Test'/>"></iframe>
    27   <iframe id="svg1" src="data:text/xml,<svg xmlns='http://www.w3.org/2000/svg'><title id='t'>Test</title></svg>"></iframe>
    28   <iframe id="svg2" src="data:text/xml,<svg xmlns='http://www.w3.org/2000/svg'><title id='t'>Test</title></svg>"></iframe>
    29 </div>
    31 <pre id="test">
    32 <script>
    33 SimpleTest.waitForExplicitFinish();
    35 function runTests() {
    36   function testStatic(id, expect, description) {
    37     is(document.getElementById(id).contentDocument.title, expect, description);
    38   }
    40   testStatic("html1", "Test", "HTML <title>");
    41   testStatic("html2", "Test", "choose the first HTML <title>");
    42   testStatic("html3", "", "No title");
    43   testStatic("xhtml1", "Test", "XHTML <title> in body");
    44   testStatic("xhtml2", "Test", "XHTML <title> as root element");
    45   testStatic("xhtml3", "Test", "XHTML <title> containing an element");
    46   testStatic("xul1", "Test", "XUL <window> title attribute");
    47   testStatic("svg1", "Test", "SVG <title>");
    49   SimpleTest.finish();
    50 }
    51 </script>
    52 </pre>
    53 </body>
    54 </html>

mercurial