| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <script src="/js-test-resources/js-test.js"></script> | |
| 3 <script> | |
| 4 description("Resource-Freshness header is sent when a revalidation request is in
itiated by the Blink memory cache within the stale-while-revalidate window."); | |
| 5 | |
| 6 var resourceFreshnessHeader; | |
| 7 function report(value) { | |
| 8 resourceFreshnessHeader = value; | |
| 9 } | |
| 10 | |
| 11 window.jsTestIsAsync = true; | |
| 12 | |
| 13 window.onload = function () { | |
| 14 // We set the timeout to 500 msec here because we expect age=1 in the | |
| 15 // ResourceFreshness header if the age is [0.5, 1.5) seconds. | |
| 16 setTimeout( | |
| 17 function() { | |
| 18 var script = document.createElement("script"); | |
| 19 script.src = "resources/stale-while-revalidate.php"; | |
| 20 script.onload = function() { | |
| 21 shouldBeEqualToString( | |
| 22 'resourceFreshnessHeader', | |
| 23 'max-age=0,stale-while-revalidate=1,age=1'); | |
| 24 finishJSTest(); | |
| 25 }; | |
| 26 document.body.appendChild(script); | |
| 27 }, | |
| 28 500); | |
| 29 }; | |
| 30 </script> | |
| 31 <script src="resources/stale-while-revalidate.php"></script> | |
| OLD | NEW |