| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/ref_counted.h" | 7 #include "base/ref_counted.h" |
| 8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
| 9 #include "base/scoped_vector.h" | 9 #include "base/scoped_vector.h" |
| 10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| (...skipping 1637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1648 FormsSeen(forms); | 1648 FormsSeen(forms); |
| 1649 | 1649 |
| 1650 AutoFillProfile *work_profile = autofill_manager_->GetLabeledProfile("Work"); | 1650 AutoFillProfile *work_profile = autofill_manager_->GetLabeledProfile("Work"); |
| 1651 ASSERT_TRUE(work_profile != NULL); | 1651 ASSERT_TRUE(work_profile != NULL); |
| 1652 const AutoFillType phone_type(PHONE_HOME_NUMBER); | 1652 const AutoFillType phone_type(PHONE_HOME_NUMBER); |
| 1653 string16 saved_phone = work_profile->GetFieldText(phone_type); | 1653 string16 saved_phone = work_profile->GetFieldText(phone_type); |
| 1654 | 1654 |
| 1655 char test_data[] = "1234567890123456"; | 1655 char test_data[] = "1234567890123456"; |
| 1656 for (int i = arraysize(test_data) - 1; i >= 0; --i) { | 1656 for (int i = arraysize(test_data) - 1; i >= 0; --i) { |
| 1657 test_data[i] = 0; | 1657 test_data[i] = 0; |
| 1658 SCOPED_TRACE(StringPrintf("Testing phone: %s", test_data)); |
| 1658 work_profile->SetInfo(phone_type, ASCIIToUTF16(test_data)); | 1659 work_profile->SetInfo(phone_type, ASCIIToUTF16(test_data)); |
| 1659 // The page ID sent to the AutoFillManager from the RenderView, used to send | 1660 // The page ID sent to the AutoFillManager from the RenderView, used to send |
| 1660 // an IPC message back to the renderer. | 1661 // an IPC message back to the renderer. |
| 1661 int page_id = 100 - i; | 1662 int page_id = 100 - i; |
| 1662 FillAutoFillFormData( | 1663 FillAutoFillFormData( |
| 1663 page_id, form, *form.fields.begin(), | 1664 page_id, form, *form.fields.begin(), |
| 1664 autofill_manager_->PackGUIDs(std::string(), work_profile->guid())); | 1665 autofill_manager_->PackGUIDs(std::string(), work_profile->guid())); |
| 1665 page_id = 0; | 1666 page_id = 0; |
| 1666 FormData results; | 1667 FormData results; |
| 1667 EXPECT_TRUE(GetAutoFillFormDataFilledMessage(&page_id, &results)); | 1668 EXPECT_TRUE(GetAutoFillFormDataFilledMessage(&page_id, &results)); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1754 #else | 1755 #else |
| 1755 ASSERT_FALSE(profile()->GetPrefs()->GetBoolean( | 1756 ASSERT_FALSE(profile()->GetPrefs()->GetBoolean( |
| 1756 prefs::kAutoFillAuxiliaryProfilesEnabled)); | 1757 prefs::kAutoFillAuxiliaryProfilesEnabled)); |
| 1757 profile()->GetPrefs()->SetBoolean( | 1758 profile()->GetPrefs()->SetBoolean( |
| 1758 prefs::kAutoFillAuxiliaryProfilesEnabled, true); | 1759 prefs::kAutoFillAuxiliaryProfilesEnabled, true); |
| 1759 profile()->GetPrefs()->ClearPref(prefs::kAutoFillAuxiliaryProfilesEnabled); | 1760 profile()->GetPrefs()->ClearPref(prefs::kAutoFillAuxiliaryProfilesEnabled); |
| 1760 ASSERT_FALSE(profile()->GetPrefs()->GetBoolean( | 1761 ASSERT_FALSE(profile()->GetPrefs()->GetBoolean( |
| 1761 prefs::kAutoFillAuxiliaryProfilesEnabled)); | 1762 prefs::kAutoFillAuxiliaryProfilesEnabled)); |
| 1762 #endif | 1763 #endif |
| 1763 } | 1764 } |
| OLD | NEW |