1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/docshell/test/test_bug703855.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,79 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=703855 1.8 +--> 1.9 +<head> 1.10 + <meta charset="utf-8"> 1.11 + <title>Test for Bug 703855</title> 1.12 + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.13 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 1.14 +</head> 1.15 +<body> 1.16 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=703855">Mozilla Bug 703855</a> 1.17 +<p id="display"></p> 1.18 +<div id="content" style="display: none"> 1.19 + <iframe id="f" src="file_bug703855.html"></iframe> 1.20 +</div> 1.21 +<pre id="test"> 1.22 +<script type="application/javascript"> 1.23 + 1.24 +/** Test for Bug 703855 **/ 1.25 + 1.26 +SimpleTest.waitForExplicitFinish(); 1.27 + 1.28 +var timingAttributes = [ 1.29 + 'connectEnd', 1.30 + 'connectStart', 1.31 + 'domComplete', 1.32 + 'domContentLoadedEventEnd', 1.33 + 'domContentLoadedEventStart', 1.34 + 'domInteractive', 1.35 + 'domLoading', 1.36 + 'domainLookupEnd', 1.37 + 'domainLookupStart', 1.38 + 'fetchStart', 1.39 + 'loadEventEnd', 1.40 + 'loadEventStart', 1.41 + 'navigationStart', 1.42 + 'redirectEnd', 1.43 + 'redirectStart', 1.44 + 'requestStart', 1.45 + 'responseEnd', 1.46 + 'responseStart', 1.47 + 'unloadEventEnd', 1.48 + 'unloadEventStart' 1.49 +]; 1.50 +var originalTiming = {}; 1.51 + 1.52 +function runTest() { 1.53 + var timing = $("f").contentWindow.performance.timing; 1.54 + for (i in timingAttributes) { 1.55 + originalTiming[timingAttributes[i]] = timing[timingAttributes[i]]; 1.56 + } 1.57 + 1.58 + var doc = $("f").contentDocument; 1.59 + doc.open(); 1.60 + doc.write("<!DOCTYPE html>"); 1.61 + doc.close(); 1.62 + 1.63 + SimpleTest.executeSoon(function() { 1.64 + var newTiming = $("f").contentWindow.performance.timing; 1.65 + for (var i in timingAttributes) { 1.66 + is(timing[timingAttributes[i]], originalTiming[timingAttributes[i]], 1.67 + "document.open should not affect value of " + timingAttributes[i]); 1.68 + } 1.69 + SimpleTest.finish(); 1.70 + }); 1.71 +} 1.72 + 1.73 +addLoadEvent(function() { 1.74 + SimpleTest.executeSoon(runTest); 1.75 +}); 1.76 + 1.77 + 1.78 + 1.79 +</script> 1.80 +</pre> 1.81 +</body> 1.82 +</html>