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.

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

mercurial