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

Side by Side Diff: chrome/browser/ui/views/payments/shipping_option_view_controller_browsertest.cc

Issue 2847503002: [WebPayments] Show labels on incomplete profiles (Closed)
Patch Set: add missing changes Created 3 years, 7 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 <list> 5 #include <list>
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/browser/ui/views/payments/payment_request_browsertest_base.h" 8 #include "chrome/browser/ui/views/payments/payment_request_browsertest_base.h"
9 #include "chrome/browser/ui/views/payments/payment_request_dialog_view_ids.h" 9 #include "chrome/browser/ui/views/payments/payment_request_dialog_view_ids.h"
10 #include "components/autofill/core/browser/autofill_profile.h" 10 #include "components/autofill/core/browser/autofill_profile.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 // Go to the shipping address screen and select the first address (MI state). 46 // Go to the shipping address screen and select the first address (MI state).
47 OpenShippingAddressSectionScreen(); 47 OpenShippingAddressSectionScreen();
48 ResetEventObserverForSequence(std::list<DialogEvent>{ 48 ResetEventObserverForSequence(std::list<DialogEvent>{
49 DialogEvent::BACK_NAVIGATION, DialogEvent::SPEC_DONE_UPDATING}); 49 DialogEvent::BACK_NAVIGATION, DialogEvent::SPEC_DONE_UPDATING});
50 ClickOnChildInListViewAndWait( 50 ClickOnChildInListViewAndWait(
51 /* child_index=*/0, /*total_num_children=*/2, 51 /* child_index=*/0, /*total_num_children=*/2,
52 DialogViewID::SHIPPING_ADDRESS_SHEET_LIST_VIEW); 52 DialogViewID::SHIPPING_ADDRESS_SHEET_LIST_VIEW);
53 53
54 // Michigan address is selected and has standard shipping. 54 // Michigan address is selected and has standard shipping.
55 std::vector<base::string16> shipping_address_labels = GetThreeLineLabelValues( 55 std::vector<base::string16> shipping_address_labels = GetProfileLabelValues(
56 DialogViewID::PAYMENT_SHEET_SHIPPING_ADDRESS_SECTION); 56 DialogViewID::PAYMENT_SHEET_SHIPPING_ADDRESS_SECTION);
57 EXPECT_EQ(base::ASCIIToUTF16("Jane A. Smith"), shipping_address_labels[0]); 57 EXPECT_EQ(base::ASCIIToUTF16("Jane A. Smith"), shipping_address_labels[0]);
58 EXPECT_EQ( 58 EXPECT_EQ(
59 base::ASCIIToUTF16("ACME, 123 Main Street, Unit 1, Greensdale, MI 48838"), 59 base::ASCIIToUTF16("ACME, 123 Main Street, Unit 1, Greensdale, MI 48838"),
60 shipping_address_labels[1]); 60 shipping_address_labels[1]);
61 EXPECT_EQ(base::ASCIIToUTF16("13105557889"), shipping_address_labels[2]); 61 EXPECT_EQ(base::ASCIIToUTF16("13105557889"), shipping_address_labels[2]);
62 62
63 // The shipping option section exists, and the shipping option is shown. 63 // The shipping option section exists, and the shipping option is shown.
64 std::vector<base::string16> shipping_option_labels = 64 std::vector<base::string16> shipping_option_labels =
65 GetShippingOptionLabelValues( 65 GetShippingOptionLabelValues(
(...skipping 10 matching lines...) Expand all
76 /* child_index=*/1, /*total_num_children=*/2, 76 /* child_index=*/1, /*total_num_children=*/2,
77 DialogViewID::SHIPPING_ADDRESS_SHEET_LIST_VIEW); 77 DialogViewID::SHIPPING_ADDRESS_SHEET_LIST_VIEW);
78 78
79 // There is no longer shipping option section, because no shipping options are 79 // There is no longer shipping option section, because no shipping options are
80 // available for Canada. 80 // available for Canada.
81 EXPECT_EQ(nullptr, dialog_view()->GetViewByID(static_cast<int>( 81 EXPECT_EQ(nullptr, dialog_view()->GetViewByID(static_cast<int>(
82 DialogViewID::PAYMENT_SHEET_SHIPPING_OPTION_SECTION))); 82 DialogViewID::PAYMENT_SHEET_SHIPPING_OPTION_SECTION)));
83 } 83 }
84 84
85 } // namespace payments 85 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698