Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(374)

Side by Side Diff: components/autofill/core/browser/autofill_manager_unittest.cc

Issue 17127002: Correctly integrate StoragePartition into TestingProfile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix InstantNTP test. Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698