OLD | NEW |
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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
892 ExpectDomMessage("success"); | 892 ExpectDomMessage("success"); |
893 } | 893 } |
894 | 894 |
895 IN_PROC_BROWSER_TEST_F(AutofillDialogControllerTest, | 895 IN_PROC_BROWSER_TEST_F(AutofillDialogControllerTest, |
896 AutocompleteErrorEventReasonInvalid) { | 896 AutocompleteErrorEventReasonInvalid) { |
897 AutofillDialogControllerImpl* controller = | 897 AutofillDialogControllerImpl* controller = |
898 SetUpHtmlAndInvoke("<input autocomplete='cc-name' pattern='.*zebra.*'>"); | 898 SetUpHtmlAndInvoke("<input autocomplete='cc-name' pattern='.*zebra.*'>"); |
899 ASSERT_TRUE(controller); | 899 ASSERT_TRUE(controller); |
900 | 900 |
901 const CreditCard& credit_card = test::GetVerifiedCreditCard(); | 901 const CreditCard& credit_card = test::GetVerifiedCreditCard(); |
902 ASSERT_TRUE( | 902 ASSERT_TRUE(credit_card.GetRawInfo(CREDIT_CARD_NAME_FULL) |
903 credit_card.GetRawInfo(CREDIT_CARD_NAME).find(ASCIIToUTF16("zebra")) == | 903 .find(ASCIIToUTF16("zebra")) == base::string16::npos); |
904 base::string16::npos); | |
905 AddCreditcardToProfile(controller->profile(), credit_card); | 904 AddCreditcardToProfile(controller->profile(), credit_card); |
906 AddAutofillProfileToProfile(controller->profile(), | 905 AddAutofillProfileToProfile(controller->profile(), |
907 test::GetVerifiedProfile()); | 906 test::GetVerifiedProfile()); |
908 | 907 |
909 scoped_ptr<AutofillDialogViewTester> view = | 908 scoped_ptr<AutofillDialogViewTester> view = |
910 AutofillDialogViewTester::For(controller->view()); | 909 AutofillDialogViewTester::For(controller->view()); |
911 view->SetTextContentsOfSuggestionInput(SECTION_CC, ASCIIToUTF16("123")); | 910 view->SetTextContentsOfSuggestionInput(SECTION_CC, ASCIIToUTF16("123")); |
912 view->SubmitForTesting(); | 911 view->SubmitForTesting(); |
913 ExpectDomMessage("error: invalid"); | 912 ExpectDomMessage("error: invalid"); |
914 | 913 |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1325 ASSERT_TRUE(content::ExecuteScriptAndExtractString(GetRenderViewHost(), | 1324 ASSERT_TRUE(content::ExecuteScriptAndExtractString(GetRenderViewHost(), |
1326 "navigateFrame();", | 1325 "navigateFrame();", |
1327 &unused)); | 1326 &unused)); |
1328 ExpectDomMessage("iframe loaded"); | 1327 ExpectDomMessage("iframe loaded"); |
1329 ChromeAutofillClient* client = | 1328 ChromeAutofillClient* client = |
1330 ChromeAutofillClient::FromWebContents(GetActiveWebContents()); | 1329 ChromeAutofillClient::FromWebContents(GetActiveWebContents()); |
1331 EXPECT_FALSE(client->GetDialogControllerForTesting()); | 1330 EXPECT_FALSE(client->GetDialogControllerForTesting()); |
1332 } | 1331 } |
1333 | 1332 |
1334 } // namespace autofill | 1333 } // namespace autofill |
OLD | NEW |