Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(389)

Side by Side Diff: components/payments/content/payment_request_state_unittest.cc

Issue 2779283002: [Web Payments] Implement the CVC Unmask dialog. (Closed)
Patch Set: Rebase + add browser test Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "components/payments/content/payment_request_state.h" 5 #include "components/payments/content/payment_request_state.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 num_on_selected_information_changed_called_++; 48 num_on_selected_information_changed_called_++;
49 } 49 }
50 50
51 // PaymentRequestState::Delegate: 51 // PaymentRequestState::Delegate:
52 void OnPaymentResponseAvailable(mojom::PaymentResponsePtr response) override { 52 void OnPaymentResponseAvailable(mojom::PaymentResponsePtr response) override {
53 payment_response_ = std::move(response); 53 payment_response_ = std::move(response);
54 }; 54 };
55 void OnShippingOptionIdSelected(std::string shipping_option_id) override {} 55 void OnShippingOptionIdSelected(std::string shipping_option_id) override {}
56 void OnShippingAddressSelected(mojom::PaymentAddressPtr address) override {} 56 void OnShippingAddressSelected(mojom::PaymentAddressPtr address) override {}
57 57
58 PaymentRequestDelegate* GetPaymentRequestDelegate() override {
59 return nullptr;
60 }
61
58 void RecreateStateWithOptionsAndDetails( 62 void RecreateStateWithOptionsAndDetails(
59 mojom::PaymentOptionsPtr options, 63 mojom::PaymentOptionsPtr options,
60 mojom::PaymentDetailsPtr details, 64 mojom::PaymentDetailsPtr details,
61 std::vector<mojom::PaymentMethodDataPtr> method_data) { 65 std::vector<mojom::PaymentMethodDataPtr> method_data) {
62 // The spec will be based on the |options| and |details| passed in. 66 // The spec will be based on the |options| and |details| passed in.
63 spec_ = base::MakeUnique<PaymentRequestSpec>( 67 spec_ = base::MakeUnique<PaymentRequestSpec>(
64 std::move(options), std::move(details), std::move(method_data), nullptr, 68 std::move(options), std::move(details), std::move(method_data), nullptr,
65 "en-US"); 69 "en-US");
66 state_ = base::MakeUnique<PaymentRequestState>( 70 state_ = base::MakeUnique<PaymentRequestState>(
67 spec_.get(), this, "en-US", &test_personal_data_manager_); 71 spec_.get(), this, "en-US", &test_personal_data_manager_);
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 EXPECT_TRUE(state()->is_ready_to_pay()); 395 EXPECT_TRUE(state()->is_ready_to_pay());
392 state()->GeneratePaymentResponse(); 396 state()->GeneratePaymentResponse();
393 397
394 // Check that the name was set, but not the other values. 398 // Check that the name was set, but not the other values.
395 EXPECT_EQ("John H. Doe", response()->payer_name.value()); 399 EXPECT_EQ("John H. Doe", response()->payer_name.value());
396 EXPECT_FALSE(response()->payer_phone.has_value()); 400 EXPECT_FALSE(response()->payer_phone.has_value());
397 EXPECT_FALSE(response()->payer_email.has_value()); 401 EXPECT_FALSE(response()->payer_email.has_value());
398 } 402 }
399 403
400 } // namespace payments 404 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698