Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / http / tests / htmlimports / import-async-sync-grandchild.html
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('Even with the async attribute, its subimports are loaded in order.');
9
10 function childReady() {
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-script.html'), 'A script in async import (in grandchild) has not to be excuted yet.');
14         assert_true(isImportLoaded('not-slow.html'), 'A script in async import (in grandchild) has not to be excuted yet.');
15         assert_true(isImportLoaded('has-sync-children.html'), 'A script in sync import (in child) has not to be excuted yet.');
16         test.done();
17     });
18 }
19
20 </script>
21 <link id="asyncLink" async rel="import" href="resources/has-sync-children.html" onload="childReady()">
22 <script>
23 test.step(function() {
24     assert_false(isImportLoaded('has-slow-script.html'), 'A script in async import (in grandchild) has not to be excuted yet.');
25     assert_false(isImportLoaded('has-sync-children.html'), 'A script in sync import (in child) has not to be excuted yet.');
26     window.masterScriptExecuted = true;
27 });
28 </script>
29 </head>
30 <body></body>
31 </html>