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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/preload/onload_event.html

Issue 1586563014: Add <link rel=preload> onload support for scripts and styles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: oilpan build fixes and review comments Created 4 years, 11 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: third_party/WebKit/LayoutTests/http/tests/preload/onload_event.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/preload/onload_event.html b/third_party/WebKit/LayoutTests/http/tests/preload/onload_event.html
new file mode 100644
index 0000000000000000000000000000000000000000..a221d35ff09be276e9fba3f3e126ed11dce3ab81
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/preload/onload_event.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script>
+ var t = async_test('Makes sure that preloaded resources trigger the onload event');
+ var scriptLoaded = false;
+ var styleLoaded = false;
+</script>
+<link rel=preload href="../resources/dummy.js" as=script onload="scriptLoaded = true;">
+<link rel=preload href="../resources/dummy.css" as=style onload="styleLoaded = true;">
+<script src="../resources/slow-script.pl?delay=500"></script>
+<script>
+ window.onload = t.step(function(){
+ assert_true(window.scriptLoaded, "script triggered load event");
+ assert_true(styleLoaded, "style triggered load event");
+ t.done();
+ });
+</script>
+

Powered by Google App Engine
This is Rietveld 408576698