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 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 virtual ~AutofillManagerTest() { | 623 virtual ~AutofillManagerTest() { |
624 } | 624 } |
625 | 625 |
626 virtual void SetUp() OVERRIDE { | 626 virtual void SetUp() OVERRIDE { |
627 Profile* profile = new TestingProfile(); | 627 Profile* profile = new TestingProfile(); |
628 browser_context_.reset(profile); | 628 browser_context_.reset(profile); |
629 PersonalDataManagerFactory::GetInstance()->SetTestingFactory( | 629 PersonalDataManagerFactory::GetInstance()->SetTestingFactory( |
630 profile, TestPersonalDataManager::Build); | 630 profile, TestPersonalDataManager::Build); |
631 | 631 |
632 ChromeRenderViewHostTestHarness::SetUp(); | 632 ChromeRenderViewHostTestHarness::SetUp(); |
633 TabAutofillManagerDelegate::CreateForWebContents(web_contents()); | 633 autofill::TabAutofillManagerDelegate::CreateForWebContents(web_contents()); |
634 personal_data_.SetBrowserContext(profile); | 634 personal_data_.SetBrowserContext(profile); |
635 autofill_manager_ = new TestAutofillManager( | 635 autofill_manager_ = new TestAutofillManager( |
636 web_contents(), | 636 web_contents(), |
637 TabAutofillManagerDelegate::FromWebContents(web_contents()), | 637 autofill::TabAutofillManagerDelegate::FromWebContents(web_contents()), |
638 &personal_data_); | 638 &personal_data_); |
639 | 639 |
640 file_thread_.Start(); | 640 file_thread_.Start(); |
641 } | 641 } |
642 | 642 |
643 virtual void TearDown() OVERRIDE { | 643 virtual void TearDown() OVERRIDE { |
644 // Order of destruction is important as AutofillManager relies on | 644 // Order of destruction is important as AutofillManager relies on |
645 // PersonalDataManager to be around when it gets destroyed. Also, a real | 645 // PersonalDataManager to be around when it gets destroyed. Also, a real |
646 // AutofillManager is tied to the lifetime of the WebContents, so it must | 646 // AutofillManager is tied to the lifetime of the WebContents, so it must |
647 // be destroyed at the destruction of the WebContents. | 647 // be destroyed at the destruction of the WebContents. |
(...skipping 2589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3237 | 3237 |
3238 FormData form; | 3238 FormData form; |
3239 CreateTestAddressFormData(&form); | 3239 CreateTestAddressFormData(&form); |
3240 std::vector<FormData> forms(1, form); | 3240 std::vector<FormData> forms(1, form); |
3241 FormsSeen(forms); | 3241 FormsSeen(forms); |
3242 const FormFieldData& field = form.fields[0]; | 3242 const FormFieldData& field = form.fields[0]; |
3243 GetAutofillSuggestions(form, field); // should call the delegate's OnQuery() | 3243 GetAutofillSuggestions(form, field); // should call the delegate's OnQuery() |
3244 | 3244 |
3245 autofill_manager_->SetExternalDelegate(NULL); | 3245 autofill_manager_->SetExternalDelegate(NULL); |
3246 } | 3246 } |
OLD | NEW |