Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Unified Diff: LayoutTests/http/tests/htmlimports/import-async-grandchild-not-child.html

Issue 251813006: HTML Imports: Let @async import not block its sibling. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/htmlimports/import-async-grandchild-not-child.html
diff --git a/LayoutTests/http/tests/htmlimports/import-async-grandchild-not-child.html b/LayoutTests/http/tests/htmlimports/import-async-grandchild-not-child.html
new file mode 100644
index 0000000000000000000000000000000000000000..31c2f9ccf012bbd40c997ca3ef63ceb920b2738b
--- /dev/null
+++ b/LayoutTests/http/tests/htmlimports/import-async-grandchild-not-child.html
@@ -0,0 +1,35 @@
+<!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 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) {
+ if (name == "has-slow-script.html")
+ grandchildReady();
+}
+
+</script>
+<link id="asyncLink" 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_true(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>

Powered by Google App Engine
This is Rietveld 408576698