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

Unified Diff: third_party/WebKit/Source/modules/payments/PaymentRequestTest.cpp

Issue 2250793003: Separate PaymentRequest initialization and display. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update payment-request-mock.js Created 4 years, 4 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/Source/modules/payments/PaymentRequestTest.cpp
diff --git a/third_party/WebKit/Source/modules/payments/PaymentRequestTest.cpp b/third_party/WebKit/Source/modules/payments/PaymentRequestTest.cpp
index 5da645e13c1e9dabea50501c8cb26d63a4b24206..7e8704b3fc3c64fe23293987007ce7ded97f44d9 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentRequestTest.cpp
+++ b/third_party/WebKit/Source/modules/payments/PaymentRequestTest.cpp
@@ -222,6 +222,20 @@ TEST(PaymentRequestTest, CannotCallShowTwice)
request->show(scope.getScriptState()).then(funcs.expectNoCall(), funcs.expectCall());
}
+TEST(PaymentRequestTest, CannotShowAfterAborted)
+{
+ V8TestingScope scope;
+ PaymentRequestMockFunctionScope funcs(scope.getScriptState());
+ makePaymentRequestOriginSecure(scope.document());
+ PaymentRequest* request = PaymentRequest::create(scope.getScriptState(), buildPaymentMethodDataForTest(), buildPaymentDetailsForTest(), scope.getExceptionState());
+ EXPECT_FALSE(scope.getExceptionState().hadException());
+ request->show(scope.getScriptState());
+ request->abort(scope.getScriptState());
+ static_cast<mojom::blink::PaymentRequestClient*>(request)->OnAbort(true);
+
+ request->show(scope.getScriptState()).then(funcs.expectNoCall(), funcs.expectCall());
+}
+
TEST(PaymentRequestTest, RejectShowPromiseOnErrorPaymentMethodNotSupported)
{
V8TestingScope scope;

Powered by Google App Engine
This is Rietveld 408576698