Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing done() in payment-handler/can-make-payment-event-construc… #11272

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions payment-handler/can-make-payment-event-constructor.https.worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,24 @@ test(() => {
assert_false('CanMakePaymentEvent' in self);
}, 'CanMakePaymentEvent constructor must not be exposed in worker');

test(() => {
const ev = new CanMakePaymentEvent('test', {
topOrigin: 'https://foo.com',
paymentRequestOrigin: 'https://bar.com',
methodData: [],
modifiers: [],
});
assert_false(ev.isTrusted, 'constructed in script, so not be trusted');
assert_equals(ev.topOrigin, 'https://foo.com');
assert_equals(ev.paymentRequestOrigin, 'https://bar.com');
}, 'CanMakePaymentEvent can be constructed with a CanMakePaymentEventInit, even if not trusted');

test(() => {
const ev = new CanMakePaymentEvent('test');
self.addEventListener('test', evt => {
assert_equals(ev, evt);
});
self.dispatchEvent(ev);
}, 'CanMakePaymentEvent can be dispatched, even if not trusted');

done();