Files
tubestation/testing/web-platform/tests/payment-handler/idlharness.https.any.js
Rouslan Solomakhin 51892028f2 Bug 1811677 [wpt PR 38096] - [Web Payment] Disable PaymentInstruments, a=testonly
Automatic update from web-platform-tests
[Web Payment] Disable PaymentInstruments

This patch disables the PaymentInstruments API
(paymentManager.instruments) and removes IDL harness expectations for
it. It does not, however, remove the feature code itself, as that will
be a separate patch.

Intent to deprecate and remove:
https://groups.google.com/a/chromium.org/g/blink-dev/c/VenSGqBIoKI/m/HGyofbCGCAAJ

Chrome status:
https://chromestatus.com/feature/5099285054488576

Bug: 1327265
Change-Id: I32e9bdb65648d145ccde4ed71a2e49b47fee77ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4067199
Commit-Queue: Rouslan Solomakhin <rouslan@chromium.org>
Reviewed-by: Nate Fischer <ntfschr@chromium.org>
Reviewed-by: Rick Byers <rbyers@chromium.org>
Reviewed-by: Stephen McGruer <smcgruer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1096753}

--

wpt-commits: 57eddd90aedeb6f83a7373571fa5d7a163f0534d
wpt-pr: 38096
2023-02-01 14:00:09 +00:00

46 lines
1.4 KiB
JavaScript

// META: global=window,worker
// META: script=/resources/WebIDLParser.js
// META: script=/resources/idlharness.js
// META: script=/service-workers/service-worker/resources/test-helpers.sub.js
// META: timeout=long
'use strict';
// https://w3c.github.io/payment-handler/
idl_test(
['payment-handler'],
['service-workers', 'html', 'dom'],
async (idl_array, t) => {
const isWindow = self.GLOBAL.isWindow();
const isServiceWorker = 'ServiceWorkerGlobalScope' in self;
const hasRegistration = isServiceWorker || isWindow;
if (hasRegistration) {
idl_array.add_objects({
ServiceWorkerRegistration: ['registration'],
PaymentManager: ['paymentManager'],
});
}
if (isServiceWorker) {
idl_array.add_objects({
ServiceWorkerGlobalScope: ['self'],
CanMakePaymentEvent: ['new CanMakePaymentEvent("type")'],
PaymentRequestEvent: ['new PaymentRequestEvent("type")'],
})
}
if (isWindow) {
const scope = '/service-workers/service-worker/resources/';
const reg = await service_worker_unregister_and_register(
t, '/service-workers/service-worker/resources/empty-worker.js', scope);
self.registration = reg;
await wait_for_state(t, reg.installing, "activated");
add_completion_callback(() => reg.unregister());
}
if (hasRegistration) {
self.paymentManager = self.registration.paymentManager;
}
}
);