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.)

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

mercurial