| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 // events to the popup directly. | 196 // events to the popup directly. |
| 197 content::WebContents* web_contents = | 197 content::WebContents* web_contents = |
| 198 browser()->tab_strip_model()->GetActiveWebContents(); | 198 browser()->tab_strip_model()->GetActiveWebContents(); |
| 199 AutofillManager* autofill_manager = | 199 AutofillManager* autofill_manager = |
| 200 AutofillManager::FromWebContents(web_contents); | 200 AutofillManager::FromWebContents(web_contents); |
| 201 external_delegate_.reset( | 201 external_delegate_.reset( |
| 202 new TestAutofillExternalDelegate(web_contents, autofill_manager)); | 202 new TestAutofillExternalDelegate(web_contents, autofill_manager)); |
| 203 autofill_manager->SetExternalDelegate(external_delegate_.get()); | 203 autofill_manager->SetExternalDelegate(external_delegate_.get()); |
| 204 } | 204 } |
| 205 | 205 |
| 206 virtual void CleanUpOnMainThread() OVERRIDE { | |
| 207 // Tear down the test external delegate while the UI is still up, as it | |
| 208 // might try to close the active popup if there still is one. | |
| 209 content::WebContents* web_contents = | |
| 210 browser()->tab_strip_model()->GetActiveWebContents(); | |
| 211 AutofillManager::FromWebContents(web_contents)->SetExternalDelegate(NULL); | |
| 212 external_delegate_.reset(); | |
| 213 } | |
| 214 | |
| 215 PersonalDataManager* personal_data_manager() { | 206 PersonalDataManager* personal_data_manager() { |
| 216 return PersonalDataManagerFactory::GetForProfile(browser()->profile()); | 207 return PersonalDataManagerFactory::GetForProfile(browser()->profile()); |
| 217 } | 208 } |
| 218 | 209 |
| 219 void CreateTestProfile() { | 210 void CreateTestProfile() { |
| 220 AutofillProfile profile; | 211 AutofillProfile profile; |
| 221 autofill_test::SetProfileInfo( | 212 autofill_test::SetProfileInfo( |
| 222 &profile, "Milton", "C.", "Waddams", | 213 &profile, "Milton", "C.", "Waddams", |
| 223 "red.swingline@initech.com", "Initech", "4120 Freidrich Lane", | 214 "red.swingline@initech.com", "Initech", "4120 Freidrich Lane", |
| 224 "Basement", "Austin", "Texas", "78744", "United States", "5125551234"); | 215 "Basement", "Austin", "Texas", "78744", "United States", "5125551234"); |
| (...skipping 1447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1672 // TODO(isherman): this looks redundant, consider removing. | 1663 // TODO(isherman): this looks redundant, consider removing. |
| 1673 // DISABLED: http://crbug.com/150084 | 1664 // DISABLED: http://crbug.com/150084 |
| 1674 IN_PROC_BROWSER_TEST_F(AutofillTest, | 1665 IN_PROC_BROWSER_TEST_F(AutofillTest, |
| 1675 DISABLED_MergeAggregatedDuplicatedProfiles) { | 1666 DISABLED_MergeAggregatedDuplicatedProfiles) { |
| 1676 int num_of_profiles = | 1667 int num_of_profiles = |
| 1677 AggregateProfilesIntoAutofillPrefs("dataset_no_address.txt"); | 1668 AggregateProfilesIntoAutofillPrefs("dataset_no_address.txt"); |
| 1678 | 1669 |
| 1679 ASSERT_GT(num_of_profiles, | 1670 ASSERT_GT(num_of_profiles, |
| 1680 static_cast<int>(personal_data_manager()->GetProfiles().size())); | 1671 static_cast<int>(personal_data_manager()->GetProfiles().size())); |
| 1681 } | 1672 } |
| OLD | NEW |