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

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

Issue 1615803004: Avoid double download for late discovered link preload resources. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Document.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/preload/single_download_late_used_preload.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/preload/single_download_late_used_preload.html b/third_party/WebKit/LayoutTests/http/tests/preload/single_download_late_used_preload.html
new file mode 100644
index 0000000000000000000000000000000000000000..7c8faf1f5fb9986d4c91f2d671917a6fa2a2a2ee
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/preload/single_download_late_used_preload.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 are not downloaded again when used');
+</script>
+<div id=result></div>
+<link rel=preload href="../resources/square.png" as=image>
+<script>
+ window.addEventListener("load", t.step_func(function() {
+ setTimeout(t.step_func(function() {
+ document.getElementById("result").innerHTML = "<image src='../resources/square.png'>";
+ setTimeout(t.step_func(function() {
+ assert_equals(performance.getEntriesByType("resource").length, 3);
+ t.done();
+ }), 400);
+ }), 400);
+ }));
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698