Index: third_party/WebKit/Source/modules/payments/CanMakePaymentTest.cpp |
diff --git a/third_party/WebKit/Source/modules/payments/ActivePaymentTest.cpp b/third_party/WebKit/Source/modules/payments/CanMakePaymentTest.cpp |
similarity index 72% |
rename from third_party/WebKit/Source/modules/payments/ActivePaymentTest.cpp |
rename to third_party/WebKit/Source/modules/payments/CanMakePaymentTest.cpp |
index 1ba83170598086cf80759c9925bc8eaf3647c602..74362feac5d68e6ce3795a39cf26585c6da3d62f 100644 |
--- a/third_party/WebKit/Source/modules/payments/ActivePaymentTest.cpp |
+++ b/third_party/WebKit/Source/modules/payments/CanMakePaymentTest.cpp |
@@ -2,7 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-// Tests for PaymentRequest::canMakeActivePayment(). |
+// Tests for PaymentRequest::canMakePayment(). |
#include "bindings/core/v8/V8BindingForTesting.h" |
#include "modules/payments/PaymentRequest.h" |
@@ -12,11 +12,11 @@ |
namespace blink { |
namespace { |
-using payments::mojom::blink::ActivePaymentQueryResult; |
+using payments::mojom::blink::CanMakePaymentQueryResult; |
using payments::mojom::blink::PaymentErrorReason; |
using payments::mojom::blink::PaymentRequestClient; |
-TEST(ActivePaymentTest, RejectPromiseOnUserCancel) { |
+TEST(CanMakePaymentTest, RejectPromiseOnUserCancel) { |
V8TestingScope scope; |
PaymentRequestMockFunctionScope funcs(scope.getScriptState()); |
makePaymentRequestOriginSecure(scope.document()); |
@@ -24,14 +24,14 @@ TEST(ActivePaymentTest, RejectPromiseOnUserCancel) { |
scope.document(), buildPaymentMethodDataForTest(), |
buildPaymentDetailsForTest(), scope.getExceptionState()); |
- request->canMakeActivePayment(scope.getScriptState()) |
+ request->canMakePayment(scope.getScriptState()) |
.then(funcs.expectNoCall(), funcs.expectCall()); |
static_cast<PaymentRequestClient*>(request)->OnError( |
PaymentErrorReason::USER_CANCEL); |
} |
-TEST(ActivePaymentTest, RejectPromiseOnUnknownError) { |
+TEST(CanMakePaymentTest, RejectPromiseOnUnknownError) { |
V8TestingScope scope; |
PaymentRequestMockFunctionScope funcs(scope.getScriptState()); |
makePaymentRequestOriginSecure(scope.document()); |
@@ -39,27 +39,27 @@ TEST(ActivePaymentTest, RejectPromiseOnUnknownError) { |
scope.document(), buildPaymentMethodDataForTest(), |
buildPaymentDetailsForTest(), scope.getExceptionState()); |
- request->canMakeActivePayment(scope.getScriptState()) |
+ request->canMakePayment(scope.getScriptState()) |
.then(funcs.expectNoCall(), funcs.expectCall()); |
static_cast<PaymentRequestClient*>(request)->OnError( |
PaymentErrorReason::UNKNOWN); |
} |
-TEST(ActivePaymentTest, RejectDuplicateRequest) { |
+TEST(CanMakePaymentTest, RejectDuplicateRequest) { |
V8TestingScope scope; |
PaymentRequestMockFunctionScope funcs(scope.getScriptState()); |
makePaymentRequestOriginSecure(scope.document()); |
PaymentRequest* request = PaymentRequest::create( |
scope.document(), buildPaymentMethodDataForTest(), |
buildPaymentDetailsForTest(), scope.getExceptionState()); |
- request->canMakeActivePayment(scope.getScriptState()); |
+ request->canMakePayment(scope.getScriptState()); |
- request->canMakeActivePayment(scope.getScriptState()) |
+ request->canMakePayment(scope.getScriptState()) |
.then(funcs.expectNoCall(), funcs.expectCall()); |
} |
-TEST(ActivePaymentTest, RejectQueryQuotaExceeded) { |
+TEST(CanMakePaymentTest, RejectQueryQuotaExceeded) { |
V8TestingScope scope; |
PaymentRequestMockFunctionScope funcs(scope.getScriptState()); |
makePaymentRequestOriginSecure(scope.document()); |
@@ -67,14 +67,14 @@ TEST(ActivePaymentTest, RejectQueryQuotaExceeded) { |
scope.document(), buildPaymentMethodDataForTest(), |
buildPaymentDetailsForTest(), scope.getExceptionState()); |
- request->canMakeActivePayment(scope.getScriptState()) |
+ request->canMakePayment(scope.getScriptState()) |
.then(funcs.expectNoCall(), funcs.expectCall()); |
- static_cast<PaymentRequestClient*>(request)->OnCanMakeActivePayment( |
- ActivePaymentQueryResult::QUERY_QUOTA_EXCEEDED); |
+ static_cast<PaymentRequestClient*>(request)->OnCanMakePayment( |
+ CanMakePaymentQueryResult::QUERY_QUOTA_EXCEEDED); |
} |
-TEST(ActivePaymentTest, ReturnCannotMakeActivePayment) { |
+TEST(CanMakePaymentTest, ReturnCannotMakeCanMakePayment) { |
V8TestingScope scope; |
PaymentRequestMockFunctionScope funcs(scope.getScriptState()); |
makePaymentRequestOriginSecure(scope.document()); |
@@ -82,17 +82,17 @@ TEST(ActivePaymentTest, ReturnCannotMakeActivePayment) { |
scope.document(), buildPaymentMethodDataForTest(), |
buildPaymentDetailsForTest(), scope.getExceptionState()); |
String captor; |
- request->canMakeActivePayment(scope.getScriptState()) |
+ request->canMakePayment(scope.getScriptState()) |
.then(funcs.expectCall(&captor), funcs.expectNoCall()); |
- static_cast<PaymentRequestClient*>(request)->OnCanMakeActivePayment( |
- ActivePaymentQueryResult::CANNOT_MAKE_ACTIVE_PAYMENT); |
+ static_cast<PaymentRequestClient*>(request)->OnCanMakePayment( |
+ CanMakePaymentQueryResult::CANNOT_MAKE_PAYMENT); |
v8::MicrotasksScope::PerformCheckpoint(scope.getScriptState()->isolate()); |
EXPECT_EQ("false", captor); |
} |
-TEST(ActivePaymentTest, ReturnCanMakeActivePayment) { |
+TEST(CanMakePaymentTest, ReturnCanMakePayment) { |
V8TestingScope scope; |
PaymentRequestMockFunctionScope funcs(scope.getScriptState()); |
makePaymentRequestOriginSecure(scope.document()); |
@@ -100,11 +100,11 @@ TEST(ActivePaymentTest, ReturnCanMakeActivePayment) { |
scope.document(), buildPaymentMethodDataForTest(), |
buildPaymentDetailsForTest(), scope.getExceptionState()); |
String captor; |
- request->canMakeActivePayment(scope.getScriptState()) |
+ request->canMakePayment(scope.getScriptState()) |
.then(funcs.expectCall(&captor), funcs.expectNoCall()); |
- static_cast<PaymentRequestClient*>(request)->OnCanMakeActivePayment( |
- ActivePaymentQueryResult::CAN_MAKE_ACTIVE_PAYMENT); |
+ static_cast<PaymentRequestClient*>(request)->OnCanMakePayment( |
+ CanMakePaymentQueryResult::CAN_MAKE_PAYMENT); |
v8::MicrotasksScope::PerformCheckpoint(scope.getScriptState()->isolate()); |
EXPECT_EQ("true", captor); |