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" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 service->AddObserver(this); | 159 service->AddObserver(this); |
160 } | 160 } |
161 | 161 |
162 void TemplateURLServiceTestUtil::TearDown() { | 162 void TemplateURLServiceTestUtil::TearDown() { |
163 if (profile_.get()) { | 163 if (profile_.get()) { |
164 profile_->TearDown(); | 164 profile_->TearDown(); |
165 profile_.reset(); | 165 profile_.reset(); |
166 } | 166 } |
167 TemplateURLRef::SetGoogleBaseURL(NULL); | 167 TemplateURLRef::SetGoogleBaseURL(NULL); |
168 | 168 |
169 // Flush the message loop to make Purify happy. | 169 // Flush the message loop to make application verifiers happy. |
170 message_loop_.RunAllPending(); | 170 message_loop_.RunAllPending(); |
171 } | 171 } |
172 | 172 |
173 void TemplateURLServiceTestUtil::OnTemplateURLServiceChanged() { | 173 void TemplateURLServiceTestUtil::OnTemplateURLServiceChanged() { |
174 changed_count_++; | 174 changed_count_++; |
175 } | 175 } |
176 | 176 |
177 int TemplateURLServiceTestUtil::GetObserverCount() { | 177 int TemplateURLServiceTestUtil::GetObserverCount() { |
178 return changed_count_; | 178 return changed_count_; |
179 } | 179 } |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 return TemplateURLServiceFactory::GetForProfile(profile()); | 241 return TemplateURLServiceFactory::GetForProfile(profile()); |
242 } | 242 } |
243 | 243 |
244 TestingProfile* TemplateURLServiceTestUtil::profile() const { | 244 TestingProfile* TemplateURLServiceTestUtil::profile() const { |
245 return profile_.get(); | 245 return profile_.get(); |
246 } | 246 } |
247 | 247 |
248 void TemplateURLServiceTestUtil::StartIOThread() { | 248 void TemplateURLServiceTestUtil::StartIOThread() { |
249 profile_->StartIOThread(); | 249 profile_->StartIOThread(); |
250 } | 250 } |
OLD | NEW |