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

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

Issue 2785523003: PaymentHandler: Rename PaymentAppManager to PaymentManager. (Closed)
Patch Set: PaymentHandler: Rename PaymentAppManager to PaymentManager. Created 3 years, 9 months 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
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
deleted file mode 100644
index dba3cf6a8ecaf650fa1ed366164040e63356914d..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/http/tests/payments/payment-app-manager.html
+++ /dev/null
@@ -1,219 +0,0 @@
-<!DOCTYPE html>
-<script src="../resources/testharness.js"></script>
-<script src="../resources/testharnessreport.js"></script>
-<script src="../../serviceworker/resources/test-helpers.js"></script>
-<script>
-
-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, 'activated');
- })
- .then(state => {
- assert_equals(state, 'activated');
- return registration.paymentAppManager.setManifest({
- name: 'Payment App',
- icon: 'payment-app-icon',
- options: [{
- name: 'Visa ****',
- icon: 'payment-app-icon',
- id: 'payment-app-id',
- enabledMethods: ['visa']
- }]
- });
- })
- .then(result => {
- 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({
- name: 'Payment App',
- icon: 'payment-app-icon',
- options: [{
- name: 'Visa ****',
- icon: 'payment-app-icon',
- id: 'payment-app-id',
- enabledMethods: ['visa']
- }]
- });
- })
- .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({
- name: 'Payment App',
- icon: 'payment-app-icon',
- options: [{
- name: 'Visa ****',
- icon: 'payment-app-icon',
- id: 'payment-app-id',
- enabledMethods: ['visa']
- }]
- });
- })
- .then(unreached_fulfillment(test))
- .catch(error => {
- assert_equals(error.name, 'InvalidStateError');
- });
- }, 'If registration has no active worker, no waiting worker and '
- + 'no installing worker, then throws InvalidStateError.');
-
-promise_test(test => {
- var registration;
- var script_url = 'resources/empty-worker.js';
- var scope = 'resources/';
- var manifest = {
- name: 'Payment App',
- icon: 'payment-app-icon',
- options: [{
- name: 'Visa ****',
- icon: 'payment-app-icon',
- id: 'payment-app-id',
- enabledMethods: ['visa2']
- }]
- };
-
- return service_worker_unregister_and_register(test, script_url, scope)
- .then(r => {
- registration = r;
- return wait_for_state(test, registration.installing, 'activated');
- })
- .then(state => {
- assert_equals(state, 'activated');
- return registration.paymentAppManager.setManifest(manifest);
- })
- .then(result => {
- assert_equals(result, undefined);
- return registration.paymentAppManager.getManifest();
- })
- .then(read_manifest => {
- assert_object_equals(read_manifest, manifest);
- })
- .catch(unreached_rejection(test));
- }, 'If getManifest() is succeeded, then resolves stored manifest data.');
-
-promise_test(test => {
- var registration;
- var script_url = 'resources/empty-worker.js';
- var scope = 'resources/';
- var manifest = {
- name: 'Payment App',
- icon: 'payment-app-icon',
- options: [{
- name: 'Visa ****',
- icon: 'payment-app-icon',
- id: 'payment-app-id',
- enabledMethods: ['visa2']
- }]
- };
-
- return service_worker_unregister_and_register(test, script_url, scope)
- .then(r => {
- registration = r;
- return wait_for_state(test, registration.installing, 'activated');
- })
- .then(state => {
- assert_equals(state, 'activated');
- return registration.paymentAppManager.setManifest(manifest);
- })
- .then(result => {
- assert_equals(result, undefined);
- return registration.unregister();
- })
- .then(result => {
- assert_equals(result, true);
- return registration.paymentAppManager.getManifest();
- })
- .then(unreached_fulfillment(test))
- .catch(error => {
- assert_equals(error.name, 'AbortError');
- });
- }, 'If service worker is unregistered, then manifest is cleared as well.');
-
-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, 'activated');
- })
- .then(state => {
- assert_equals(state, 'activated');
- return registration.paymentAppManager.getManifest();
- })
- .then(unreached_fulfillment(test))
- .catch(error => {
- assert_equals(error.name, 'AbortError');
- });
- }, 'If there is no manifest data, then throws AbortError.');
-
-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, 'activated');
- })
- .then(state => {
- assert_equals(state, 'activated');
- return registration.paymentAppManager.setManifest({
- name: 'Payment App',
- icon: 'payment-app-icon',
- options: [{
- name: 'Visa ****',
- icon: 'payment-app-icon',
- id: 'payment-app-id'
- }]
- });
- })
- .catch(unreached_rejection(test));
- }, 'enabled_methods of PaymentAppOption is not required member. '
- + 'so this test should be pass.');
-
-</script>

Powered by Google App Engine
This is Rietveld 408576698