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

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

Issue 2872033007: [Payments] Do not show error on initial load of address screen (Closed)
Patch Set: deps check 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
« no previous file with comments | « no previous file | components/payments/content/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 27 matching lines...) Expand all
38 AddAutofillProfile(canada); 38 AddAutofillProfile(canada);
39 39
40 InvokePaymentRequestUI(); 40 InvokePaymentRequestUI();
41 41
42 // There is no shipping option section, because no address has been selected. 42 // There is no shipping option section, because no address has been selected.
43 EXPECT_EQ(nullptr, dialog_view()->GetViewByID(static_cast<int>( 43 EXPECT_EQ(nullptr, dialog_view()->GetViewByID(static_cast<int>(
44 DialogViewID::PAYMENT_SHEET_SHIPPING_OPTION_SECTION))); 44 DialogViewID::PAYMENT_SHEET_SHIPPING_OPTION_SECTION)));
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 // There is no error at the top of this screen, because no address has been
49 // selected yet.
50 EXPECT_EQ(nullptr, dialog_view()->GetViewByID(static_cast<int>(
51 DialogViewID::SHIPPING_ADDRESS_OPTION_ERROR)));
48 ResetEventObserverForSequence(std::list<DialogEvent>{ 52 ResetEventObserverForSequence(std::list<DialogEvent>{
49 DialogEvent::BACK_NAVIGATION, DialogEvent::SPEC_DONE_UPDATING}); 53 DialogEvent::BACK_NAVIGATION, DialogEvent::SPEC_DONE_UPDATING});
50 ClickOnChildInListViewAndWait( 54 ClickOnChildInListViewAndWait(
51 /* child_index=*/0, /*total_num_children=*/2, 55 /* child_index=*/0, /*total_num_children=*/2,
52 DialogViewID::SHIPPING_ADDRESS_SHEET_LIST_VIEW); 56 DialogViewID::SHIPPING_ADDRESS_SHEET_LIST_VIEW);
53 57
54 // Michigan address is selected and has standard shipping. 58 // Michigan address is selected and has standard shipping.
55 std::vector<base::string16> shipping_address_labels = GetProfileLabelValues( 59 std::vector<base::string16> shipping_address_labels = GetProfileLabelValues(
56 DialogViewID::PAYMENT_SHEET_SHIPPING_ADDRESS_SECTION); 60 DialogViewID::PAYMENT_SHEET_SHIPPING_ADDRESS_SECTION);
57 EXPECT_EQ(base::ASCIIToUTF16("Jane A. Smith"), shipping_address_labels[0]); 61 EXPECT_EQ(base::ASCIIToUTF16("Jane A. Smith"), shipping_address_labels[0]);
(...skipping 30 matching lines...) Expand all
88 DialogViewID::PAYMENT_SHEET_SHIPPING_ADDRESS_SECTION) 92 DialogViewID::PAYMENT_SHEET_SHIPPING_ADDRESS_SECTION)
89 .back()); 93 .back());
90 94
91 // Go to the address selector and see this error as well. 95 // Go to the address selector and see this error as well.
92 OpenShippingAddressSectionScreen(); 96 OpenShippingAddressSectionScreen();
93 EXPECT_EQ(base::ASCIIToUTF16("We do not ship to this address"), 97 EXPECT_EQ(base::ASCIIToUTF16("We do not ship to this address"),
94 GetLabelText(DialogViewID::SHIPPING_ADDRESS_OPTION_ERROR)); 98 GetLabelText(DialogViewID::SHIPPING_ADDRESS_OPTION_ERROR));
95 } 99 }
96 100
97 } // namespace payments 101 } // namespace payments
OLDNEW
« no previous file with comments | « no previous file | components/payments/content/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698