Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Unified Diff: third_party/WebKit/LayoutTests/http/tests/payments/payment-app-manager.html

Issue 2497983002: PaymentApp: Implement PaymentAppManager.setManifest(). (Closed)
Patch Set: rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/test/BUILD.gn ('k') | third_party/WebKit/Source/modules/payments/PaymentAppManager.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « content/test/BUILD.gn ('k') | third_party/WebKit/Source/modules/payments/PaymentAppManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698