content/base/test/file_bug503481b_inner.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>
     3 <head>
     4 <!-- Async script that isn't preloaded -->
     5 <script async src="file_bug503481.sjs?blockOn=R&body=runFirst();"></script>
     6 <script>
     7 firstRan = false;
     8 secondRan = false;
     9 thirdRan = false;
    10 forthRan = false;
    11 function runFirst() {
    12   firstRan = true;
    13 }
    14 function runThird() {
    15   parent.is(forthRan, false, "forth should still be blocked");
    16   unblock("T");
    17   thirdRan = true;
    18 }
    19 function runForth() {
    20   forthRan = true;
    21 }
    23 function done() {
    24   parent.is(firstRan, true, "first should have run by onload");
    25   parent.is(secondRan, true, "second should have run by onload");
    26   parent.is(thirdRan, true, "third should have run by onload");
    27   parent.is(forthRan, true, "forth should have run by onload");
    28   parent.SimpleTest.finish();
    29 }
    31 var reqs = [];
    32 function unblock(s) {
    33   xhr = new XMLHttpRequest();
    34   xhr.open("GET", "file_bug503481.sjs?unblock=" + s);
    35   xhr.send();
    36   reqs.push(xhr);
    37 }
    40 parent.is(firstRan, false, "First async script shouldn't have run");
    41 unblock("R");
    42 </script>
    44 <!-- test that inline async isn't actually async -->
    45 <script async>
    46 secondRan = true;
    47 </script>
    48 <script>
    49 parent.is(secondRan, true, "Second script shouldn't be async");
    50 </script>
    52 <!-- test that setting both defer and async treats the script as async -->
    53 <script defer async src="file_bug503481.sjs?blockOn=S&body=runThird();"></script>
    54 <script>
    55 parent.is(thirdRan, false, "third should not have run yet");
    56 unblock("S");
    57 </script>
    58 <script src="file_bug503481.sjs?blockOn=T&body=runForth();"></script>
    60 </head>
    62 <body onload="done()">

mercurial