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

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

Issue 2897133002: Revert of [WebPayments] Adding FilterProfilesForShipping to profile comparator (Closed)
Patch Set: 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 | chrome/browser/ui/views/payments/profile_list_view_controller_browsertest.cc » ('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 <string> 5 #include <string>
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/ui/views/payments/payment_request_browsertest_base.h" 9 #include "chrome/browser/ui/views/payments/payment_request_browsertest_base.h"
10 #include "chrome/browser/ui/views/payments/payment_request_dialog_view_ids.h" 10 #include "chrome/browser/ui/views/payments/payment_request_dialog_view_ids.h"
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 230
231 autofill::AutofillProfile other_incomplete_profile; 231 autofill::AutofillProfile other_incomplete_profile;
232 other_incomplete_profile.SetInfo(autofill::AutofillType(autofill::NAME_FULL), 232 other_incomplete_profile.SetInfo(autofill::AutofillType(autofill::NAME_FULL),
233 base::ASCIIToUTF16("other"), GetLocale()); 233 base::ASCIIToUTF16("other"), GetLocale());
234 AddAutofillProfile(other_incomplete_profile); 234 AddAutofillProfile(other_incomplete_profile);
235 235
236 InvokePaymentRequestUI(); 236 InvokePaymentRequestUI();
237 OpenContactInfoScreen(); 237 OpenContactInfoScreen();
238 238
239 PaymentRequest* request = GetPaymentRequests(GetActiveWebContents()).front(); 239 PaymentRequest* request = GetPaymentRequests(GetActiveWebContents()).front();
240 240 EXPECT_EQ(request->state()->contact_profiles().front(),
241 // No contact profiles are selected because both are incomplete. 241 request->state()->selected_contact_profile());
242 EXPECT_EQ(nullptr, request->state()->selected_contact_profile());
243 242
244 views::View* list_view = dialog_view()->GetViewByID( 243 views::View* list_view = dialog_view()->GetViewByID(
245 static_cast<int>(DialogViewID::CONTACT_INFO_SHEET_LIST_VIEW)); 244 static_cast<int>(DialogViewID::CONTACT_INFO_SHEET_LIST_VIEW));
246 DCHECK(list_view); 245 DCHECK(list_view);
247 ClickOnDialogViewAndWait(list_view->child_at(1)); 246 ClickOnDialogViewAndWait(list_view->child_at(1));
248 247
249 SetEditorTextfieldValue(base::ASCIIToUTF16(kPhoneNumber), 248 SetEditorTextfieldValue(base::ASCIIToUTF16(kPhoneNumber),
250 autofill::PHONE_HOME_WHOLE_NUMBER); 249 autofill::PHONE_HOME_WHOLE_NUMBER);
251 SetEditorTextfieldValue(base::ASCIIToUTF16(kEmailAddress), 250 SetEditorTextfieldValue(base::ASCIIToUTF16(kEmailAddress),
252 autofill::EMAIL_ADDRESS); 251 autofill::EMAIL_ADDRESS);
(...skipping 10 matching lines...) Expand all
263 DCHECK(profile); 262 DCHECK(profile);
264 263
265 EXPECT_EQ(base::ASCIIToUTF16(kPhoneNumber), 264 EXPECT_EQ(base::ASCIIToUTF16(kPhoneNumber),
266 profile->GetInfo( 265 profile->GetInfo(
267 autofill::AutofillType(autofill::PHONE_HOME_WHOLE_NUMBER), 266 autofill::AutofillType(autofill::PHONE_HOME_WHOLE_NUMBER),
268 GetLocale())); 267 GetLocale()));
269 EXPECT_EQ(base::ASCIIToUTF16(kEmailAddress), 268 EXPECT_EQ(base::ASCIIToUTF16(kEmailAddress),
270 profile->GetInfo(autofill::AutofillType(autofill::EMAIL_ADDRESS), 269 profile->GetInfo(autofill::AutofillType(autofill::EMAIL_ADDRESS),
271 GetLocale())); 270 GetLocale()));
272 271
273 // Expect the newly-completed profile to be selected.
274 EXPECT_EQ(2U, request->state()->contact_profiles().size()); 272 EXPECT_EQ(2U, request->state()->contact_profiles().size());
275 EXPECT_EQ(request->state()->contact_profiles().back(), 273 EXPECT_EQ(request->state()->contact_profiles().back(),
276 request->state()->selected_contact_profile()); 274 request->state()->selected_contact_profile());
277 } 275 }
278 276
279 } // namespace payments 277 } // namespace payments
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/payments/profile_list_view_controller_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698