Chromium Code Reviews| 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 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 733 std::vector<int> autofill_unique_ids_; | 733 std::vector<int> autofill_unique_ids_; |
| 734 | 734 |
| 735 DISALLOW_COPY_AND_ASSIGN(TestAutofillExternalDelegate); | 735 DISALLOW_COPY_AND_ASSIGN(TestAutofillExternalDelegate); |
| 736 }; | 736 }; |
| 737 | 737 |
| 738 } // namespace | 738 } // namespace |
| 739 | 739 |
| 740 class AutofillManagerTest : public ChromeRenderViewHostTestHarness { | 740 class AutofillManagerTest : public ChromeRenderViewHostTestHarness { |
| 741 public: | 741 public: |
| 742 virtual void SetUp() OVERRIDE { | 742 virtual void SetUp() OVERRIDE { |
| 743 TestingProfile* profile = CreateProfile(); | 743 TestingProfile* profile = CreateProfile(); |
|
tfarina
2013/07/11 01:35:45
can we create TestBrowserContext now?
awong
2013/07/11 21:04:15
This ended up not being a super simple change so I
| |
| 744 profile->CreateRequestContext(); | |
| 745 browser_context_.reset(profile); | 744 browser_context_.reset(profile); |
| 746 autofill::PersonalDataManagerFactory::GetInstance()->SetTestingFactory( | 745 autofill::PersonalDataManagerFactory::GetInstance()->SetTestingFactory( |
| 747 profile, TestPersonalDataManager::Build); | 746 profile, TestPersonalDataManager::Build); |
| 748 | 747 |
| 749 ChromeRenderViewHostTestHarness::SetUp(); | 748 ChromeRenderViewHostTestHarness::SetUp(); |
| 750 | 749 |
| 751 autofill::TabAutofillManagerDelegate::CreateForWebContents(web_contents()); | 750 autofill::TabAutofillManagerDelegate::CreateForWebContents(web_contents()); |
| 752 | 751 |
| 753 personal_data_.SetBrowserContext(profile); | 752 personal_data_.SetBrowserContext(profile); |
| 754 autofill_driver_.reset(new MockAutofillDriver(web_contents())); | 753 autofill_driver_.reset(new MockAutofillDriver(web_contents())); |
| (...skipping 2518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3273 forms.push_back(user_supplied); | 3272 forms.push_back(user_supplied); |
| 3274 | 3273 |
| 3275 // FormStructure should contain the same forms as before. | 3274 // FormStructure should contain the same forms as before. |
| 3276 DynamicFormsSeen(forms); | 3275 DynamicFormsSeen(forms); |
| 3277 form_structures = autofill_manager_->GetFormStructures(); | 3276 form_structures = autofill_manager_->GetFormStructures(); |
| 3278 ASSERT_EQ(1U, form_structures.size()); | 3277 ASSERT_EQ(1U, form_structures.size()); |
| 3279 EXPECT_EQ("/form.html", form_structures[0]->source_url().path()); | 3278 EXPECT_EQ("/form.html", form_structures[0]->source_url().path()); |
| 3280 } | 3279 } |
| 3281 | 3280 |
| 3282 } // namespace autofill | 3281 } // namespace autofill |
| OLD | NEW |