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

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

Issue 12476031: Refactor notifications of chrome/browser/webdata (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 7 years, 9 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 (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 <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/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/scoped_vector.h" 10 #include "base/memory/scoped_vector.h"
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 643
644 virtual void TearDown() OVERRIDE { 644 virtual void TearDown() OVERRIDE {
645 // Order of destruction is important as AutofillManager relies on 645 // Order of destruction is important as AutofillManager relies on
646 // PersonalDataManager to be around when it gets destroyed. Also, a real 646 // PersonalDataManager to be around when it gets destroyed. Also, a real
647 // AutofillManager is tied to the lifetime of the WebContents, so it must 647 // AutofillManager is tied to the lifetime of the WebContents, so it must
648 // be destroyed at the destruction of the WebContents. 648 // be destroyed at the destruction of the WebContents.
649 autofill_manager_.reset(); 649 autofill_manager_.reset();
650 file_thread_.Stop(); 650 file_thread_.Stop();
651 ChromeRenderViewHostTestHarness::TearDown(); 651 ChromeRenderViewHostTestHarness::TearDown();
652 io_thread_.Stop(); 652 io_thread_.Stop();
653
654 // Remove the BrowserContext so TestPersonalDataManager does not need to
655 // care about removing self as an observer in destruction.
656 personal_data_.SetBrowserContext(NULL);
653 } 657 }
654 658
655 virtual TestingProfile* CreateProfile() { 659 virtual TestingProfile* CreateProfile() {
656 return new TestingProfile(); 660 return new TestingProfile();
657 } 661 }
658 662
659 void UpdatePasswordGenerationState(bool new_renderer) { 663 void UpdatePasswordGenerationState(bool new_renderer) {
660 autofill_manager_->UpdatePasswordGenerationState(NULL, new_renderer); 664 autofill_manager_->UpdatePasswordGenerationState(NULL, new_renderer);
661 } 665 }
662 666
(...skipping 2556 matching lines...) Expand 10 before | Expand all | Expand 10 after
3219 3223
3220 FormData form; 3224 FormData form;
3221 CreateTestAddressFormData(&form); 3225 CreateTestAddressFormData(&form);
3222 std::vector<FormData> forms(1, form); 3226 std::vector<FormData> forms(1, form);
3223 FormsSeen(forms); 3227 FormsSeen(forms);
3224 const FormFieldData& field = form.fields[0]; 3228 const FormFieldData& field = form.fields[0];
3225 GetAutofillSuggestions(form, field); // should call the delegate's OnQuery() 3229 GetAutofillSuggestions(form, field); // should call the delegate's OnQuery()
3226 3230
3227 autofill_manager_->SetExternalDelegate(NULL); 3231 autofill_manager_->SetExternalDelegate(NULL);
3228 } 3232 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698