Commit 1c8a2631 authored by Jinho Bang's avatar Jinho Bang Committed by Commit Bot

PaymentRequest: Add [Exposed=Window] to the PaymentRequest API

There is no behavior change but add a test to check it.

Bug: none
Change-Id: I883fd6eb5f848c7416b810460c182c7509d6c35c
Reviewed-on: https://chromium-review.googlesource.com/818595Reviewed-by: default avatarRouslan Solomakhin <rouslan@chromium.org>
Commit-Queue: Jinho Bang <jinho.bang@samsung.com>
Cr-Commit-Position: refs/heads/master@{#523440}
parent f1d24cab
importScripts("/resources/testharness.js");
test(function() {
assert_true(isSecureContext);
assert_false('PaymentRequest' in self);
assert_false('PaymentRequestUpdateEvent' in self);
assert_false('PaymentResponse' in self);
assert_false('PaymentAddress' in self);
}, "PaymentRequest constructor must not be exposed in worker global scope");
done();
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
// https://w3c.github.io/browser-payment-api/#paymentaddress-interface // https://w3c.github.io/browser-payment-api/#paymentaddress-interface
[ [
RuntimeEnabled=PaymentRequest RuntimeEnabled=PaymentRequest,
Exposed=Window
] interface PaymentAddress { ] interface PaymentAddress {
serializer = {attribute}; serializer = {attribute};
readonly attribute DOMString country; readonly attribute DOMString country;
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
Constructor(sequence<PaymentMethodData> methodData, PaymentDetailsInit details, optional PaymentOptions options), Constructor(sequence<PaymentMethodData> methodData, PaymentDetailsInit details, optional PaymentOptions options),
ConstructorCallWith=ExecutionContext, ConstructorCallWith=ExecutionContext,
RaisesException=Constructor, RaisesException=Constructor,
Exposed=Window,
ActiveScriptWrappable ActiveScriptWrappable
] interface PaymentRequest : EventTarget { ] interface PaymentRequest : EventTarget {
[CallWith=ScriptState] Promise<PaymentResponse> show(); [CallWith=ScriptState] Promise<PaymentResponse> show();
......
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
[ [
RuntimeEnabled=PaymentRequest, RuntimeEnabled=PaymentRequest,
Constructor(DOMString type, optional PaymentRequestUpdateEventInit eventInitDict), Constructor(DOMString type, optional PaymentRequestUpdateEventInit eventInitDict),
ConstructorCallWith=ExecutionContext ConstructorCallWith=ExecutionContext,
Exposed=Window
] interface PaymentRequestUpdateEvent : Event { ] interface PaymentRequestUpdateEvent : Event {
[CallWith=ScriptState,RaisesException] void updateWith(Promise<PaymentDetailsUpdate> detailsPromise); [CallWith=ScriptState,RaisesException] void updateWith(Promise<PaymentDetailsUpdate> detailsPromise);
}; };
...@@ -13,7 +13,8 @@ enum PaymentComplete { ...@@ -13,7 +13,8 @@ enum PaymentComplete {
// https://w3c.github.io/browser-payment-api/#paymentresponse-interface // https://w3c.github.io/browser-payment-api/#paymentresponse-interface
[ [
RuntimeEnabled=PaymentRequest RuntimeEnabled=PaymentRequest,
Exposed=Window
] interface PaymentResponse { ] interface PaymentResponse {
serializer = {attribute}; serializer = {attribute};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment