OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../../resources/testharness.js"></script> | 2 <script src="../../resources/testharness.js"></script> |
3 <script src="../../resources/testharnessreport.js"></script> | 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 |
4 <script> | 5 <script> |
5 var t = async_test('Simple scripts that inject external scripts via document.wri
te should be preloaded'); | 6 var t = async_test('Simple scripts that inject external scripts via document.w
rite should be preloaded'); |
6 // We reject scripts with "for", so rename window.performance. | 7 // We reject scripts with "for", so rename window.performance. |
7 window.perf = window.performance; | 8 window.perf = window.performance; |
8 </script> | |
9 <script> | |
10 if (window.perf) | |
11 var boundedStart = window.perf.now(); | |
12 var src = '../../resources/dummy.js'; | |
13 document.write('<scr' + 'ipt src="' + src + '"></scr' + 'ipt>'); | |
14 </script> | |
15 <script> | |
16 window.addEventListener("load", t.step_func(function() { | |
17 window.performance.getEntriesByType('resource').forEach(function(r) { | |
18 if (r.name.indexOf('dummy.js') != -1) { | |
19 assert_less_than(r.startTime, boundedStart); | |
20 assert_greater_than(r.startTime, 0); | |
21 t.done(); | |
22 } | |
23 }); | |
24 })); | |
25 </script> | 9 </script> |
26 | 10 |
| 11 <script> |
| 12 if (window.perf) |
| 13 var boundedStart = window.perf.now(); |
| 14 var src = '../../resources/dummy.js'; |
| 15 document.write('<scr' + 'ipt src="' + src + '"></scr' + 'ipt>'); |
| 16 </script> |
| 17 |
| 18 <script> |
| 19 window.addEventListener("load", t.step_func(function() { |
| 20 window.performance.getEntriesByType('resource').forEach(function(r) { |
| 21 if (r.name.indexOf('dummy.js') != -1) { |
| 22 assert_less_than(r.startTime, boundedStart); |
| 23 assert_greater_than(r.startTime, 0); |
| 24 t.done(); |
| 25 } |
| 26 }); |
| 27 })); |
| 28 </script> |
| 29 |
OLD | NEW |