| 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 "chrome/browser/search_engines/template_url_service_test_util.h" | 5 #include "chrome/browser/search_engines/template_url_service_test_util.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/threading/thread_task_runner_handle.h" | 9 #include "base/threading/thread_task_runner_handle.h" |
| 10 #include "chrome/browser/history/history_service_factory.h" | 10 #include "chrome/browser/history/history_service_factory.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 DISALLOW_COPY_AND_ASSIGN(TestingTemplateURLServiceClient); | 40 DISALLOW_COPY_AND_ASSIGN(TestingTemplateURLServiceClient); |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 } // namespace | 43 } // namespace |
| 44 | 44 |
| 45 TemplateURLServiceTestUtil::TemplateURLServiceTestUtil() | 45 TemplateURLServiceTestUtil::TemplateURLServiceTestUtil() |
| 46 : changed_count_(0), | 46 : changed_count_(0), |
| 47 search_terms_data_(NULL) { | 47 search_terms_data_(NULL) { |
| 48 // Make unique temp directory. | 48 // Make unique temp directory. |
| 49 EXPECT_TRUE(temp_dir_.CreateUniqueTempDir()); | 49 EXPECT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 50 profile_.reset(new TestingProfile(temp_dir_.path())); | 50 profile_.reset(new TestingProfile(temp_dir_.GetPath())); |
| 51 | 51 |
| 52 scoped_refptr<WebDatabaseService> web_database_service = | 52 scoped_refptr<WebDatabaseService> web_database_service = |
| 53 new WebDatabaseService(temp_dir_.path().AppendASCII("webdata"), | 53 new WebDatabaseService(temp_dir_.GetPath().AppendASCII("webdata"), |
| 54 base::ThreadTaskRunnerHandle::Get(), | 54 base::ThreadTaskRunnerHandle::Get(), |
| 55 base::ThreadTaskRunnerHandle::Get()); | 55 base::ThreadTaskRunnerHandle::Get()); |
| 56 web_database_service->AddTable( | 56 web_database_service->AddTable( |
| 57 std::unique_ptr<WebDatabaseTable>(new KeywordTable())); | 57 std::unique_ptr<WebDatabaseTable>(new KeywordTable())); |
| 58 web_database_service->LoadDatabase(); | 58 web_database_service->LoadDatabase(); |
| 59 | 59 |
| 60 web_data_service_ = new KeywordWebDataService( | 60 web_data_service_ = new KeywordWebDataService( |
| 61 web_database_service.get(), base::ThreadTaskRunnerHandle::Get(), | 61 web_database_service.get(), base::ThreadTaskRunnerHandle::Get(), |
| 62 KeywordWebDataService::ProfileErrorCallback()); | 62 KeywordWebDataService::ProfileErrorCallback()); |
| 63 web_data_service_->Init(); | 63 web_data_service_->Init(); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 DefaultSearchPrefTestUtil::SetManagedPref( | 153 DefaultSearchPrefTestUtil::SetManagedPref( |
| 154 profile()->GetTestingPrefService(), | 154 profile()->GetTestingPrefService(), |
| 155 enabled, name, keyword, search_url, suggest_url, icon_url, encodings, | 155 enabled, name, keyword, search_url, suggest_url, icon_url, encodings, |
| 156 alternate_url, search_terms_replacement_key); | 156 alternate_url, search_terms_replacement_key); |
| 157 } | 157 } |
| 158 | 158 |
| 159 void TemplateURLServiceTestUtil::RemoveManagedDefaultSearchPreferences() { | 159 void TemplateURLServiceTestUtil::RemoveManagedDefaultSearchPreferences() { |
| 160 DefaultSearchPrefTestUtil::RemoveManagedPref( | 160 DefaultSearchPrefTestUtil::RemoveManagedPref( |
| 161 profile()->GetTestingPrefService()); | 161 profile()->GetTestingPrefService()); |
| 162 } | 162 } |
| OLD | NEW |