Index: third_party/WebKit/LayoutTests/http/tests/payments/payment-app-manager.html |
diff --git a/third_party/WebKit/LayoutTests/http/tests/payments/payment-app-manager.html b/third_party/WebKit/LayoutTests/http/tests/payments/payment-app-manager.html |
index b5cf8505b73653bc8cbc278c797f36f9abe7c420..1eb8a3be9ff33000dfe53628042e8fa2059a1f5f 100644 |
--- a/third_party/WebKit/LayoutTests/http/tests/payments/payment-app-manager.html |
+++ b/third_party/WebKit/LayoutTests/http/tests/payments/payment-app-manager.html |
@@ -21,11 +21,60 @@ promise_test(test => { |
}); |
}) |
.then(result => { |
- unreached_fulfillment(test); |
+ assert_equals(result, undefined); |
}) |
+ .catch(unreached_rejection(test)); |
+ }, 'setManifest() should resolve with undefined if ' |
+ + 'setManifest() is succeeded.'); |
+ |
+promise_test(test => { |
+ var registration; |
+ var script_url = 'resources/empty-worker.js'; |
+ var scope = 'resources/'; |
+ |
+ return service_worker_unregister_and_register(test, script_url, scope) |
+ .then(r => { |
+ registration = r; |
+ return wait_for_state(test, registration.installing, 'installed'); |
+ }) |
+ .then(state => { |
+ assert_equals(state, 'installed'); |
+ return registration.paymentAppManager.setManifest({ |
+ label: 'Payment App' |
+ }); |
+ }) |
+ .then(result => { |
+ assert_equals(result, undefined); |
+ }) |
+ .catch(unreached_rejection(test)); |
+ }, 'If registration has waiting worker, then wait for active worker and ' |
+ + 'then setManifest() is succeeded.'); |
+ |
+promise_test(test => { |
+ var registration; |
+ var script_url = 'resources/empty-worker.js'; |
+ var scope = 'resources/'; |
+ |
+ return service_worker_unregister_and_register(test, script_url, scope) |
+ .then(r => { |
+ registration = r; |
+ registration.unregister(); |
+ return wait_for_state(test, registration.installing, 'redundant'); |
+ }) |
+ .then(state => { |
+ assert_equals(state, 'redundant'); |
+ assert_equals(registration.installing, null); |
+ assert_equals(registration.waiting, null); |
+ assert_equals(registration.active, null); |
+ return registration.paymentAppManager.setManifest({ |
+ label: 'Payment App' |
+ }); |
+ }) |
+ .then(unreached_fulfillment(test)) |
.catch(error => { |
- assert_equals(error.name, 'NotSupportedError'); |
+ assert_equals(error.name, 'InvalidStateError'); |
}); |
- }, 'setManifest() should reject NotSupportedError for now'); |
+ }, 'If registration has no active worker, no waiting worker and ' |
+ + 'no installing worker, then throws InvalidStateError.'); |
</script> |