OLD | NEW |
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 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 autofill::ADDRESS_HOME_CITY); | 518 autofill::ADDRESS_HOME_CITY); |
519 SetEditorTextfieldValue(base::ASCIIToUTF16("BobZip"), | 519 SetEditorTextfieldValue(base::ASCIIToUTF16("BobZip"), |
520 autofill::ADDRESS_HOME_ZIP); | 520 autofill::ADDRESS_HOME_ZIP); |
521 SetEditorTextfieldValue(base::ASCIIToUTF16("5755555555"), | 521 SetEditorTextfieldValue(base::ASCIIToUTF16("5755555555"), |
522 autofill::PHONE_HOME_WHOLE_NUMBER); | 522 autofill::PHONE_HOME_WHOLE_NUMBER); |
523 | 523 |
524 // Come back to credit card editor. | 524 // Come back to credit card editor. |
525 ResetEventObserver(DialogEvent::BACK_NAVIGATION); | 525 ResetEventObserver(DialogEvent::BACK_NAVIGATION); |
526 ClickOnDialogViewAndWait(DialogViewID::SAVE_ADDRESS_BUTTON); | 526 ClickOnDialogViewAndWait(DialogViewID::SAVE_ADDRESS_BUTTON); |
527 | 527 |
| 528 // The billing address must be properly selected and valid. |
| 529 views::Combobox* billing_combobox = static_cast<views::Combobox*>( |
| 530 dialog_view()->GetViewByID(autofill::ADDRESS_BILLING_LINE1)); |
| 531 ASSERT_NE(nullptr, billing_combobox); |
| 532 EXPECT_FALSE(billing_combobox->invalid()); |
| 533 |
528 // And then save credit card state and come back to payment sheet. | 534 // And then save credit card state and come back to payment sheet. |
529 ResetEventObserver(DialogEvent::BACK_TO_PAYMENT_SHEET_NAVIGATION); | 535 ResetEventObserver(DialogEvent::BACK_TO_PAYMENT_SHEET_NAVIGATION); |
530 | 536 |
531 // Verifying the data is in the DB. | 537 // Verifying the data is in the DB. |
532 autofill::PersonalDataManager* personal_data_manager = GetDataManager(); | 538 autofill::PersonalDataManager* personal_data_manager = GetDataManager(); |
533 personal_data_manager->AddObserver(&personal_data_observer_); | 539 personal_data_manager->AddObserver(&personal_data_observer_); |
534 | 540 |
535 // Wait until the web database has been updated and the notification sent. | 541 // Wait until the web database has been updated and the notification sent. |
536 base::RunLoop data_loop; | 542 base::RunLoop data_loop; |
537 EXPECT_CALL(personal_data_observer_, OnPersonalDataChanged()) | 543 EXPECT_CALL(personal_data_observer_, OnPersonalDataChanged()) |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 autofill::CREDIT_CARD_NAME_FULL); | 596 autofill::CREDIT_CARD_NAME_FULL); |
591 | 597 |
592 ValidatingTextfield* textfield = | 598 ValidatingTextfield* textfield = |
593 static_cast<ValidatingTextfield*>(dialog_view()->GetViewByID( | 599 static_cast<ValidatingTextfield*>(dialog_view()->GetViewByID( |
594 static_cast<int>(autofill::CREDIT_CARD_NAME_FULL))); | 600 static_cast<int>(autofill::CREDIT_CARD_NAME_FULL))); |
595 EXPECT_TRUE(textfield); | 601 EXPECT_TRUE(textfield); |
596 EXPECT_TRUE(textfield->invalid()); | 602 EXPECT_TRUE(textfield->invalid()); |
597 } | 603 } |
598 | 604 |
599 } // namespace payments | 605 } // namespace payments |
OLD | NEW |