| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/scoped_temp_dir.h" | 9 #include "base/scoped_temp_dir.h" |
| 10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
| 11 #include "chrome/browser/search_engines/template_url.h" | 11 #include "chrome/browser/search_engines/template_url.h" |
| 12 #include "chrome/browser/search_engines/template_url_service.h" | 12 #include "chrome/browser/search_engines/template_url_service.h" |
| 13 #include "chrome/browser/search_engines/template_url_service_factory.h" | 13 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 14 #include "chrome/common/chrome_notification_types.h" | 14 #include "chrome/common/chrome_notification_types.h" |
| 15 #include "chrome/test/base/testing_profile.h" | 15 #include "chrome/test/base/testing_profile.h" |
| 16 #include "content/public/browser/notification_service.h" | 16 #include "content/public/browser/notification_service.h" |
| 17 #include "content/test/test_browser_thread.h" | 17 #include "content/test/test_browser_thread.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 19 | 19 |
| 20 using content::BrowserThread; |
| 21 |
| 20 namespace { | 22 namespace { |
| 21 | 23 |
| 22 // A Task used to coordinate when the database has finished processing | 24 // A Task used to coordinate when the database has finished processing |
| 23 // requests. See note in BlockTillServiceProcessesRequests for details. | 25 // requests. See note in BlockTillServiceProcessesRequests for details. |
| 24 // | 26 // |
| 25 // When Run() schedules a QuitTask on the message loop it was created with. | 27 // When Run() schedules a QuitTask on the message loop it was created with. |
| 26 class QuitTask2 : public Task { | 28 class QuitTask2 : public Task { |
| 27 public: | 29 public: |
| 28 QuitTask2() : main_loop_(MessageLoop::current()) {} | 30 QuitTask2() : main_loop_(MessageLoop::current()) {} |
| 29 | 31 |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 return TemplateURLServiceFactory::GetForProfile(profile()); | 244 return TemplateURLServiceFactory::GetForProfile(profile()); |
| 243 } | 245 } |
| 244 | 246 |
| 245 TestingProfile* TemplateURLServiceTestUtil::profile() const { | 247 TestingProfile* TemplateURLServiceTestUtil::profile() const { |
| 246 return profile_.get(); | 248 return profile_.get(); |
| 247 } | 249 } |
| 248 | 250 |
| 249 void TemplateURLServiceTestUtil::StartIOThread() { | 251 void TemplateURLServiceTestUtil::StartIOThread() { |
| 250 profile_->StartIOThread(); | 252 profile_->StartIOThread(); |
| 251 } | 253 } |
| OLD | NEW |