OLD | NEW |
(Empty) | |
| 1 <script src=/resources/testharness.js></script> |
| 2 <script src=/resources/testharnessreport.js></script> |
| 3 <div id=log></div> |
| 4 <script> |
| 5 var log = function() {}, // see comment below |
| 6 p = function() {}, // see comment below |
| 7 fails = ["", "?type=", "?type=x", "?type=x/x"], |
| 8 passes = ["?type=text/javascript", "?type=text/ecmascript", "?type=text/ec
mascript;blah"] |
| 9 |
| 10 // Ideally we'd also check whether the scripts in fact execute, but that would
involve |
| 11 // timers and might get a bit racy without cross-browser support for the execu
te events. |
| 12 |
| 13 fails.forEach(function(urlpart) { |
| 14 async_test(function(t) { |
| 15 var script = document.createElement("script") |
| 16 script.onerror = t.step_func_done(function(){}) |
| 17 script.onload = t.unreached_func("Unexpected load event") |
| 18 script.src = "resources/js.py" + urlpart |
| 19 document.body.appendChild(script) |
| 20 }, "URL query: " + urlpart) |
| 21 }) |
| 22 |
| 23 passes.forEach(function(urlpart) { |
| 24 async_test(function(t) { |
| 25 var script = document.createElement("script") |
| 26 script.onerror = t.unreached_func("Unexpected error event") |
| 27 script.onload = t.step_func_done(function(){}) |
| 28 script.src = "resources/js.py" + urlpart + "&outcome=p" |
| 29 document.body.appendChild(script) |
| 30 }, "URL query: " + urlpart) |
| 31 }) |
| 32 </script> |
OLD | NEW |