OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <script src="../../../resources/testharness.js"></script> |
| 5 <script src="../../../resources/testharnessreport.js"></script> |
| 6 <script src="resources/async-block-helper.js"></script> |
| 7 <script> |
| 8 var test = async_test('With the async attribute, link element don\'t block the s
cript execution of following imports.'); |
| 9 |
| 10 function grandchildReady() { |
| 11 test.step(function() { |
| 12 assert_true(window.masterScriptExecuted, 'A script in master is executed
wihtout waiting slow script.'); |
| 13 assert_true(isImportLoaded('has-slow-child-async.html'), 'A script (in c
hild) is executed wihtout waiting slow script.'); |
| 14 assert_true(isImportLoaded('has-slow-script.html'), 'A script in slow ay
nc import is eventually exeuted.'); |
| 15 test.done(); |
| 16 }); |
| 17 } |
| 18 |
| 19 function notifyImportLoaded(name) { |
| 20 if (name == "has-slow-script.html") |
| 21 grandchildReady(); |
| 22 } |
| 23 |
| 24 </script> |
| 25 <link id="asyncLink" rel="import" href="resources/has-slow-child-async.html"> |
| 26 <script> |
| 27 test.step(function() { |
| 28 assert_false(isImportLoaded('has-slow-script.html'), 'A script in async impo
rt (in grandchild) has not to be excuted yet.'); |
| 29 assert_true(isImportLoaded('has-slow-child-async.html'), 'A script in sync i
mport (in child) has not to be excuted yet.'); |
| 30 window.masterScriptExecuted = true; |
| 31 }); |
| 32 </script> |
| 33 </head> |
| 34 <body></body> |
| 35 </html> |
OLD | NEW |