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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/prefetch/prefetch_added_after_onload.html

Issue 2751973005: Link prefetch fetches deferred until onload
Patch Set: Fixed post onload addition and crash Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/prefetch/prefetch_deferred_after_onload.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script>
4 <script>
5 var t = async_test('Makes sure that prefetched resources are downloaded when added after window.onload fired.');
6 </script>
7 <body>
8 <script>
9 function loadedPrefetch() {
10 var entries = performance.getEntriesByType("resource");
11 for (var i = 0; i < entries.length; ++i) {
12 if (entries[i].name.indexOf("prefetch") != -1)
13 return true;
14 }
15 return false;
16 }
17 window.addEventListener("load", t.step_func(function() {
18 var link = document.createElement("link");
19 link.rel = "prefetch";
20 link.href = "../resources/slow-script.pl?delay=100;prefetch";
21 document.body.appendChild(link);
22 var loaded = loadedPrefetch();
23 assert_false(loaded);
24 t.step_timeout(function() {
25 assert_true(loadedPrefetch());
26 t.done();
27 }, 400);
28 }));
29 </script>
30 </body>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/prefetch/prefetch_deferred_after_onload.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698