diff options
Diffstat (limited to 'chrome/browser/autofill/autofill_manager_unittest.cc')
-rw-r--r-- | chrome/browser/autofill/autofill_manager_unittest.cc | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/chrome/browser/autofill/autofill_manager_unittest.cc b/chrome/browser/autofill/autofill_manager_unittest.cc index 8d18c04..9a97b76 100644 --- a/chrome/browser/autofill/autofill_manager_unittest.cc +++ b/chrome/browser/autofill/autofill_manager_unittest.cc @@ -7,8 +7,8 @@ #include "base/ref_counted.h" #include "base/scoped_ptr.h" #include "base/scoped_vector.h" -#include "base/string_number_conversions.h" #include "base/string16.h" +#include "base/string_number_conversions.h" #include "base/stringprintf.h" #include "base/tuple.h" #include "base/utf_string_conversions.h" @@ -39,7 +39,7 @@ using webkit_glue::FormField; namespace { -// The page ID sent to the AutoFillManager from the RenderView, used to send +// The page ID sent to the AutofillManager from the RenderView, used to send // an IPC message back to the renderer. const int kDefaultPageID = 137; @@ -402,11 +402,11 @@ void ExpectFilledCreditCardYearMonthWithYearMonth(int page_id, has_address_fields, true, true); } -class TestAutoFillManager : public AutoFillManager { +class TestAutofillManager : public AutofillManager { public: - TestAutoFillManager(TabContents* tab_contents, + TestAutofillManager(TabContents* tab_contents, TestPersonalDataManager* personal_manager) - : AutoFillManager(tab_contents, personal_manager), + : AutofillManager(tab_contents, personal_manager), autofill_enabled_(true) { test_personal_data_ = personal_manager; } @@ -450,16 +450,16 @@ class TestAutoFillManager : public AutoFillManager { TestPersonalDataManager* test_personal_data_; bool autofill_enabled_; - DISALLOW_COPY_AND_ASSIGN(TestAutoFillManager); + DISALLOW_COPY_AND_ASSIGN(TestAutofillManager); }; } // namespace -class AutoFillManagerTest : public RenderViewHostTestHarness { +class AutofillManagerTest : public RenderViewHostTestHarness { public: - AutoFillManagerTest() {} - virtual ~AutoFillManagerTest() { - // Order of destruction is important as AutoFillManager relies on + AutofillManagerTest() {} + virtual ~AutofillManagerTest() { + // Order of destruction is important as AutofillManager relies on // PersonalDataManager to be around when it gets destroyed. autofill_manager_.reset(NULL); test_personal_data_ = NULL; @@ -468,7 +468,7 @@ class AutoFillManagerTest : public RenderViewHostTestHarness { virtual void SetUp() { RenderViewHostTestHarness::SetUp(); test_personal_data_ = new TestPersonalDataManager(); - autofill_manager_.reset(new TestAutoFillManager(contents(), + autofill_manager_.reset(new TestAutofillManager(contents(), test_personal_data_.get())); } @@ -549,16 +549,16 @@ class AutoFillManagerTest : public RenderViewHostTestHarness { } protected: - scoped_ptr<TestAutoFillManager> autofill_manager_; + scoped_ptr<TestAutofillManager> autofill_manager_; scoped_refptr<TestPersonalDataManager> test_personal_data_; private: - DISALLOW_COPY_AND_ASSIGN(AutoFillManagerTest); + DISALLOW_COPY_AND_ASSIGN(AutofillManagerTest); }; // Test that we return all address profile suggestions when all form fields are // empty. -TEST_F(AutoFillManagerTest, GetProfileSuggestionsEmptyValue) { +TEST_F(AutofillManagerTest, GetProfileSuggestionsEmptyValue) { // Set up our form data. FormData form; CreateTestAddressFormData(&form); @@ -600,7 +600,7 @@ TEST_F(AutoFillManagerTest, GetProfileSuggestionsEmptyValue) { // Test that we return only matching address profile suggestions when the // selected form field has been partially filled out. -TEST_F(AutoFillManagerTest, GetProfileSuggestionsMatchCharacter) { +TEST_F(AutofillManagerTest, GetProfileSuggestionsMatchCharacter) { // Set up our form data. FormData form; CreateTestAddressFormData(&form); @@ -635,7 +635,7 @@ TEST_F(AutoFillManagerTest, GetProfileSuggestionsMatchCharacter) { } // Test that we return no suggestions when the form has no relevant fields. -TEST_F(AutoFillManagerTest, GetProfileSuggestionsUnknownFields) { +TEST_F(AutofillManagerTest, GetProfileSuggestionsUnknownFields) { // Set up our form data. FormData form; form.name = ASCIIToUTF16("MyForm"); @@ -664,7 +664,7 @@ TEST_F(AutoFillManagerTest, GetProfileSuggestionsUnknownFields) { } // Test that we cull duplicate profile suggestions. -TEST_F(AutoFillManagerTest, GetProfileSuggestionsWithDuplicates) { +TEST_F(AutofillManagerTest, GetProfileSuggestionsWithDuplicates) { // Set up our form data. FormData form; CreateTestAddressFormData(&form); @@ -709,7 +709,7 @@ TEST_F(AutoFillManagerTest, GetProfileSuggestionsWithDuplicates) { } // Test that we return no suggestions when autofill is disabled. -TEST_F(AutoFillManagerTest, GetProfileSuggestionsAutofillDisabledByUser) { +TEST_F(AutofillManagerTest, GetProfileSuggestionsAutofillDisabledByUser) { // Set up our form data. FormData form; CreateTestAddressFormData(&form); @@ -726,7 +726,7 @@ TEST_F(AutoFillManagerTest, GetProfileSuggestionsAutofillDisabledByUser) { // Test that we return a warning explaining that autofill suggestions are // unavailable when the form method is GET rather than POST. -TEST_F(AutoFillManagerTest, GetProfileSuggestionsMethodGet) { +TEST_F(AutofillManagerTest, GetProfileSuggestionsMethodGet) { // Set up our form data. FormData form; CreateTestAddressFormData(&form); @@ -793,7 +793,7 @@ TEST_F(AutoFillManagerTest, GetProfileSuggestionsMethodGet) { // Test that we return all credit card profile suggestions when all form fields // are empty. -TEST_F(AutoFillManagerTest, GetCreditCardSuggestionsEmptyValue) { +TEST_F(AutofillManagerTest, GetCreditCardSuggestionsEmptyValue) { // Set up our form data. FormData form; CreateTestCreditCardFormData(&form, true, false); @@ -836,7 +836,7 @@ TEST_F(AutoFillManagerTest, GetCreditCardSuggestionsEmptyValue) { // Test that we return only matching credit card profile suggestions when the // selected form field has been partially filled out. -TEST_F(AutoFillManagerTest, GetCreditCardSuggestionsMatchCharacter) { +TEST_F(AutofillManagerTest, GetCreditCardSuggestionsMatchCharacter) { // Set up our form data. FormData form; CreateTestCreditCardFormData(&form, true, false); @@ -872,7 +872,7 @@ TEST_F(AutoFillManagerTest, GetCreditCardSuggestionsMatchCharacter) { // Test that we return credit card profile suggestions when the selected form // field is not the credit card number field. -TEST_F(AutoFillManagerTest, GetCreditCardSuggestionsNonCCNumber) { +TEST_F(AutofillManagerTest, GetCreditCardSuggestionsNonCCNumber) { // Set up our form data. FormData form; CreateTestCreditCardFormData(&form, true, false); @@ -915,7 +915,7 @@ TEST_F(AutoFillManagerTest, GetCreditCardSuggestionsNonCCNumber) { // Test that we return a warning explaining that credit card profile suggestions // are unavailable when the form is not https. -TEST_F(AutoFillManagerTest, GetCreditCardSuggestionsNonHTTPS) { +TEST_F(AutofillManagerTest, GetCreditCardSuggestionsNonHTTPS) { // Set up our form data. FormData form; CreateTestCreditCardFormData(&form, false, false); @@ -979,7 +979,7 @@ TEST_F(AutoFillManagerTest, GetCreditCardSuggestionsNonHTTPS) { } // Test that we return profile and credit card suggestions for combined forms. -TEST_F(AutoFillManagerTest, GetAddressAndCreditCardSuggestions) { +TEST_F(AutofillManagerTest, GetAddressAndCreditCardSuggestions) { // Set up our form data. FormData form; CreateTestAddressFormData(&form); @@ -1053,7 +1053,7 @@ TEST_F(AutoFillManagerTest, GetAddressAndCreditCardSuggestions) { // only return address suggestions. Instead of credit card suggestions, we // should return a warning explaining that credit card profile suggestions are // unavailable when the form is not https. -TEST_F(AutoFillManagerTest, GetAddressAndCreditCardSuggestionsNonHttps) { +TEST_F(AutofillManagerTest, GetAddressAndCreditCardSuggestionsNonHttps) { // Set up our form data. FormData form; CreateTestAddressFormData(&form); @@ -1121,7 +1121,7 @@ TEST_F(AutoFillManagerTest, GetAddressAndCreditCardSuggestionsNonHttps) { } // Test that we correctly combine autofill and autocomplete suggestions. -TEST_F(AutoFillManagerTest, GetCombinedAutoFillAndAutocompleteSuggestions) { +TEST_F(AutofillManagerTest, GetCombinedAutoFillAndAutocompleteSuggestions) { // Set up our form data. FormData form; CreateTestAddressFormData(&form); @@ -1170,7 +1170,7 @@ TEST_F(AutoFillManagerTest, GetCombinedAutoFillAndAutocompleteSuggestions) { // Test that we return autocomplete-like suggestions when trying to autofill // already filled forms. -TEST_F(AutoFillManagerTest, GetFieldSuggestionsWhenFormIsAutoFilled) { +TEST_F(AutofillManagerTest, GetFieldSuggestionsWhenFormIsAutoFilled) { // Set up our form data. FormData form; CreateTestAddressFormData(&form); @@ -1208,7 +1208,7 @@ TEST_F(AutoFillManagerTest, GetFieldSuggestionsWhenFormIsAutoFilled) { // Test that nothing breaks when there are autocomplete suggestions but no // autofill suggestions. -TEST_F(AutoFillManagerTest, GetFieldSuggestionsForAutocompleteOnly) { +TEST_F(AutofillManagerTest, GetFieldSuggestionsForAutocompleteOnly) { // Set up our form data. FormData form; CreateTestAddressFormData(&form); @@ -1251,7 +1251,7 @@ TEST_F(AutoFillManagerTest, GetFieldSuggestionsForAutocompleteOnly) { // Test that we do not return duplicate values drawn from multiple profiles when // filling an already filled field. -TEST_F(AutoFillManagerTest, GetFieldSuggestionsWithDuplicateValues) { +TEST_F(AutofillManagerTest, GetFieldSuggestionsWithDuplicateValues) { // Set up our form data. FormData form; CreateTestAddressFormData(&form); @@ -1295,7 +1295,7 @@ TEST_F(AutoFillManagerTest, GetFieldSuggestionsWithDuplicateValues) { } // Test that we correctly fill an address form. -TEST_F(AutoFillManagerTest, FillAddressForm) { +TEST_F(AutofillManagerTest, FillAddressForm) { // Set up our form data. FormData form; CreateTestAddressFormData(&form); @@ -1314,7 +1314,7 @@ TEST_F(AutoFillManagerTest, FillAddressForm) { } // Test that we correctly fill a credit card form. -TEST_F(AutoFillManagerTest, FillCreditCardForm) { +TEST_F(AutofillManagerTest, FillCreditCardForm) { // Set up our form data. FormData form; CreateTestCreditCardFormData(&form, true, false); @@ -1334,7 +1334,7 @@ TEST_F(AutoFillManagerTest, FillCreditCardForm) { // Test that we correctly fill a credit card form with month input type. // 1. year empty, month empty -TEST_F(AutoFillManagerTest, FillCreditCardFormNoYearNoMonth) { +TEST_F(AutofillManagerTest, FillCreditCardFormNoYearNoMonth) { // Same as the SetUp(), but generate 4 credit cards with year month // combination. test_personal_data_->CreateTestCreditCardsYearAndMonth("", ""); @@ -1359,7 +1359,7 @@ TEST_F(AutoFillManagerTest, FillCreditCardFormNoYearNoMonth) { // Test that we correctly fill a credit card form with month input type. // 2. year empty, month non-empty -TEST_F(AutoFillManagerTest, FillCreditCardFormNoYearMonth) { +TEST_F(AutofillManagerTest, FillCreditCardFormNoYearMonth) { // Same as the SetUp(), but generate 4 credit cards with year month // combination. test_personal_data_->CreateTestCreditCardsYearAndMonth("", "04"); @@ -1383,7 +1383,7 @@ TEST_F(AutoFillManagerTest, FillCreditCardFormNoYearMonth) { // Test that we correctly fill a credit card form with month input type. // 3. year non-empty, month empty -TEST_F(AutoFillManagerTest, FillCreditCardFormYearNoMonth) { +TEST_F(AutofillManagerTest, FillCreditCardFormYearNoMonth) { // Same as the SetUp(), but generate 4 credit cards with year month // combination. test_personal_data_->CreateTestCreditCardsYearAndMonth("2012", ""); @@ -1407,7 +1407,7 @@ TEST_F(AutoFillManagerTest, FillCreditCardFormYearNoMonth) { // Test that we correctly fill a credit card form with month input type. // 4. year non-empty, month empty -TEST_F(AutoFillManagerTest, FillCreditCardFormYearMonth) { +TEST_F(AutofillManagerTest, FillCreditCardFormYearMonth) { // Same as the SetUp(), but generate 4 credit cards with year month // combination. test_personal_data_->ClearCreditCards(); @@ -1431,7 +1431,7 @@ TEST_F(AutoFillManagerTest, FillCreditCardFormYearMonth) { } // Test that we correctly fill a combined address and credit card form. -TEST_F(AutoFillManagerTest, FillAddressAndCreditCardForm) { +TEST_F(AutofillManagerTest, FillAddressAndCreditCardForm) { // Set up our form data. FormData form; CreateTestAddressFormData(&form); @@ -1469,7 +1469,7 @@ TEST_F(AutoFillManagerTest, FillAddressAndCreditCardForm) { // Test that we correctly fill a form that has multiple logical sections, e.g. // both a billing and a shipping address. -TEST_F(AutoFillManagerTest, FillFormWithMultipleSections) { +TEST_F(AutofillManagerTest, FillFormWithMultipleSections) { // Set up our form data. FormData form; CreateTestAddressFormData(&form); @@ -1539,7 +1539,7 @@ TEST_F(AutoFillManagerTest, FillFormWithMultipleSections) { } // Test that we correctly fill a previously auto-filled form. -TEST_F(AutoFillManagerTest, FillAutoFilledForm) { +TEST_F(AutofillManagerTest, FillAutoFilledForm) { // Set up our form data. FormData form; CreateTestAddressFormData(&form); @@ -1603,7 +1603,7 @@ TEST_F(AutoFillManagerTest, FillAutoFilledForm) { } // Test that we correctly fill a phone number split across multiple fields. -TEST_F(AutoFillManagerTest, FillPhoneNumber) { +TEST_F(AutofillManagerTest, FillPhoneNumber) { // Set up our form data. FormData form; form.name = ASCIIToUTF16("MyPhoneForm"); @@ -1648,7 +1648,7 @@ TEST_F(AutoFillManagerTest, FillPhoneNumber) { test_data[i] = 0; SCOPED_TRACE(StringPrintf("Testing phone: %s", test_data)); work_profile->SetInfo(phone_type, ASCIIToUTF16(test_data)); - // The page ID sent to the AutoFillManager from the RenderView, used to send + // The page ID sent to the AutofillManager from the RenderView, used to send // an IPC message back to the renderer. int page_id = 100 - i; FillAutoFillFormData( @@ -1672,7 +1672,7 @@ TEST_F(AutoFillManagerTest, FillPhoneNumber) { } // Test that we can still fill a form when a field has been removed from it. -TEST_F(AutoFillManagerTest, FormChangesRemoveField) { +TEST_F(AutofillManagerTest, FormChangesRemoveField) { // Set up our form data. FormData form; CreateTestAddressFormData(&form); @@ -1700,7 +1700,7 @@ TEST_F(AutoFillManagerTest, FormChangesRemoveField) { } // Test that we can still fill a form when a field has been added to it. -TEST_F(AutoFillManagerTest, FormChangesAddField) { +TEST_F(AutofillManagerTest, FormChangesAddField) { // The offset of the fax field in the address form. const int kFaxFieldOffset = 10; @@ -1732,7 +1732,7 @@ TEST_F(AutoFillManagerTest, FormChangesAddField) { // Checks that resetting the auxiliary profile enabled preference does the right // thing on all platforms. -TEST_F(AutoFillManagerTest, AuxiliaryProfilesReset) { +TEST_F(AutofillManagerTest, AuxiliaryProfilesReset) { #if defined(OS_MACOSX) // Auxiliary profiles is implemented on Mac only. It enables Mac Address // Book integration. |