Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/fetch.js |
| diff --git a/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/fetch.js b/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/fetch.js |
| index 1e9a77232b7510dcd0d513c4bb36f973f8ddfbae..17980297edad59ae469f191c5904104efcee4e61 100644 |
| --- a/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/fetch.js |
| +++ b/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/fetch.js |
| @@ -58,30 +58,33 @@ promise_test(function(t) { |
| function() {}); |
| }, 'fetch invalid data: URL'); |
| -// Tests for blob: scheme. |
| -promise_test(function(t) { |
| - var url = URL.createObjectURL(new Blob(['fox'], {type: 'text/fox'})); |
| - return fetch(url) |
| - .then(function(response) { |
| - assert_equals(response.status, 200); |
| - assert_equals(response.statusText, 'OK'); |
| - assert_equals(response.headers.get('Content-Type'), 'text/fox'); |
| - assert_equals(response.headers.get('Content-Length'), '3'); |
| - assert_equals(size(response.headers), 2); |
| - return response.text(); |
| +// Only [Exposed=(Window,DedicatedWorker,SharedWorker)]. |
| +if ('createObjectURL' in URL) { |
| + // Tests for blob: scheme. |
| + promise_test(function(t) { |
| + var url = URL.createObjectURL(new Blob(['fox'], {type: 'text/fox'})); |
| + return fetch(url) |
| + .then(function(response) { |
| + assert_equals(response.status, 200); |
| + assert_equals(response.statusText, 'OK'); |
| + assert_equals(response.headers.get('Content-Type'), 'text/fox'); |
| + assert_equals(response.headers.get('Content-Length'), '3'); |
| + assert_equals(size(response.headers), 2); |
| + return response.text(); |
| }) |
| - .then(function(text) { |
| - assert_equals(text, 'fox'); |
| + .then(function(text) { |
| + assert_equals(text, 'fox'); |
| }); |
|
yhirano
2016/05/11 01:54:05
+indent
jsbell
2016/05/11 21:52:41
Done.
|
| }, 'fetch blob: URL'); |
|
yhirano
2016/05/11 01:54:04
+indent
jsbell
2016/05/11 21:52:41
Done.
|
| -promise_test(function(t) { |
| - var url = URL.createObjectURL(new Blob(['fox'], {type: 'text/fox'})); |
| - return fetch(url + 'invalid') |
| - .then( |
| - t.unreached_func('fetching non-existent blob: URL must fail'), |
| - function() {}); |
| + promise_test(function(t) { |
| + var url = URL.createObjectURL(new Blob(['fox'], {type: 'text/fox'})); |
| + return fetch(url + 'invalid') |
| + .then( |
| + t.unreached_func('fetching non-existent blob: URL must fail'), |
|
yhirano
2016/05/11 01:54:05
-indent
jsbell
2016/05/11 21:52:41
Done.
|
| + function() {}); |
|
yhirano
2016/05/11 01:54:05
-indent
jsbell
2016/05/11 21:52:41
Done.
|
| }, 'fetch non-existent blob: URL'); |
|
yhirano
2016/05/11 01:54:05
+indent
jsbell
2016/05/11 21:52:41
Done.
|
| +} |
| // https://fetch.spec.whatwg.org/#concept-basic-fetch |
| // The last statement: |