Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/http/tests/preload/memcache_eviction_nopreload.html |
| diff --git a/third_party/WebKit/LayoutTests/http/tests/preload/memcache_eviction_nopreload.html b/third_party/WebKit/LayoutTests/http/tests/preload/memcache_eviction_nopreload.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..74690153b5c0e5f722eaa8278c6e8cccf5f8bbc8 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/http/tests/preload/memcache_eviction_nopreload.html |
| @@ -0,0 +1,34 @@ |
| +<!DOCTYPE html> |
| +<script src="../resources/testharness.js"></script> |
| +<script src="../resources/testharnessreport.js"></script> |
| +<body> |
| +<script> |
| +var t = async_test('Test that preloaded resources get evicted from MemoryCache when preload is not used'); |
|
Charlie Harrison
2016/08/04 18:10:25
Update text here (no preloads).
Yoav Weiss
2016/08/04 20:26:14
done
|
| +var action; |
| +var loadTimestampWithXHR = t.step_func(function() { |
| + var xhr = new XMLHttpRequest; |
| + xhr.withCredentials = true; |
| + xhr.open("GET", "resources/timestamp.php"); |
| + xhr.send(); |
| + xhr.onload = function() { |
| + action(xhr.responseText); |
| + }; |
| +}); |
| + |
| +var writeAndReload = t.step_func(function(text) { |
| + sessionStorage.timestamp = text; |
| + document.location.reload(true); |
| +}); |
| + |
| +var compare = t.step_func(function(text) { |
| + assert_true(sessionStorage.timestamp != text); |
| + t.done(); |
| +}); |
| + |
| +if (!sessionStorage.timestamp) { |
| + action = writeAndReload; |
| +} else { |
| + action = compare; |
| +} |
| +loadTimestampWithXHR(); |
| +</script> |