Index: chrome/test/data/prerender/prefetch_page.html |
diff --git a/chrome/test/data/prerender/prefetch_page.html b/chrome/test/data/prerender/prefetch_page.html |
index 9009fb41801f6397af23d22454c7f1e091995b37..311f9f1ffb2e89772e0195e0ace8ee9b822c4101 100644 |
--- a/chrome/test/data/prerender/prefetch_page.html |
+++ b/chrome/test/data/prerender/prefetch_page.html |
@@ -1,20 +1,25 @@ |
<html> |
<!-- |
-Prefetch page which fetches a script. It includes some javascript that can be |
-used to test whether execution occurred. |
---> |
-<head> |
-<title>Prefetch Page</title> |
-<script src="prefetch.js" type="text/javascript"></script> |
+A page that fetches only "prefetch.js" when scanned by NoStatePrefetch, and |
+fetches "prefetch2.js" in addition to that if javascript execution is preformed |
+on the page. In all cases the scripts are executed in a blocking manner. |
-<script> |
-// Variables to test if javascript is executed. |
-var pageBool = true; |
-var pageAntiBool = false; |
-</script> |
+By prefetching this page a browsertest can verify that javascript was not |
+executed (prefetch2.js should not be requested to load even after the page has |
+been fully prefetched (or loaded)). |
-</head> |
+Note: there is no way to ensure that the script loaded via .appendChild() or a |
+sync XHR happens before a preload-scannable request because preload scanner is |
+racy and often fetches resources it sees before the inline script has a chance |
+to execute. |
+--> |
<body> |
-Page content that is necessary for first contentful paint metrics |
+ <script src="prefetch.js"></script> |
+ <script> |
+ var s = document.createElement("script"); |
+ s.src = "prefetch2.js"; |
+ document.body.appendChild(s); |
+ </script> |
+ Some content that is necessary for registering paint metrics. |
</body> |
</html> |