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

Side by Side Diff: chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc

Issue 172783003: rAc: don't show countries with partially supported address fields for now. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compile Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/autofill/autofill_dialog_controller_impl.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 1389 matching lines...) Expand 10 before | Expand all | Expand 10 after
1400 } 1400 }
1401 return false; 1401 return false;
1402 } 1402 }
1403 1403
1404 private: 1404 private:
1405 i18ninput::ScopedEnableForTesting enabled_; 1405 i18ninput::ScopedEnableForTesting enabled_;
1406 }; 1406 };
1407 1407
1408 IN_PROC_BROWSER_TEST_F(AutofillDialogControllerI18nTest, 1408 IN_PROC_BROWSER_TEST_F(AutofillDialogControllerI18nTest,
1409 CountryChangeRebuildsSection) { 1409 CountryChangeRebuildsSection) {
1410 EXPECT_FALSE( 1410 EXPECT_FALSE(SectionHasField(SECTION_BILLING, ADDRESS_BILLING_SORTING_CODE));
1411 SectionHasField(SECTION_BILLING, ADDRESS_BILLING_DEPENDENT_LOCALITY));
1412 EXPECT_FALSE(SectionHasField(SECTION_SHIPPING, ADDRESS_HOME_SORTING_CODE)); 1411 EXPECT_FALSE(SectionHasField(SECTION_SHIPPING, ADDRESS_HOME_SORTING_CODE));
1413 1412
1414 // Select "Add new shipping address...". 1413 // Select "Add new shipping address...".
1415 controller()->MenuModelForSection(SECTION_SHIPPING)->ActivatedAt(1); 1414 controller()->MenuModelForSection(SECTION_SHIPPING)->ActivatedAt(1);
1416 1415
1417 // Add some valid user input that should be preserved when country changes. 1416 // Add some valid user input that should be preserved when country changes.
1418 scoped_ptr<AutofillDialogViewTester> view = GetViewTester(); 1417 scoped_ptr<AutofillDialogViewTester> view = GetViewTester();
1419 view->SetTextContentsOfInput(NAME_FULL, ASCIIToUTF16("B. Loblaw")); 1418 view->SetTextContentsOfInput(NAME_FULL, ASCIIToUTF16("B. Loblaw"));
1420 1419
1421 // Change both sections' countries. 1420 // Change both sections' countries.
1422 view->SetTextContentsOfInput(ADDRESS_BILLING_COUNTRY, ASCIIToUTF16("China")); 1421 view->SetTextContentsOfInput(ADDRESS_BILLING_COUNTRY, ASCIIToUTF16("France"));
1423 view->ActivateInput(ADDRESS_BILLING_COUNTRY); 1422 view->ActivateInput(ADDRESS_BILLING_COUNTRY);
1424 view->SetTextContentsOfInput(ADDRESS_HOME_COUNTRY, ASCIIToUTF16("France")); 1423 view->SetTextContentsOfInput(ADDRESS_HOME_COUNTRY, ASCIIToUTF16("Belarus"));
1425 view->ActivateInput(ADDRESS_HOME_COUNTRY); 1424 view->ActivateInput(ADDRESS_HOME_COUNTRY);
1426 1425
1427 // Verify the name is still there. 1426 // Verify the name is still there.
1428 EXPECT_EQ(ASCIIToUTF16("B. Loblaw"), view->GetTextContentsOfInput(NAME_FULL)); 1427 EXPECT_EQ(ASCIIToUTF16("B. Loblaw"), view->GetTextContentsOfInput(NAME_FULL));
1429 1428
1430 EXPECT_TRUE( 1429 EXPECT_TRUE(SectionHasField(SECTION_BILLING, ADDRESS_BILLING_SORTING_CODE));
1431 SectionHasField(SECTION_BILLING, ADDRESS_BILLING_DEPENDENT_LOCALITY));
1432 EXPECT_TRUE(SectionHasField(SECTION_SHIPPING, ADDRESS_HOME_SORTING_CODE)); 1430 EXPECT_TRUE(SectionHasField(SECTION_SHIPPING, ADDRESS_HOME_SORTING_CODE));
1433 } 1431 }
1434 1432
1435 // Changing the data source to or from Wallet preserves the shipping country, 1433 // Changing the data source to or from Wallet preserves the shipping country,
1436 // but not the billing country because Wallet only supports US billing 1434 // but not the billing country because Wallet only supports US billing
1437 // addresses. 1435 // addresses.
1438 IN_PROC_BROWSER_TEST_F(AutofillDialogControllerI18nTest, 1436 IN_PROC_BROWSER_TEST_F(AutofillDialogControllerI18nTest,
1439 ChangingDataSourcePreservesCountry) { 1437 ChangingDataSourcePreservesCountry) {
1440 AutofillProfile verified_profile(test::GetVerifiedProfile()); 1438 AutofillProfile verified_profile(test::GetVerifiedProfile());
1441 controller()->GetTestingManager()->AddTestingProfile(&verified_profile); 1439 controller()->GetTestingManager()->AddTestingProfile(&verified_profile);
(...skipping 12 matching lines...) Expand all
1454 EXPECT_TRUE(controller()->IsPayingWithWallet()); 1452 EXPECT_TRUE(controller()->IsPayingWithWallet());
1455 1453
1456 // Select "Add new shipping address...". 1454 // Select "Add new shipping address...".
1457 controller()->MenuModelForSection(SECTION_SHIPPING)->ActivatedAt(2); 1455 controller()->MenuModelForSection(SECTION_SHIPPING)->ActivatedAt(2);
1458 1456
1459 scoped_ptr<AutofillDialogViewTester> view = GetViewTester(); 1457 scoped_ptr<AutofillDialogViewTester> view = GetViewTester();
1460 ASSERT_EQ(ASCIIToUTF16("United States"), 1458 ASSERT_EQ(ASCIIToUTF16("United States"),
1461 view->GetTextContentsOfInput(ADDRESS_HOME_COUNTRY)); 1459 view->GetTextContentsOfInput(ADDRESS_HOME_COUNTRY));
1462 1460
1463 // Switch the shipping country. 1461 // Switch the shipping country.
1464 view->SetTextContentsOfInput(ADDRESS_HOME_COUNTRY, ASCIIToUTF16("China")); 1462 view->SetTextContentsOfInput(ADDRESS_HOME_COUNTRY, ASCIIToUTF16("Belarus"));
1465 view->ActivateInput(ADDRESS_HOME_COUNTRY); 1463 view->ActivateInput(ADDRESS_HOME_COUNTRY);
1466 1464
1467 // Switch to using Autofill instead of Wallet. 1465 // Switch to using Autofill instead of Wallet.
1468 ui::MenuModel* account_chooser = controller()->MenuModelForAccountChooser(); 1466 ui::MenuModel* account_chooser = controller()->MenuModelForAccountChooser();
1469 account_chooser->ActivatedAt(account_chooser->GetItemCount() - 1); 1467 account_chooser->ActivatedAt(account_chooser->GetItemCount() - 1);
1470 1468
1471 EXPECT_FALSE(controller()->IsPayingWithWallet()); 1469 EXPECT_FALSE(controller()->IsPayingWithWallet());
1472 1470
1473 // Shipping country should have stayed the same. 1471 // Shipping country should have stayed the same.
1474 EXPECT_EQ(ASCIIToUTF16("China"), 1472 EXPECT_EQ(ASCIIToUTF16("Belarus"),
1475 view->GetTextContentsOfInput(ADDRESS_HOME_COUNTRY)); 1473 view->GetTextContentsOfInput(ADDRESS_HOME_COUNTRY));
1476 ASSERT_TRUE( 1474 ASSERT_TRUE(SectionHasField(SECTION_SHIPPING, ADDRESS_HOME_SORTING_CODE));
1477 SectionHasField(SECTION_SHIPPING, ADDRESS_HOME_DEPENDENT_LOCALITY));
1478 1475
1479 controller()->MenuModelForSection(SECTION_BILLING)->ActivatedAt(1); 1476 controller()->MenuModelForSection(SECTION_BILLING)->ActivatedAt(1);
1480 view->SetTextContentsOfInput(ADDRESS_BILLING_COUNTRY, ASCIIToUTF16("China")); 1477 view->SetTextContentsOfInput(ADDRESS_BILLING_COUNTRY,
1478 ASCIIToUTF16("Belarus"));
1481 view->ActivateInput(ADDRESS_BILLING_COUNTRY); 1479 view->ActivateInput(ADDRESS_BILLING_COUNTRY);
1482 EXPECT_EQ(ASCIIToUTF16("China"), 1480 EXPECT_EQ(ASCIIToUTF16("Belarus"),
1483 view->GetTextContentsOfInput(ADDRESS_BILLING_COUNTRY)); 1481 view->GetTextContentsOfInput(ADDRESS_BILLING_COUNTRY));
1484 ASSERT_TRUE( 1482 ASSERT_TRUE(SectionHasField(SECTION_BILLING, ADDRESS_BILLING_SORTING_CODE));
1485 SectionHasField(SECTION_BILLING, ADDRESS_BILLING_DEPENDENT_LOCALITY));
1486 1483
1487 // Switch back to Wallet. Country should go back to US. 1484 // Switch back to Wallet. Country should go back to US.
1488 account_chooser->ActivatedAt(0); 1485 account_chooser->ActivatedAt(0);
1489 EXPECT_EQ(ASCIIToUTF16("United States"), 1486 EXPECT_EQ(ASCIIToUTF16("United States"),
1490 view->GetTextContentsOfInput(ADDRESS_BILLING_COUNTRY)); 1487 view->GetTextContentsOfInput(ADDRESS_BILLING_COUNTRY));
1491 ASSERT_FALSE( 1488 ASSERT_FALSE(
1492 SectionHasField(SECTION_CC_BILLING, ADDRESS_BILLING_DEPENDENT_LOCALITY)); 1489 SectionHasField(SECTION_CC_BILLING, ADDRESS_BILLING_SORTING_CODE));
1493 1490
1494 // Make sure shipping is still on China. 1491 // Make sure shipping is still on Belarus.
1495 EXPECT_EQ(ASCIIToUTF16("China"), 1492 EXPECT_EQ(ASCIIToUTF16("Belarus"),
1496 view->GetTextContentsOfInput(ADDRESS_HOME_COUNTRY)); 1493 view->GetTextContentsOfInput(ADDRESS_HOME_COUNTRY));
1497 ASSERT_TRUE( 1494 ASSERT_TRUE(SectionHasField(SECTION_SHIPPING, ADDRESS_HOME_SORTING_CODE));
1498 SectionHasField(SECTION_SHIPPING, ADDRESS_HOME_DEPENDENT_LOCALITY));
1499 } 1495 }
1500 1496
1501 IN_PROC_BROWSER_TEST_F(AutofillDialogControllerI18nTest, AddNewResetsCountry) { 1497 IN_PROC_BROWSER_TEST_F(AutofillDialogControllerI18nTest, AddNewResetsCountry) {
1502 AutofillProfile verified_profile(test::GetVerifiedProfile()); 1498 AutofillProfile verified_profile(test::GetVerifiedProfile());
1503 controller()->GetTestingManager()->AddTestingProfile(&verified_profile); 1499 controller()->GetTestingManager()->AddTestingProfile(&verified_profile);
1504 1500
1505 // Select "Add new billing/shipping address...". 1501 // Select "Add new billing/shipping address...".
1506 controller()->MenuModelForSection(SECTION_BILLING)->ActivatedAt(1); 1502 controller()->MenuModelForSection(SECTION_BILLING)->ActivatedAt(1);
1507 controller()->MenuModelForSection(SECTION_SHIPPING)->ActivatedAt(2); 1503 controller()->MenuModelForSection(SECTION_SHIPPING)->ActivatedAt(2);
1508 1504
1509 scoped_ptr<AutofillDialogViewTester> view = GetViewTester(); 1505 scoped_ptr<AutofillDialogViewTester> view = GetViewTester();
1510 ASSERT_EQ(ASCIIToUTF16("United States"), 1506 ASSERT_EQ(ASCIIToUTF16("United States"),
1511 view->GetTextContentsOfInput(ADDRESS_BILLING_COUNTRY)); 1507 view->GetTextContentsOfInput(ADDRESS_BILLING_COUNTRY));
1512 ASSERT_EQ(ASCIIToUTF16("United States"), 1508 ASSERT_EQ(ASCIIToUTF16("United States"),
1513 view->GetTextContentsOfInput(ADDRESS_HOME_COUNTRY)); 1509 view->GetTextContentsOfInput(ADDRESS_HOME_COUNTRY));
1514 1510
1515 // Switch both billing and shipping countries. 1511 // Switch both billing and shipping countries.
1516 view->SetTextContentsOfInput(ADDRESS_BILLING_COUNTRY, ASCIIToUTF16("China")); 1512 view->SetTextContentsOfInput(ADDRESS_BILLING_COUNTRY, ASCIIToUTF16("Brazil"));
1517 view->ActivateInput(ADDRESS_BILLING_COUNTRY); 1513 view->ActivateInput(ADDRESS_BILLING_COUNTRY);
1518 view->SetTextContentsOfInput(ADDRESS_HOME_COUNTRY, ASCIIToUTF16("France")); 1514 view->SetTextContentsOfInput(ADDRESS_HOME_COUNTRY, ASCIIToUTF16("France"));
1519 view->ActivateInput(ADDRESS_HOME_COUNTRY); 1515 view->ActivateInput(ADDRESS_HOME_COUNTRY);
1520 1516
1521 // Select "Add new billing/shipping address...". 1517 // Select "Add new billing/shipping address...".
1522 controller()->MenuModelForSection(SECTION_BILLING)->ActivatedAt(1); 1518 controller()->MenuModelForSection(SECTION_BILLING)->ActivatedAt(1);
1523 controller()->MenuModelForSection(SECTION_SHIPPING)->ActivatedAt(2); 1519 controller()->MenuModelForSection(SECTION_SHIPPING)->ActivatedAt(2);
1524 1520
1525 EXPECT_EQ(ASCIIToUTF16("United States"), 1521 EXPECT_EQ(ASCIIToUTF16("United States"),
1526 view->GetTextContentsOfInput(ADDRESS_BILLING_COUNTRY)); 1522 view->GetTextContentsOfInput(ADDRESS_BILLING_COUNTRY));
1527 EXPECT_EQ(ASCIIToUTF16("United States"), 1523 EXPECT_EQ(ASCIIToUTF16("United States"),
1528 view->GetTextContentsOfInput(ADDRESS_HOME_COUNTRY)); 1524 view->GetTextContentsOfInput(ADDRESS_HOME_COUNTRY));
1529 } 1525 }
1530 1526
1531 IN_PROC_BROWSER_TEST_F(AutofillDialogControllerI18nTest, 1527 IN_PROC_BROWSER_TEST_F(AutofillDialogControllerI18nTest,
1532 FillingFormRebuildsInputs) { 1528 FillingFormRebuildsInputs) {
1533 AutofillProfile full_profile(test::GetFullProfile()); 1529 AutofillProfile full_profile(test::GetFullProfile());
1534 full_profile.SetRawInfo(ADDRESS_HOME_COUNTRY, ASCIIToUTF16("CN")); 1530 full_profile.SetRawInfo(ADDRESS_HOME_COUNTRY, ASCIIToUTF16("DE"));
1535 controller()->GetTestingManager()->AddTestingProfile(&full_profile); 1531 controller()->GetTestingManager()->AddTestingProfile(&full_profile);
1536 1532
1537 // Select "Add new shipping address...". 1533 // Select "Add new shipping address...".
1538 controller()->MenuModelForSection(SECTION_SHIPPING)->ActivatedAt(1); 1534 controller()->MenuModelForSection(SECTION_SHIPPING)->ActivatedAt(1);
1539 1535
1540 scoped_ptr<AutofillDialogViewTester> view = GetViewTester(); 1536 scoped_ptr<AutofillDialogViewTester> view = GetViewTester();
1541 ASSERT_EQ(ASCIIToUTF16("United States"), 1537 ASSERT_EQ(ASCIIToUTF16("United States"),
1542 view->GetTextContentsOfInput(ADDRESS_BILLING_COUNTRY)); 1538 view->GetTextContentsOfInput(ADDRESS_BILLING_COUNTRY));
1543 ASSERT_EQ(ASCIIToUTF16("United States"), 1539 ASSERT_EQ(ASCIIToUTF16("United States"),
1544 view->GetTextContentsOfInput(ADDRESS_HOME_COUNTRY)); 1540 view->GetTextContentsOfInput(ADDRESS_HOME_COUNTRY));
1545 1541
1546 base::string16 name = full_profile.GetRawInfo(NAME_FULL); 1542 base::string16 name = full_profile.GetRawInfo(NAME_FULL);
1547 view->SetTextContentsOfInput(NAME_FULL, name.substr(0, name.size() / 2)); 1543 view->SetTextContentsOfInput(NAME_FULL, name.substr(0, name.size() / 2));
1548 view->ActivateInput(NAME_FULL); 1544 view->ActivateInput(NAME_FULL);
1549 ASSERT_EQ(NAME_FULL, controller()->popup_input_type()); 1545 ASSERT_EQ(NAME_FULL, controller()->popup_input_type());
1550 controller()->DidAcceptSuggestion(base::string16(), 0); 1546 controller()->DidAcceptSuggestion(base::string16(), 0);
1551 1547
1552 EXPECT_EQ(ASCIIToUTF16("China"), 1548 EXPECT_EQ(ASCIIToUTF16("Germany"),
1553 view->GetTextContentsOfInput(ADDRESS_BILLING_COUNTRY)); 1549 view->GetTextContentsOfInput(ADDRESS_BILLING_COUNTRY));
1554 EXPECT_EQ(ASCIIToUTF16("China"), 1550 EXPECT_EQ(ASCIIToUTF16("Germany"),
1555 view->GetTextContentsOfInput(ADDRESS_HOME_COUNTRY)); 1551 view->GetTextContentsOfInput(ADDRESS_HOME_COUNTRY));
1556 } 1552 }
1557 1553
1558 IN_PROC_BROWSER_TEST_F(AutofillDialogControllerI18nTest, 1554 IN_PROC_BROWSER_TEST_F(AutofillDialogControllerI18nTest,
1559 FillingFormPreservesChangedCountry) { 1555 FillingFormPreservesChangedCountry) {
1560 AutofillProfile full_profile(test::GetFullProfile()); 1556 AutofillProfile full_profile(test::GetFullProfile());
1561 full_profile.SetRawInfo(ADDRESS_HOME_COUNTRY, ASCIIToUTF16("CN")); 1557 full_profile.SetRawInfo(ADDRESS_HOME_COUNTRY, ASCIIToUTF16("DE"));
1562 controller()->GetTestingManager()->AddTestingProfile(&full_profile); 1558 controller()->GetTestingManager()->AddTestingProfile(&full_profile);
1563 1559
1564 // Select "Add new shipping address...". 1560 // Select "Add new shipping address...".
1565 controller()->MenuModelForSection(SECTION_SHIPPING)->ActivatedAt(1); 1561 controller()->MenuModelForSection(SECTION_SHIPPING)->ActivatedAt(1);
1566 1562
1567 scoped_ptr<AutofillDialogViewTester> view = GetViewTester(); 1563 scoped_ptr<AutofillDialogViewTester> view = GetViewTester();
1568 view->SetTextContentsOfInput(ADDRESS_BILLING_COUNTRY, ASCIIToUTF16("France")); 1564 view->SetTextContentsOfInput(ADDRESS_BILLING_COUNTRY, ASCIIToUTF16("France"));
1569 view->ActivateInput(ADDRESS_BILLING_COUNTRY); 1565 view->ActivateInput(ADDRESS_BILLING_COUNTRY);
1570 view->SetTextContentsOfInput(ADDRESS_HOME_COUNTRY, ASCIIToUTF16("Belarus")); 1566 view->SetTextContentsOfInput(ADDRESS_HOME_COUNTRY, ASCIIToUTF16("Belarus"));
1571 view->ActivateInput(ADDRESS_HOME_COUNTRY); 1567 view->ActivateInput(ADDRESS_HOME_COUNTRY);
1572 1568
1573 base::string16 name = full_profile.GetRawInfo(NAME_FULL); 1569 base::string16 name = full_profile.GetRawInfo(NAME_FULL);
1574 view->SetTextContentsOfInput(NAME_FULL, name.substr(0, name.size() / 2)); 1570 view->SetTextContentsOfInput(NAME_FULL, name.substr(0, name.size() / 2));
1575 view->ActivateInput(NAME_FULL); 1571 view->ActivateInput(NAME_FULL);
1576 ASSERT_EQ(NAME_FULL, controller()->popup_input_type()); 1572 ASSERT_EQ(NAME_FULL, controller()->popup_input_type());
1577 controller()->DidAcceptSuggestion(base::string16(), 0); 1573 controller()->DidAcceptSuggestion(base::string16(), 0);
1578 1574
1579 EXPECT_EQ(ASCIIToUTF16("France"), 1575 EXPECT_EQ(ASCIIToUTF16("France"),
1580 view->GetTextContentsOfInput(ADDRESS_BILLING_COUNTRY)); 1576 view->GetTextContentsOfInput(ADDRESS_BILLING_COUNTRY));
1581 EXPECT_EQ(ASCIIToUTF16("Belarus"), 1577 EXPECT_EQ(ASCIIToUTF16("Belarus"),
1582 view->GetTextContentsOfInput(ADDRESS_HOME_COUNTRY)); 1578 view->GetTextContentsOfInput(ADDRESS_HOME_COUNTRY));
1583 } 1579 }
1584 1580
1585 IN_PROC_BROWSER_TEST_F(AutofillDialogControllerI18nTest, RulesLoaded) { 1581 IN_PROC_BROWSER_TEST_F(AutofillDialogControllerI18nTest, RulesLoaded) {
1586 // Select "Add new shipping address...". 1582 // Select "Add new shipping address...".
1587 controller()->MenuModelForSection(SECTION_SHIPPING)->ActivatedAt(1); 1583 controller()->MenuModelForSection(SECTION_SHIPPING)->ActivatedAt(1);
1588 controller()->set_use_validation(true); 1584 controller()->set_use_validation(true);
1589 1585
1590 EXPECT_CALL(*controller()->GetMockValidator(), 1586 EXPECT_CALL(*controller()->GetMockValidator(),
1591 ValidateAddress(CountryCodeMatcher("CN"), _, _)).Times(2). 1587 ValidateAddress(CountryCodeMatcher("DE"), _, _)).Times(2).
1592 WillOnce(Return(AddressValidator::RULES_NOT_READY)); 1588 WillOnce(Return(AddressValidator::RULES_NOT_READY));
1593 1589
1594 // Validation should occur on country change and see the rules haven't loaded. 1590 // Validation should occur on country change and see the rules haven't loaded.
1595 scoped_ptr<AutofillDialogViewTester> view = GetViewTester(); 1591 scoped_ptr<AutofillDialogViewTester> view = GetViewTester();
1596 view->SetTextContentsOfInput(ADDRESS_HOME_ZIP, ASCIIToUTF16("123")); 1592 view->SetTextContentsOfInput(ADDRESS_HOME_ZIP, ASCIIToUTF16("123"));
1597 view->SetTextContentsOfInput(ADDRESS_HOME_COUNTRY, ASCIIToUTF16("China")); 1593 view->SetTextContentsOfInput(ADDRESS_HOME_COUNTRY, ASCIIToUTF16("Germany"));
1598 view->ActivateInput(ADDRESS_HOME_COUNTRY); 1594 view->ActivateInput(ADDRESS_HOME_COUNTRY);
1599 1595
1600 // Different country loaded, validation should not occur. 1596 // Different country loaded, validation should not occur.
1601 controller()->OnAddressValidationRulesLoaded("FR", true); 1597 controller()->OnAddressValidationRulesLoaded("FR", true);
1602 1598
1603 // Relevant country loaded, validation should occur. 1599 // Relevant country loaded, validation should occur.
1604 controller()->OnAddressValidationRulesLoaded("CN", true); 1600 controller()->OnAddressValidationRulesLoaded("DE", true);
1605 1601
1606 // Relevant country loaded but revalidation already happened, no further 1602 // Relevant country loaded but revalidation already happened, no further
1607 // validation should occur. 1603 // validation should occur.
1608 controller()->OnAddressValidationRulesLoaded("CN", false); 1604 controller()->OnAddressValidationRulesLoaded("DE", false);
1609 1605
1610 // Cancelling the dialog causes additional validation to see if the user 1606 // Cancelling the dialog causes additional validation to see if the user
1611 // cancelled with invalid fields, so verify and clear here. 1607 // cancelled with invalid fields, so verify and clear here.
1612 testing::Mock::VerifyAndClearExpectations(controller()->GetMockValidator()); 1608 testing::Mock::VerifyAndClearExpectations(controller()->GetMockValidator());
1613 } 1609 }
1614 1610
1615 } // namespace autofill 1611 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698