Chromium Code Reviews| Index: content/test/data/service_worker/fetch_cross_origin.html |
| diff --git a/content/test/data/service_worker/fetch_cross_origin.html b/content/test/data/service_worker/fetch_cross_origin.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..baa0c285a587072d6a8486d15e0aa0e848cc6db8 |
| --- /dev/null |
| +++ b/content/test/data/service_worker/fetch_cross_origin.html |
| @@ -0,0 +1,21 @@ |
| +<!DOCTYPE html> |
| +<html> |
| +<head> |
| +<title>INITIAL</title> |
| +<script> |
| +var queryString = location.search; |
| + |
| +if (queryString && queryString.charAt(0) === '?') { |
| + // Fetches the URL provided in query string with a custom header. |
| + fetch(queryString.substring(1), |
| + {headers: {'X-Custom-Header': 'foo'}}).then(function(data) { |
| + data.text().then(function(text) { |
| + document.title = text; |
| + }); |
|
falken
2016/04/06 04:41:36
nit: Service worker test code likes to chain promi
Raj
2016/04/06 05:08:42
Done. Nice.
|
| + }).catch(function() { |
| + document.title = "FAIL"; |
|
falken
2016/04/06 04:41:36
Use single-quotes for consistency.
Raj
2016/04/06 05:08:42
Done.
|
| + }); |
| +} |
| +</script> |
| +</head> |
| +</html> |