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

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

Issue 2884393002: [WebPayments] Adding FilterProfilesForShipping to profile comparator (Closed)
Patch Set: rebase 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 EXPECT_EQ(request->state()->contact_profiles().front(), 240
241 request->state()->selected_contact_profile()); 241 // No contact profiles are selected because both are incomplete.
242 EXPECT_EQ(nullptr, request->state()->selected_contact_profile());
242 243
243 views::View* list_view = dialog_view()->GetViewByID( 244 views::View* list_view = dialog_view()->GetViewByID(
244 static_cast<int>(DialogViewID::CONTACT_INFO_SHEET_LIST_VIEW)); 245 static_cast<int>(DialogViewID::CONTACT_INFO_SHEET_LIST_VIEW));
245 DCHECK(list_view); 246 DCHECK(list_view);
246 ClickOnDialogViewAndWait(list_view->child_at(1)); 247 ClickOnDialogViewAndWait(list_view->child_at(1));
247 248
248 SetEditorTextfieldValue(base::ASCIIToUTF16(kPhoneNumber), 249 SetEditorTextfieldValue(base::ASCIIToUTF16(kPhoneNumber),
249 autofill::PHONE_HOME_WHOLE_NUMBER); 250 autofill::PHONE_HOME_WHOLE_NUMBER);
250 SetEditorTextfieldValue(base::ASCIIToUTF16(kEmailAddress), 251 SetEditorTextfieldValue(base::ASCIIToUTF16(kEmailAddress),
251 autofill::EMAIL_ADDRESS); 252 autofill::EMAIL_ADDRESS);
(...skipping 10 matching lines...) Expand all
262 DCHECK(profile); 263 DCHECK(profile);
263 264
264 EXPECT_EQ(base::ASCIIToUTF16("16515558946"), 265 EXPECT_EQ(base::ASCIIToUTF16("16515558946"),
265 profile->GetInfo( 266 profile->GetInfo(
266 autofill::AutofillType(autofill::PHONE_HOME_WHOLE_NUMBER), 267 autofill::AutofillType(autofill::PHONE_HOME_WHOLE_NUMBER),
267 GetLocale())); 268 GetLocale()));
268 EXPECT_EQ(base::ASCIIToUTF16(kEmailAddress), 269 EXPECT_EQ(base::ASCIIToUTF16(kEmailAddress),
269 profile->GetInfo(autofill::AutofillType(autofill::EMAIL_ADDRESS), 270 profile->GetInfo(autofill::AutofillType(autofill::EMAIL_ADDRESS),
270 GetLocale())); 271 GetLocale()));
271 272
273 // Expect the newly-completed profile to be selected.
272 EXPECT_EQ(2U, request->state()->contact_profiles().size()); 274 EXPECT_EQ(2U, request->state()->contact_profiles().size());
273 EXPECT_EQ(request->state()->contact_profiles().back(), profile); 275 EXPECT_EQ(request->state()->contact_profiles().back(), profile);
274 } 276 }
275 277
276 } // namespace payments 278 } // 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