| Index: third_party/WebKit/LayoutTests/http/tests/worklet/resources/import-tests.js
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/worklet/resources/import-tests.js b/third_party/WebKit/LayoutTests/http/tests/worklet/resources/import-tests.js
|
| index 90bd4e98fe0ab8be0987090160e477595b3798e5..ea341b8af574d8e90d10294c4b4cea8199da1134 100644
|
| --- a/third_party/WebKit/LayoutTests/http/tests/worklet/resources/import-tests.js
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/worklet/resources/import-tests.js
|
| @@ -8,39 +8,38 @@ function runImportTests(worklet, opt_path) {
|
| promise_test(function() {
|
| return worklet.import(path + 'resources/empty-worklet-script.js').then(function(undefined_arg) {
|
| assert_equals(undefined_arg, undefined, 'Promise should resolve with no arguments.');
|
| - }).catch(function(error) {
|
| - assert_unreached('unexpected rejection: ' + error);
|
| });
|
| -
|
| }, 'Importing a script resolves the given promise.');
|
|
|
| promise_test(function() {
|
| + return Promise.all([
|
| + worklet.import(path + 'resources/empty-worklet-script.js?1'),
|
| + worklet.import(path + 'resources/empty-worklet-script.js?2'),
|
| + worklet.import(path + 'resources/empty-worklet-script.js?3')
|
| + ]).then(function(undefined_args) {
|
| + assert_array_equals(undefined_args, [undefined, undefined, undefined], 'Promise should resolve with no arguments.');
|
| + });
|
| + }, 'Importing scripts resolves all the given promises.');
|
|
|
| + promise_test(function() {
|
| return worklet.import(path + 'resources/throwing-worklet-script.js').then(function(undefined_arg) {
|
| assert_equals(undefined_arg, undefined, 'Promise should resolve with no arguments.');
|
| - }).catch(function(error) {
|
| - assert_unreached('unexpected rejection: ' + error);
|
| });
|
| -
|
| }, 'Importing a script which throws should still resolve the given promise.');
|
|
|
| promise_test(function() {
|
| -
|
| return worklet.import(path + 'non-existant-worklet-script.js').then(function() {
|
| assert_unreached('import should fail.');
|
| }).catch(function(error) {
|
| assert_equals(error.name, 'NetworkError', 'error should be a NetworkError.');
|
| });
|
| -
|
| }, 'Importing a non-existant script rejects the given promise with a NetworkError.');
|
|
|
| promise_test(function() {
|
| -
|
| return worklet.import('http://invalid:123$').then(function() {
|
| assert_unreached('import should fail.');
|
| }).catch(function(error) {
|
| assert_equals(error.name, 'SyntaxError', 'error should be a SyntaxError.');
|
| });
|
| -
|
| }, 'Attempting to resolve an invalid URL should reject the given promise with a SyntaxError.');
|
| }
|
|
|