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" |
11 #include "core/EventTypeNames.h" | 11 #include "core/EventTypeNames.h" |
12 #include "modules/payments/PaymentUpdater.h" | 12 #include "modules/payments/PaymentUpdater.h" |
13 #include "testing/gmock/include/gmock/gmock.h" | 13 #include "testing/gmock/include/gmock/gmock.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 #include <memory> | 15 #include "wtf/OwnPtr.h" |
16 | 16 |
17 namespace blink { | 17 namespace blink { |
18 namespace { | 18 namespace { |
19 | 19 |
20 class MockPaymentUpdater : public GarbageCollectedFinalized<MockPaymentUpdater>,
public PaymentUpdater { | 20 class MockPaymentUpdater : public GarbageCollectedFinalized<MockPaymentUpdater>,
public PaymentUpdater { |
21 USING_GARBAGE_COLLECTED_MIXIN(MockPaymentUpdater); | 21 USING_GARBAGE_COLLECTED_MIXIN(MockPaymentUpdater); |
22 WTF_MAKE_NONCOPYABLE(MockPaymentUpdater); | 22 WTF_MAKE_NONCOPYABLE(MockPaymentUpdater); |
23 | 23 |
24 public: | 24 public: |
25 MockPaymentUpdater() {} | 25 MockPaymentUpdater() {} |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 } // namespace | 104 } // namespace |
105 } // namespace blink | 105 } // namespace blink |
OLD | NEW |