docshell/test/test_bug703855.html

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

michael@0 1 <!DOCTYPE HTML>
michael@0 2 <html>
michael@0 3 <!--
michael@0 4 https://bugzilla.mozilla.org/show_bug.cgi?id=703855
michael@0 5 -->
michael@0 6 <head>
michael@0 7 <meta charset="utf-8">
michael@0 8 <title>Test for Bug 703855</title>
michael@0 9 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
michael@0 10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
michael@0 11 </head>
michael@0 12 <body>
michael@0 13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=703855">Mozilla Bug 703855</a>
michael@0 14 <p id="display"></p>
michael@0 15 <div id="content" style="display: none">
michael@0 16 <iframe id="f" src="file_bug703855.html"></iframe>
michael@0 17 </div>
michael@0 18 <pre id="test">
michael@0 19 <script type="application/javascript">
michael@0 20
michael@0 21 /** Test for Bug 703855 **/
michael@0 22
michael@0 23 SimpleTest.waitForExplicitFinish();
michael@0 24
michael@0 25 var timingAttributes = [
michael@0 26 'connectEnd',
michael@0 27 'connectStart',
michael@0 28 'domComplete',
michael@0 29 'domContentLoadedEventEnd',
michael@0 30 'domContentLoadedEventStart',
michael@0 31 'domInteractive',
michael@0 32 'domLoading',
michael@0 33 'domainLookupEnd',
michael@0 34 'domainLookupStart',
michael@0 35 'fetchStart',
michael@0 36 'loadEventEnd',
michael@0 37 'loadEventStart',
michael@0 38 'navigationStart',
michael@0 39 'redirectEnd',
michael@0 40 'redirectStart',
michael@0 41 'requestStart',
michael@0 42 'responseEnd',
michael@0 43 'responseStart',
michael@0 44 'unloadEventEnd',
michael@0 45 'unloadEventStart'
michael@0 46 ];
michael@0 47 var originalTiming = {};
michael@0 48
michael@0 49 function runTest() {
michael@0 50 var timing = $("f").contentWindow.performance.timing;
michael@0 51 for (i in timingAttributes) {
michael@0 52 originalTiming[timingAttributes[i]] = timing[timingAttributes[i]];
michael@0 53 }
michael@0 54
michael@0 55 var doc = $("f").contentDocument;
michael@0 56 doc.open();
michael@0 57 doc.write("<!DOCTYPE html>");
michael@0 58 doc.close();
michael@0 59
michael@0 60 SimpleTest.executeSoon(function() {
michael@0 61 var newTiming = $("f").contentWindow.performance.timing;
michael@0 62 for (var i in timingAttributes) {
michael@0 63 is(timing[timingAttributes[i]], originalTiming[timingAttributes[i]],
michael@0 64 "document.open should not affect value of " + timingAttributes[i]);
michael@0 65 }
michael@0 66 SimpleTest.finish();
michael@0 67 });
michael@0 68 }
michael@0 69
michael@0 70 addLoadEvent(function() {
michael@0 71 SimpleTest.executeSoon(runTest);
michael@0 72 });
michael@0 73
michael@0 74
michael@0 75
michael@0 76 </script>
michael@0 77 </pre>
michael@0 78 </body>
michael@0 79 </html>

mercurial