Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <script src="../../resources/testharness.js"></script> | |
| 3 <script src="../../resources/testharnessreport.js"></script> | |
| 4 <script> | |
| 5 var t = async_test('Simple scripts that inject external scripts via document.wri te should be preloaded'); | |
| 6 // We reject scripts with "for", so rename window.performance. | |
| 7 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); | |
|
jkarlin
2016/04/08 16:27:43
Can this test flake? What guarantee is there that
Charlie Harrison
2016/04/08 16:33:34
I guess not a hard guarantee, but the html parser
jkarlin
2016/04/08 16:45:42
Seems fine as is until troubles arise, the flakine
| |
| 20 assert_greater_than(r.startTime, 0); | |
| 21 t.done(); | |
| 22 } | |
| 23 }); | |
| 24 })); | |
| 25 </script> | |
| 26 | |
| OLD | NEW |