diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-02-13 15:05:36 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-02-14 10:33:47 +0000 |
commit | e684a3455bcc29a6e3e66a004e352dea4e1141e7 (patch) | |
tree | d55b4003bde34d7d05f558f02cfd82b2a66a7aac /chromium/third_party/blink/renderer/modules/payments/payment_request_update_event_test.cc | |
parent | 2b94bfe47ccb6c08047959d1c26e392919550e86 (diff) | |
download | qtwebengine-chromium-e684a3455bcc29a6e3e66a004e352dea4e1141e7.tar.gz |
BASELINE: Update Chromium to 72.0.3626.110 and Ninja to 1.9.0
Change-Id: Ic57220b00ecc929a893c91f5cc552f5d3e99e922
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/third_party/blink/renderer/modules/payments/payment_request_update_event_test.cc')
-rw-r--r-- | chromium/third_party/blink/renderer/modules/payments/payment_request_update_event_test.cc | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/chromium/third_party/blink/renderer/modules/payments/payment_request_update_event_test.cc b/chromium/third_party/blink/renderer/modules/payments/payment_request_update_event_test.cc index ff8142374b8..4e2148cba1d 100644 --- a/chromium/third_party/blink/renderer/modules/payments/payment_request_update_event_test.cc +++ b/chromium/third_party/blink/renderer/modules/payments/payment_request_update_event_test.cc @@ -28,8 +28,9 @@ class MockPaymentUpdater : public GarbageCollectedFinalized<MockPaymentUpdater>, MockPaymentUpdater() = default; ~MockPaymentUpdater() override = default; - MOCK_METHOD1(OnUpdatePaymentDetails, - void(const ScriptValue& detailsScriptValue)); + MOCK_METHOD2(OnUpdatePaymentDetails, + void(const AtomicString& event_type, + const ScriptValue& detailsScriptValue)); MOCK_METHOD1(OnUpdatePaymentDetailsFailure, void(const String& error)); void Trace(blink::Visitor* visitor) override {} @@ -38,7 +39,7 @@ class MockPaymentUpdater : public GarbageCollectedFinalized<MockPaymentUpdater>, TEST(PaymentRequestUpdateEventTest, OnUpdatePaymentDetailsCalled) { V8TestingScope scope; PaymentRequestUpdateEvent* event = PaymentRequestUpdateEvent::Create( - scope.GetExecutionContext(), EventTypeNames::shippingaddresschange); + scope.GetExecutionContext(), event_type_names::kShippingaddresschange); MockPaymentUpdater* updater = new MockPaymentUpdater; event->SetTrusted(true); event->SetPaymentDetailsUpdater(updater); @@ -49,7 +50,9 @@ TEST(PaymentRequestUpdateEventTest, OnUpdatePaymentDetailsCalled) { scope.GetExceptionState()); EXPECT_FALSE(scope.GetExceptionState().HadException()); - EXPECT_CALL(*updater, OnUpdatePaymentDetails(testing::_)); + EXPECT_CALL(*updater, + OnUpdatePaymentDetails(event_type_names::kShippingaddresschange, + testing::_)); EXPECT_CALL(*updater, OnUpdatePaymentDetailsFailure(testing::_)).Times(0); payment_details->Resolve("foo"); @@ -58,7 +61,7 @@ TEST(PaymentRequestUpdateEventTest, OnUpdatePaymentDetailsCalled) { TEST(PaymentRequestUpdateEventTest, OnUpdatePaymentDetailsFailureCalled) { V8TestingScope scope; PaymentRequestUpdateEvent* event = PaymentRequestUpdateEvent::Create( - scope.GetExecutionContext(), EventTypeNames::shippingaddresschange); + scope.GetExecutionContext(), event_type_names::kShippingaddresschange); MockPaymentUpdater* updater = new MockPaymentUpdater; event->SetTrusted(true); event->SetPaymentDetailsUpdater(updater); @@ -69,7 +72,10 @@ TEST(PaymentRequestUpdateEventTest, OnUpdatePaymentDetailsFailureCalled) { scope.GetExceptionState()); EXPECT_FALSE(scope.GetExceptionState().HadException()); - EXPECT_CALL(*updater, OnUpdatePaymentDetails(testing::_)).Times(0); + EXPECT_CALL(*updater, + OnUpdatePaymentDetails(event_type_names::kShippingaddresschange, + testing::_)) + .Times(0); EXPECT_CALL(*updater, OnUpdatePaymentDetailsFailure(testing::_)); payment_details->Reject("oops"); @@ -78,7 +84,7 @@ TEST(PaymentRequestUpdateEventTest, OnUpdatePaymentDetailsFailureCalled) { TEST(PaymentRequestUpdateEventTest, CannotUpdateWithoutDispatching) { V8TestingScope scope; PaymentRequestUpdateEvent* event = PaymentRequestUpdateEvent::Create( - scope.GetExecutionContext(), EventTypeNames::shippingaddresschange); + scope.GetExecutionContext(), event_type_names::kShippingaddresschange); event->SetPaymentDetailsUpdater(new MockPaymentUpdater); event->updateWith( @@ -92,7 +98,7 @@ TEST(PaymentRequestUpdateEventTest, CannotUpdateWithoutDispatching) { TEST(PaymentRequestUpdateEventTest, CannotUpdateTwice) { V8TestingScope scope; PaymentRequestUpdateEvent* event = PaymentRequestUpdateEvent::Create( - scope.GetExecutionContext(), EventTypeNames::shippingaddresschange); + scope.GetExecutionContext(), event_type_names::kShippingaddresschange); MockPaymentUpdater* updater = new MockPaymentUpdater; event->SetTrusted(true); event->SetPaymentDetailsUpdater(updater); @@ -114,7 +120,7 @@ TEST(PaymentRequestUpdateEventTest, CannotUpdateTwice) { TEST(PaymentRequestUpdateEventTest, UpdaterNotRequired) { V8TestingScope scope; PaymentRequestUpdateEvent* event = PaymentRequestUpdateEvent::Create( - scope.GetExecutionContext(), EventTypeNames::shippingaddresschange); + scope.GetExecutionContext(), event_type_names::kShippingaddresschange); event->SetTrusted(true); event->updateWith( @@ -133,7 +139,7 @@ TEST(PaymentRequestUpdateEventTest, AddressChangeUpdateWithTimeout) { scope.GetExecutionContext(), BuildPaymentMethodDataForTest(), BuildPaymentDetailsInitForTest(), scope.GetExceptionState()); PaymentRequestUpdateEvent* event = PaymentRequestUpdateEvent::Create( - scope.GetExecutionContext(), EventTypeNames::shippingaddresschange); + scope.GetExecutionContext(), event_type_names::kShippingaddresschange); event->SetPaymentDetailsUpdater(request); event->SetTrusted(true); EXPECT_FALSE(scope.GetExceptionState().HadException()); @@ -166,7 +172,7 @@ TEST(PaymentRequestUpdateEventTest, OptionChangeUpdateWithTimeout) { scope.GetExecutionContext(), BuildPaymentMethodDataForTest(), BuildPaymentDetailsInitForTest(), scope.GetExceptionState()); PaymentRequestUpdateEvent* event = PaymentRequestUpdateEvent::Create( - scope.GetExecutionContext(), EventTypeNames::shippingoptionchange); + scope.GetExecutionContext(), event_type_names::kShippingoptionchange); event->SetTrusted(true); event->SetPaymentDetailsUpdater(request); EXPECT_FALSE(scope.GetExceptionState().HadException()); @@ -200,7 +206,7 @@ TEST(PaymentRequestUpdateEventTest, AddressChangePromiseTimeout) { BuildPaymentDetailsInitForTest(), scope.GetExceptionState()); EXPECT_FALSE(scope.GetExceptionState().HadException()); PaymentRequestUpdateEvent* event = PaymentRequestUpdateEvent::Create( - scope.GetExecutionContext(), EventTypeNames::shippingaddresschange); + scope.GetExecutionContext(), event_type_names::kShippingaddresschange); event->SetTrusted(true); event->SetPaymentDetailsUpdater(request); event->SetEventPhase(Event::kCapturingPhase); @@ -233,7 +239,7 @@ TEST(PaymentRequestUpdateEventTest, OptionChangePromiseTimeout) { BuildPaymentDetailsInitForTest(), scope.GetExceptionState()); EXPECT_FALSE(scope.GetExceptionState().HadException()); PaymentRequestUpdateEvent* event = PaymentRequestUpdateEvent::Create( - scope.GetExecutionContext(), EventTypeNames::shippingoptionchange); + scope.GetExecutionContext(), event_type_names::kShippingoptionchange); event->SetTrusted(true); event->SetPaymentDetailsUpdater(request); event->SetEventPhase(Event::kCapturingPhase); @@ -260,7 +266,7 @@ TEST(PaymentRequestUpdateEventTest, OptionChangePromiseTimeout) { TEST(PaymentRequestUpdateEventTest, NotAllowUntrustedEvent) { V8TestingScope scope; PaymentRequestUpdateEvent* event = PaymentRequestUpdateEvent::Create( - scope.GetExecutionContext(), EventTypeNames::shippingaddresschange); + scope.GetExecutionContext(), event_type_names::kShippingaddresschange); event->SetTrusted(false); event->updateWith( |