| 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 "chrome/browser/search/instant_unittest_base.h" | 5 #include "chrome/browser/search/instant_unittest_base.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 10 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 11 #include "chrome/browser/chrome_notification_types.h" | 12 #include "chrome/browser/chrome_notification_types.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/browser/search/instant_service.h" | 14 #include "chrome/browser/search/instant_service.h" |
| 14 #include "chrome/browser/search/instant_service_factory.h" | 15 #include "chrome/browser/search/instant_service_factory.h" |
| 15 #include "chrome/browser/search/search.h" | 16 #include "chrome/browser/search/search.h" |
| 16 #include "chrome/browser/search_engines/template_url_service_factory.h" | 17 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 17 #include "chrome/browser/search_engines/ui_thread_search_terms_data.h" | 18 #include "chrome/browser/search_engines/ui_thread_search_terms_data.h" |
| 18 #include "chrome/test/base/browser_with_test_window_test.h" | 19 #include "chrome/test/base/browser_with_test_window_test.h" |
| 19 #include "chrome/test/base/search_test_utils.h" | 20 #include "chrome/test/base/search_test_utils.h" |
| 20 #include "components/google/core/browser/google_pref_names.h" | 21 #include "components/google/core/browser/google_pref_names.h" |
| 21 #include "components/google/core/browser/google_url_tracker.h" | 22 #include "components/google/core/browser/google_url_tracker.h" |
| 22 #include "components/search/search.h" | 23 #include "components/search/search.h" |
| 23 #include "components/search_engines/template_url.h" | 24 #include "components/search_engines/template_url.h" |
| 24 #include "components/search_engines/template_url_service.h" | 25 #include "components/search_engines/template_url_service.h" |
| 25 #include "components/variations/entropy_provider.h" | 26 #include "components/variations/entropy_provider.h" |
| 26 | 27 |
| 27 InstantUnitTestBase::InstantUnitTestBase() { | 28 InstantUnitTestBase::InstantUnitTestBase() { |
| 28 field_trial_list_.reset(new base::FieldTrialList( | 29 field_trial_list_.reset(new base::FieldTrialList( |
| 29 new metrics::SHA1EntropyProvider("42"))); | 30 base::MakeUnique<metrics::SHA1EntropyProvider>("42"))); |
| 30 } | 31 } |
| 31 | 32 |
| 32 InstantUnitTestBase::~InstantUnitTestBase() { | 33 InstantUnitTestBase::~InstantUnitTestBase() { |
| 33 } | 34 } |
| 34 | 35 |
| 35 void InstantUnitTestBase::SetUp() { | 36 void InstantUnitTestBase::SetUp() { |
| 36 BrowserWithTestWindowTest::SetUp(); | 37 BrowserWithTestWindowTest::SetUp(); |
| 37 | 38 |
| 38 template_url_service_ = TemplateURLServiceFactory::GetForProfile(profile()); | 39 template_url_service_ = TemplateURLServiceFactory::GetForProfile(profile()); |
| 39 search_test_utils::WaitForTemplateURLServiceToLoad(template_url_service_); | 40 search_test_utils::WaitForTemplateURLServiceToLoad(template_url_service_); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 const InstantServiceObserver* observer) const { | 81 const InstantServiceObserver* observer) const { |
| 81 return instant_service_->observers_.HasObserver(observer); | 82 return instant_service_->observers_.HasObserver(observer); |
| 82 } | 83 } |
| 83 | 84 |
| 84 TestingProfile* InstantUnitTestBase::CreateProfile() { | 85 TestingProfile* InstantUnitTestBase::CreateProfile() { |
| 85 TestingProfile* profile = BrowserWithTestWindowTest::CreateProfile(); | 86 TestingProfile* profile = BrowserWithTestWindowTest::CreateProfile(); |
| 86 TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse( | 87 TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse( |
| 87 profile, &TemplateURLServiceFactory::BuildInstanceFor); | 88 profile, &TemplateURLServiceFactory::BuildInstanceFor); |
| 88 return profile; | 89 return profile; |
| 89 } | 90 } |
| OLD | NEW |