| Index: third_party/WebKit/LayoutTests/http/tests/payments/payment-manager.html
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/payments/payment-manager.html b/third_party/WebKit/LayoutTests/http/tests/payments/payment-manager.html
|
| deleted file mode 100644
|
| index e2676cab38df3d96a86afcaad2801d3423dced03..0000000000000000000000000000000000000000
|
| --- a/third_party/WebKit/LayoutTests/http/tests/payments/payment-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.paymentManager.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.paymentManager.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.paymentManager.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.paymentManager.setManifest(manifest);
|
| - })
|
| - .then(result => {
|
| - assert_equals(result, undefined);
|
| - return registration.paymentManager.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.paymentManager.setManifest(manifest);
|
| - })
|
| - .then(result => {
|
| - assert_equals(result, undefined);
|
| - return registration.unregister();
|
| - })
|
| - .then(result => {
|
| - assert_equals(result, true);
|
| - return registration.paymentManager.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.paymentManager.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.paymentManager.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>
|
|
|