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

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

Issue 2174563003: Clear all preloads when document is detached (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/preload/memcache_eviction_nopreload.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 <body>
5 <script>
6 var t = async_test('Test that preloaded resources get evicted from MemoryCache') ;
7 var action;
8 var loadTimestampWithXHR = t.step_func(function() {
9 var xhr = new XMLHttpRequest;
10 xhr.withCredentials = true;
11 xhr.open("GET", "resources/timestamp.php");
12 xhr.send();
13 xhr.onload = function() {
14 action(xhr.responseText);
15 };
16 });
17
18 var loadTimestampWithLink = t.step_func(function() {
19 var l = document.createElement('link');
20 l.setAttribute('rel', 'preload');
21 l.setAttribute('href', "resources/timestamp.php");
22 l.onload = loadTimestampWithXHR;
23 document.body.appendChild(l);
24 });
25
26 var writeAndReload = t.step_func(function(text) {
27 sessionStorage.timestamp = text;
28 document.location.reload(true);
29 });
30
31 var compare = t.step_func(function(text) {
32 assert_true(sessionStorage.timestamp != text);
33 t.done();
34 });
35
36 if (!sessionStorage.timestamp) {
37 action = writeAndReload;
38 } else {
39 action = compare;
40 }
41 loadTimestampWithLink();
42 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/preload/memcache_eviction_nopreload.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698