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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/preload/no_cache_reuse.html

Issue 2174563003: Clear all preloads when document is detached (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix issues inside clearPreloads and add tests Created 4 years, 4 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script>
4 <body>
5 <script>
6 var t = async_test('Test that preloaded non-cacheable resources get reused even after onload');
Charlie Harrison 2016/08/04 18:10:25 Seems like the file name should be "cache_reuse" r
Yoav Weiss 2016/08/04 20:26:14 renamed to memcache_reuse_of_non_cacheable_preload
7 var action;
8
9 var test = t.step_func(function() {
10 var entries = performance.getEntriesByType("resource");
11 var resources = 0;
12 for (var i = 0; i < entries.length; ++i) {
13 if (entries[i].name.indexOf("timestamp") != -1)
14 ++resources;
15 }
16 assert_equals(resources, 1);
17 t.done();
18 });
19
20 var loadTimestampWithXHR = t.step_func(function() {
21 var xhr = new XMLHttpRequest;
22 xhr.withCredentials = true;
23 xhr.open("GET", "resources/timestamp.php");
24 xhr.send();
25 xhr.onload = t.step_func(function() {
26 setTimeout(test, 0);
27 });
28 });
29
30 var loadTimestampWithLink = (function() {
31 var l = document.createElement('link');
32 l.setAttribute('rel', 'preload');
33 l.setAttribute('href', "resources/timestamp.php");
34 l.onload = loadTimestampWithXHR;
35 document.body.appendChild(l);
36 });
37
38 loadTimestampWithLink();
39 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698