| Index: third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/opaque-response-in-memorycache-iframe.html
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/opaque-response-in-memorycache-iframe.html b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/opaque-response-in-memorycache-iframe.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..5214b91d66ee189ba35c69c5d11b804dd0d6042a
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/opaque-response-in-memorycache-iframe.html
|
| @@ -0,0 +1,31 @@
|
| +<!DOCTYPE html>
|
| +<meta charset="utf-8">
|
| +<body></body>
|
| +<script>
|
| +function runTest() {
|
| + var l = document.createElement('link');
|
| + l.setAttribute('rel', 'preload');
|
| + l.setAttribute('href', 'opaque-response');
|
| + l.onload = function() {
|
| + xhr = new XMLHttpRequest;
|
| + xhr.withCredentials = true;
|
| + xhr.open('GET', 'opaque-response');
|
| + // opaque-response returns an opaque response from serviceworker and thus
|
| + // the XHR must fail because it is not no-cors request.
|
| + // Particularly, the XHR must not reuse preloaded the opaque response on
|
| + // MemoryCache.
|
| + xhr.onerror = function() {
|
| + parent.done('PASS');
|
| + };
|
| + xhr.onload = function() {
|
| + parent.done('FAIL: ' + xhr.responseText);
|
| + };
|
| + xhr.send();
|
| + };
|
| + l.onerror = function() {
|
| + parent.done('FAIL: preload failed unexpectedly');
|
| + };
|
| + document.body.appendChild(l);
|
| +}
|
| +</script>
|
| +<body onload="setTimeout(runTest, 100)"></body>
|
|
|