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

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

Issue 1615703002: Removal of rel=preload link elements should stop the download. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added back clear() 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/dynamic_removing_preload.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/preload/dynamic_adding_preload.html b/third_party/WebKit/LayoutTests/http/tests/preload/dynamic_removing_preload.html
similarity index 62%
copy from third_party/WebKit/LayoutTests/http/tests/preload/dynamic_adding_preload.html
copy to third_party/WebKit/LayoutTests/http/tests/preload/dynamic_removing_preload.html
index 5d07d5d906ed002613271288fd27b7b1aef80c90..5c6774b923fa5a35cdbb5ef2a8550461c6c44a95 100644
--- a/third_party/WebKit/LayoutTests/http/tests/preload/dynamic_adding_preload.html
+++ b/third_party/WebKit/LayoutTests/http/tests/preload/dynamic_removing_preload.html
@@ -2,7 +2,7 @@
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script>
- var t = async_test('Makes sure that dynamically added preloaded resource is downloaded');
+ var t = async_test('Makes sure that dynamically removed preloaded resource stop downloading');
</script>
<body>
<script>
@@ -10,10 +10,12 @@
link.as = "script";
link.rel = "preload";
link.href = "../resources/dummy.js";
- link.onload = t.step_func(function() {
+ document.body.appendChild(link);
+ document.body.removeChild(link);
+ window.addEventListener("load", t.step_func(function() {
assert_equals(performance.getEntriesByType("resource").length, 3);
t.done();
- });
- document.body.appendChild(link);
+ }));
</script>
+<script src="../resources/slow-script.pl?delay=200"></script>
</body>

Powered by Google App Engine
This is Rietveld 408576698