| Index: LayoutTests/http/tests/htmlimports/import-async-grandchild.html
|
| diff --git a/LayoutTests/http/tests/htmlimports/import-async-grandchild.html b/LayoutTests/http/tests/htmlimports/import-async-grandchild.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..ba8e820bdd529f424de35f8252c5ca22cb6726cc
|
| --- /dev/null
|
| +++ b/LayoutTests/http/tests/htmlimports/import-async-grandchild.html
|
| @@ -0,0 +1,49 @@
|
| +<!DOCTYPE html>
|
| +<html>
|
| +<head>
|
| +<script src="../../../resources/testharness.js"></script>
|
| +<script src="../../../resources/testharnessreport.js"></script>
|
| +<script src="resources/async-block-helper.js"></script>
|
| +<script>
|
| +var test = async_test('With the async attribute, link element don\'t block the script execution of following imports.');
|
| +
|
| +function childReady() {
|
| + test.step(function() {
|
| + assert_true(window.masterScriptExecuted, 'A script in master is executed wihtout waiting slow script.');
|
| + assert_true(isImportLoaded('has-slow-child-async.html'), 'A script (in child) is executed wihtout waiting slow script.');
|
| + assert_false(isImportLoaded('has-slow-script.html'), 'A script in slow aync import has not to be excuted yet.');
|
| + });
|
| +}
|
| +
|
| +function grandchildReady() {
|
| + test.step(function() {
|
| + assert_true(window.masterScriptExecuted, 'A script in master is executed wihtout waiting slow script.');
|
| + assert_true(isImportLoaded('has-slow-child-async.html'), 'A script (in child) is executed wihtout waiting slow script.');
|
| + assert_true(isImportLoaded('has-slow-script.html'), 'A script in slow aync import is eventually exeuted.');
|
| + test.done();
|
| + });
|
| +}
|
| +
|
| +function notifyImportLoaded(name) {
|
| + switch (name) {
|
| + case "has-slow-child-async.html":
|
| + childReady();
|
| + break;
|
| + case "has-slow-script.html":
|
| + grandchildReady();
|
| + break;
|
| + }
|
| +}
|
| +
|
| +</script>
|
| +<link id="asyncLink" async rel="import" href="resources/has-slow-child-async.html">
|
| +<script>
|
| +test.step(function() {
|
| + assert_false(isImportLoaded('has-slow-script.html'), 'A script in async import (in grandchild) has not to be excuted yet.');
|
| + assert_false(isImportLoaded('has-slow-child-async.html'), 'A script in sync import (in child) has not to be excuted yet.');
|
| + window.masterScriptExecuted = true;
|
| +});
|
| +</script>
|
| +</head>
|
| +<body></body>
|
| +</html>
|
|
|