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 // Tests for PaymentRequest::OnPaymentResponse(). | 5 // Tests for PaymentRequest::OnPaymentResponse(). |
6 | 6 |
| 7 #include <utility> |
7 #include "bindings/core/v8/ScriptFunction.h" | 8 #include "bindings/core/v8/ScriptFunction.h" |
8 #include "bindings/core/v8/V8BindingForTesting.h" | 9 #include "bindings/core/v8/V8BindingForTesting.h" |
9 #include "bindings/modules/v8/V8PaymentResponse.h" | 10 #include "bindings/modules/v8/V8PaymentResponse.h" |
10 #include "modules/payments/PaymentAddress.h" | 11 #include "modules/payments/PaymentAddress.h" |
11 #include "modules/payments/PaymentRequest.h" | 12 #include "modules/payments/PaymentRequest.h" |
12 #include "modules/payments/PaymentTestHelper.h" | 13 #include "modules/payments/PaymentTestHelper.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
14 #include <utility> | |
15 | 15 |
16 namespace blink { | 16 namespace blink { |
17 namespace { | 17 namespace { |
18 | 18 |
19 // If the merchant requests shipping information, but the browser does not | 19 // If the merchant requests shipping information, but the browser does not |
20 // provide the shipping option, reject the show() promise. | 20 // provide the shipping option, reject the show() promise. |
21 TEST(OnPaymentResponseTest, RejectMissingShippingOption) { | 21 TEST(OnPaymentResponseTest, RejectMissingShippingOption) { |
22 V8TestingScope scope; | 22 V8TestingScope scope; |
23 PaymentRequestMockFunctionScope funcs(scope.getScriptState()); | 23 PaymentRequestMockFunctionScope funcs(scope.getScriptState()); |
24 makePaymentRequestOriginSecure(scope.document()); | 24 makePaymentRequestOriginSecure(scope.document()); |
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 ->OnPaymentResponse(std::move(response)); | 650 ->OnPaymentResponse(std::move(response)); |
651 | 651 |
652 v8::MicrotasksScope::PerformCheckpoint(scope.isolate()); | 652 v8::MicrotasksScope::PerformCheckpoint(scope.isolate()); |
653 PaymentResponse* pr = V8PaymentResponse::toImplWithTypeCheck( | 653 PaymentResponse* pr = V8PaymentResponse::toImplWithTypeCheck( |
654 scope.isolate(), outValue.v8Value()); | 654 scope.isolate(), outValue.v8Value()); |
655 EXPECT_TRUE(pr->payerEmail().isNull()); | 655 EXPECT_TRUE(pr->payerEmail().isNull()); |
656 } | 656 } |
657 | 657 |
658 } // namespace | 658 } // namespace |
659 } // namespace blink | 659 } // namespace blink |
OLD | NEW |