OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "modules/payments/PaymentRequestUpdateEvent.h" | 5 #include "modules/payments/PaymentRequestUpdateEvent.h" |
6 | 6 |
7 #include "bindings/core/v8/ExceptionState.h" | 7 #include "bindings/core/v8/ExceptionState.h" |
8 #include "bindings/core/v8/ScriptPromiseResolver.h" | 8 #include "bindings/core/v8/ScriptPromiseResolver.h" |
9 #include "bindings/core/v8/ScriptState.h" | 9 #include "bindings/core/v8/ScriptState.h" |
10 #include "bindings/core/v8/V8BindingForTesting.h" | 10 #include "bindings/core/v8/V8BindingForTesting.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 TEST(PaymentRequestUpdateEventTest, UpdaterNotRequired) | 94 TEST(PaymentRequestUpdateEventTest, UpdaterNotRequired) |
95 { | 95 { |
96 V8TestingScope scope; | 96 V8TestingScope scope; |
97 PaymentRequestUpdateEvent* event = PaymentRequestUpdateEvent::create(EventTy
peNames::shippingaddresschange); | 97 PaymentRequestUpdateEvent* event = PaymentRequestUpdateEvent::create(EventTy
peNames::shippingaddresschange); |
98 | 98 |
99 event->updateWith(scope.getScriptState(), ScriptPromiseResolver::create(scop
e.getScriptState())->promise(), scope.getExceptionState()); | 99 event->updateWith(scope.getScriptState(), ScriptPromiseResolver::create(scop
e.getScriptState())->promise(), scope.getExceptionState()); |
100 | 100 |
101 EXPECT_FALSE(scope.getExceptionState().hadException()); | 101 EXPECT_FALSE(scope.getExceptionState().hadException()); |
102 } | 102 } |
103 | 103 |
| 104 TEST(PaymentRequestUpdateEventTest, OnUpdatePaymentDetailsTimeout) |
| 105 { |
| 106 V8TestingScope scope; |
| 107 PaymentRequestUpdateEvent* event = PaymentRequestUpdateEvent::create(); |
| 108 MockPaymentUpdater* updater = new MockPaymentUpdater; |
| 109 event->setPaymentDetailsUpdater(updater); |
| 110 |
| 111 EXPECT_CALL(*updater, onUpdatePaymentDetails(testing::_)).Times(0); |
| 112 EXPECT_CALL(*updater, onUpdatePaymentDetailsFailure(testing::_)); |
| 113 |
| 114 event->onTimerFired(0); |
| 115 } |
| 116 |
104 } // namespace | 117 } // namespace |
105 } // namespace blink | 118 } // namespace blink |
OLD | NEW |