| OLD | NEW |
| (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 resources get evicted from MemoryCache when preloa
d is not used'); |
| 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 writeAndReload = t.step_func(function(text) { |
| 19 sessionStorage.timestamp = text; |
| 20 document.location.reload(true); |
| 21 }); |
| 22 |
| 23 var compare = t.step_func(function(text) { |
| 24 assert_true(sessionStorage.timestamp != text); |
| 25 t.done(); |
| 26 }); |
| 27 |
| 28 if (!sessionStorage.timestamp) { |
| 29 action = writeAndReload; |
| 30 } else { |
| 31 action = compare; |
| 32 } |
| 33 loadTimestampWithXHR(); |
| 34 </script> |
| OLD | NEW |