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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/autofill/autofill_manager.h" | 10 #include "chrome/browser/autofill/autofill_manager.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 FormStructureBrowserTest::~FormStructureBrowserTest() { | 54 FormStructureBrowserTest::~FormStructureBrowserTest() { |
55 } | 55 } |
56 | 56 |
57 void FormStructureBrowserTest::GenerateResults(const std::string& input, | 57 void FormStructureBrowserTest::GenerateResults(const std::string& input, |
58 std::string* output) { | 58 std::string* output) { |
59 ASSERT_NO_FATAL_FAILURE(ui_test_utils::NavigateToURL(browser(), | 59 ASSERT_NO_FATAL_FAILURE(ui_test_utils::NavigateToURL(browser(), |
60 HTMLToDataURI(input))); | 60 HTMLToDataURI(input))); |
61 | 61 |
62 AutofillManager* autofill_manager = | 62 AutofillManager* autofill_manager = |
63 chrome::GetActiveTabContents(browser())->autofill_manager(); | 63 AutofillManager::FromWebContents(chrome::GetActiveWebContents(browser())); |
64 ASSERT_NE(static_cast<AutofillManager*>(NULL), autofill_manager); | 64 ASSERT_NE(static_cast<AutofillManager*>(NULL), autofill_manager); |
65 std::vector<FormStructure*> forms = autofill_manager->form_structures_.get(); | 65 std::vector<FormStructure*> forms = autofill_manager->form_structures_.get(); |
66 *output = FormStructureBrowserTest::FormStructuresToString(forms); | 66 *output = FormStructureBrowserTest::FormStructuresToString(forms); |
67 } | 67 } |
68 | 68 |
69 std::string FormStructureBrowserTest::FormStructuresToString( | 69 std::string FormStructureBrowserTest::FormStructuresToString( |
70 const std::vector<FormStructure*>& forms) { | 70 const std::vector<FormStructure*>& forms) { |
71 std::string forms_string; | 71 std::string forms_string; |
72 for (std::vector<FormStructure*>::const_iterator iter = forms.begin(); | 72 for (std::vector<FormStructure*>::const_iterator iter = forms.begin(); |
73 iter != forms.end(); | 73 iter != forms.end(); |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 kFileNamePattern); | 237 kFileNamePattern); |
238 } | 238 } |
239 | 239 |
240 IN_PROC_BROWSER_TEST_F(FormStructureBrowserTest, | 240 IN_PROC_BROWSER_TEST_F(FormStructureBrowserTest, |
241 MAYBE_DataDrivenHeuristics(20)) { | 241 MAYBE_DataDrivenHeuristics(20)) { |
242 const FilePath::CharType kFileNamePattern[] = FILE_PATH_LITERAL("20_*.html"); | 242 const FilePath::CharType kFileNamePattern[] = FILE_PATH_LITERAL("20_*.html"); |
243 RunDataDrivenTest(GetInputDirectory(kTestName), | 243 RunDataDrivenTest(GetInputDirectory(kTestName), |
244 GetOutputDirectory(kTestName), | 244 GetOutputDirectory(kTestName), |
245 kFileNamePattern); | 245 kFileNamePattern); |
246 } | 246 } |
OLD | NEW |