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/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 } | 178 } |
179 | 179 |
180 void TemplateURLServiceTestUtil::TearDown() { | 180 void TemplateURLServiceTestUtil::TearDown() { |
181 if (profile_.get()) { | 181 if (profile_.get()) { |
182 profile_->TearDown(); | 182 profile_->TearDown(); |
183 profile_.reset(); | 183 profile_.reset(); |
184 } | 184 } |
185 UIThreadSearchTermsData::SetGoogleBaseURL(std::string()); | 185 UIThreadSearchTermsData::SetGoogleBaseURL(std::string()); |
186 | 186 |
187 // Flush the message loop to make application verifiers happy. | 187 // Flush the message loop to make application verifiers happy. |
188 message_loop_.RunAllPending(); | 188 message_loop_.RunUntilIdle(); |
189 } | 189 } |
190 | 190 |
191 void TemplateURLServiceTestUtil::OnTemplateURLServiceChanged() { | 191 void TemplateURLServiceTestUtil::OnTemplateURLServiceChanged() { |
192 changed_count_++; | 192 changed_count_++; |
193 } | 193 } |
194 | 194 |
195 int TemplateURLServiceTestUtil::GetObserverCount() { | 195 int TemplateURLServiceTestUtil::GetObserverCount() { |
196 return changed_count_; | 196 return changed_count_; |
197 } | 197 } |
198 | 198 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 | 305 |
306 TestingProfile* TemplateURLServiceTestUtil::profile() const { | 306 TestingProfile* TemplateURLServiceTestUtil::profile() const { |
307 return profile_.get(); | 307 return profile_.get(); |
308 } | 308 } |
309 | 309 |
310 void TemplateURLServiceTestUtil::StartIOThread() { | 310 void TemplateURLServiceTestUtil::StartIOThread() { |
311 profile_->StartIOThread(); | 311 profile_->StartIOThread(); |
312 } | 312 } |
313 | 313 |
314 void TemplateURLServiceTestUtil::PumpLoop() { | 314 void TemplateURLServiceTestUtil::PumpLoop() { |
315 message_loop_.RunAllPending(); | 315 message_loop_.RunUntilIdle(); |
316 } | 316 } |
OLD | NEW |