OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <algorithm> | 5 #include <algorithm> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.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 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 // be destroyed at the destruction of the WebContents. | 763 // be destroyed at the destruction of the WebContents. |
764 autofill_manager_.reset(); | 764 autofill_manager_.reset(); |
765 autofill_driver_.reset(); | 765 autofill_driver_.reset(); |
766 ChromeRenderViewHostTestHarness::TearDown(); | 766 ChromeRenderViewHostTestHarness::TearDown(); |
767 | 767 |
768 // Remove the BrowserContext so TestPersonalDataManager does not need to | 768 // Remove the BrowserContext so TestPersonalDataManager does not need to |
769 // care about removing self as an observer in destruction. | 769 // care about removing self as an observer in destruction. |
770 personal_data_.SetBrowserContext(NULL); | 770 personal_data_.SetBrowserContext(NULL); |
771 } | 771 } |
772 | 772 |
773 virtual content::BrowserContext* CreateBrowserContext() OVERRIDE { | |
774 TestingProfile* profile = new TestingProfile(); | |
775 profile->CreateRequestContext(); | |
776 return profile; | |
777 } | |
778 | |
779 void GetAutofillSuggestions(int query_id, | 773 void GetAutofillSuggestions(int query_id, |
780 const FormData& form, | 774 const FormData& form, |
781 const FormFieldData& field) { | 775 const FormFieldData& field) { |
782 autofill_manager_->OnQueryFormFieldAutofill(query_id, | 776 autofill_manager_->OnQueryFormFieldAutofill(query_id, |
783 form, | 777 form, |
784 field, | 778 field, |
785 gfx::Rect(), | 779 gfx::Rect(), |
786 false); | 780 false); |
787 } | 781 } |
788 | 782 |
(...skipping 2478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3267 forms.push_back(user_supplied); | 3261 forms.push_back(user_supplied); |
3268 | 3262 |
3269 // FormStructure should contain the same forms as before. | 3263 // FormStructure should contain the same forms as before. |
3270 DynamicFormsSeen(forms); | 3264 DynamicFormsSeen(forms); |
3271 form_structures = autofill_manager_->GetFormStructures(); | 3265 form_structures = autofill_manager_->GetFormStructures(); |
3272 ASSERT_EQ(1U, form_structures.size()); | 3266 ASSERT_EQ(1U, form_structures.size()); |
3273 EXPECT_EQ("/form.html", form_structures[0]->source_url().path()); | 3267 EXPECT_EQ("/form.html", form_structures[0]->source_url().path()); |
3274 } | 3268 } |
3275 | 3269 |
3276 } // namespace autofill | 3270 } // namespace autofill |
OLD | NEW |