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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/prefetch/link_header_prefetch.php

Issue 2602233002: Prefetch Link header support. (Closed)
Patch Set: Test based of perfObserver Created 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/LinkLoader.h » ('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 <?php
2 header("Link: <http://127.0.0.1:8000/resources/square.png>;rel=prefetch",
3 false);
4 ?>
5 <!DOCTYPE html>
6 <html>
7 <head></head>
8 <body>
9 <script src="/resources/testharness.js"></script>
10 <script src="/resources/testharnessreport.js"></script>
11 <script>
12 var observer = new PerformanceObserver(function(list) {
13 list.getEntries().forEach(function(entry) {
14 if (entry.name.indexOf("square.png") != -1) {
15 // If we found a resource timing entry of the prefetched image,
16 // the test passes.
17 t.done();
18 }
19 });
20 });
21 observer.observe({entryTypes: ["resource"]});
22 var t = async_test('Makes sure that Link headers prefetch resources');
23 </script>
24 <script>
25 window.addEventListener("load", t.step_func(function() {
26 var entries =
27 performance.getEntriesByName(
28 "http://127.0.0.1:8000/resources/square.png");
29 if (entries.length) {
30 assert_equals(entries.length, 1);
31 t.done();
32 }
33 }));
34 </script>
35 </body>
36 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/LinkLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698