| 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 <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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |