Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Side by Side Diff: chrome/browser/metrics/thread_watcher_unittest.cc

Issue 1086733002: Ensure tests have an active task runner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <math.h> 5 #include <math.h>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 ThreadWatcherList::DeleteAll(); 305 ThreadWatcherList::DeleteAll();
306 io_watcher_ = NULL; 306 io_watcher_ = NULL;
307 db_watcher_ = NULL; 307 db_watcher_ = NULL;
308 io_thread_.reset(); 308 io_thread_.reset();
309 db_thread_.reset(); 309 db_thread_.reset();
310 watchdog_thread_.reset(); 310 watchdog_thread_.reset();
311 thread_watcher_list_ = NULL; 311 thread_watcher_list_ = NULL;
312 } 312 }
313 313
314 private: 314 private:
315 base::MessageLoop message_loop_;
315 base::Lock lock_; 316 base::Lock lock_;
316 base::ConditionVariable setup_complete_; 317 base::ConditionVariable setup_complete_;
317 bool initialized_; 318 bool initialized_;
318 scoped_ptr<content::TestBrowserThread> db_thread_; 319 scoped_ptr<content::TestBrowserThread> db_thread_;
319 scoped_ptr<content::TestBrowserThread> io_thread_; 320 scoped_ptr<content::TestBrowserThread> io_thread_;
320 scoped_ptr<WatchDogThread> watchdog_thread_; 321 scoped_ptr<WatchDogThread> watchdog_thread_;
321 }; 322 };
322 323
323 // Define static constants. 324 // Define static constants.
324 const TimeDelta ThreadWatcherTest::kSleepTime = 325 const TimeDelta ThreadWatcherTest::kSleepTime =
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 FROM_HERE, 730 FROM_HERE,
730 message_loop_for_ui.QuitClosure(), 731 message_loop_for_ui.QuitClosure(),
731 base::TimeDelta::FromSeconds( 732 base::TimeDelta::FromSeconds(
732 ThreadWatcherList::g_initialize_delay_seconds)); 733 ThreadWatcherList::g_initialize_delay_seconds));
733 message_loop_for_ui.Run(); 734 message_loop_for_ui.Run();
734 735
735 CheckState(false /* has_thread_watcher_list */, 736 CheckState(false /* has_thread_watcher_list */,
736 true /* stopped */, 737 true /* stopped */,
737 "Stopped"); 738 "Stopped");
738 } 739 }
OLDNEW
« no previous file with comments | « chrome/browser/media/webrtc_log_uploader_unittest.cc ('k') | chrome/browser/metrics/variations/variations_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698