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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/linkHeader/resources/iframe-link-headers.php

Issue 2332333003: Make internals.isPreloaded() to remain the same before/after clearPreloads() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: const auto& Created 4 years, 3 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/linkHeader/resources/iframe-link-headers.php
diff --git a/third_party/WebKit/LayoutTests/http/tests/linkHeader/resources/iframe-link-headers.php b/third_party/WebKit/LayoutTests/http/tests/linkHeader/resources/iframe-link-headers.php
index 90f0933940fdb424427bc3a496bb3f5ea75dfae8..dd13745dec328615347670171f83d7a476306d5c 100644
--- a/third_party/WebKit/LayoutTests/http/tests/linkHeader/resources/iframe-link-headers.php
+++ b/third_party/WebKit/LayoutTests/http/tests/linkHeader/resources/iframe-link-headers.php
@@ -2,12 +2,24 @@
header("Link: <http://127.0.0.1:8000/resources/square.png>;rel=preload;as=image;", false);
?>
<!DOCTYPE html>
+<!-- Test that
+ (1) the URL specified in the link header is preloaded, and
+ (2) isPreloaded() returns true before, in, and after document's load event.
+-->
<script>
+function test() {
if (window.internals) {
if (internals.isPreloaded("http://127.0.0.1:8000/resources/square.png"))
top.postMessage("squareloaded", "*");
else
top.postMessage("notloaded", "*");
}
+}
+function onLoad() {
+ test();
+ setTimeout(test, 100);
+}
+test();
</script>
-
+<body onload="onLoad()">
+</body>

Powered by Google App Engine
This is Rietveld 408576698