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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/synchronization/waitable_event.h" | 10 #include "base/synchronization/waitable_event.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 base::Bind(&QuitCallback, MessageLoop::current())); | 49 base::Bind(&QuitCallback, MessageLoop::current())); |
50 MessageLoop::current()->Run(); | 50 MessageLoop::current()->Run(); |
51 } | 51 } |
52 | 52 |
53 } // namespace | 53 } // namespace |
54 | 54 |
55 // Trivial subclass of TemplateURLService that records the last invocation of | 55 // Trivial subclass of TemplateURLService that records the last invocation of |
56 // SetKeywordSearchTermsForURL. | 56 // SetKeywordSearchTermsForURL. |
57 class TestingTemplateURLService : public TemplateURLService { | 57 class TestingTemplateURLService : public TemplateURLService { |
58 public: | 58 public: |
59 static ProfileKeyedService* Build(content::BrowserContext* profile) { | 59 static BrowserContextKeyedService* Build(content::BrowserContext* profile) { |
60 return new TestingTemplateURLService(static_cast<Profile*>(profile)); | 60 return new TestingTemplateURLService(static_cast<Profile*>(profile)); |
61 } | 61 } |
62 | 62 |
63 explicit TestingTemplateURLService(Profile* profile) | 63 explicit TestingTemplateURLService(Profile* profile) |
64 : TemplateURLService(profile) { | 64 : TemplateURLService(profile) { |
65 } | 65 } |
66 | 66 |
67 string16 GetAndClearSearchTerm() { | 67 string16 GetAndClearSearchTerm() { |
68 string16 search_term; | 68 string16 search_term; |
69 search_term.swap(search_term_); | 69 search_term.swap(search_term_); |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 return profile_.get(); | 276 return profile_.get(); |
277 } | 277 } |
278 | 278 |
279 void TemplateURLServiceTestUtil::StartIOThread() { | 279 void TemplateURLServiceTestUtil::StartIOThread() { |
280 io_thread_.StartIOThread(); | 280 io_thread_.StartIOThread(); |
281 } | 281 } |
282 | 282 |
283 void TemplateURLServiceTestUtil::PumpLoop() { | 283 void TemplateURLServiceTestUtil::PumpLoop() { |
284 message_loop_.RunUntilIdle(); | 284 message_loop_.RunUntilIdle(); |
285 } | 285 } |
OLD | NEW |