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 <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 Loading... |
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 Loading... |
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 } |
OLD | NEW |