Index: trunk/src/chrome/browser/metrics/thread_watcher_unittest.cc |
=================================================================== |
--- trunk/src/chrome/browser/metrics/thread_watcher_unittest.cc (revision 255400) |
+++ trunk/src/chrome/browser/metrics/thread_watcher_unittest.cc (working copy) |
@@ -10,7 +10,6 @@ |
#include "base/memory/scoped_ptr.h" |
#include "base/message_loop/message_loop.h" |
#include "base/message_loop/message_loop_proxy.h" |
-#include "base/run_loop.h" |
#include "base/strings/string_number_conversions.h" |
#include "base/strings/string_split.h" |
#include "base/strings/string_tokenizer.h" |
@@ -630,53 +629,3 @@ |
// Wait for the io_watcher_'s VeryLongMethod to finish. |
io_watcher_->WaitForWaitStateChange(kUnresponsiveTime * 10, ALL_DONE); |
} |
- |
-TEST(ThreadWatcherListTest, Restart) { |
- ThreadWatcherList::g_initialize_delay_seconds = 1; |
- |
- base::MessageLoopForUI message_loop_for_ui; |
- content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop_for_ui); |
- |
- scoped_ptr<WatchDogThread> watchdog_thread_(new WatchDogThread()); |
- watchdog_thread_->Start(); |
- |
- EXPECT_FALSE(ThreadWatcherList::g_thread_watcher_list_); |
- |
- // See http://crbug.com/347887. |
- // StartWatchingAll() will PostDelayedTask to create g_thread_watcher_list_, |
- // whilst StopWatchingAll() will just PostTask to destroy it. |
- // Ensure that when Stop is called, Start will NOT create |
- // g_thread_watcher_list_ later on. |
- ThreadWatcherList::StartWatchingAll(*CommandLine::ForCurrentProcess()); |
- ThreadWatcherList::StopWatchingAll(); |
- message_loop_for_ui.PostDelayedTask( |
- FROM_HERE, |
- message_loop_for_ui.QuitClosure(), |
- base::TimeDelta::FromSeconds( |
- ThreadWatcherList::g_initialize_delay_seconds)); |
- message_loop_for_ui.Run(); |
- EXPECT_FALSE(ThreadWatcherList::g_thread_watcher_list_); |
- EXPECT_TRUE(ThreadWatcherList::g_stopped_); |
- |
- // Proceed with just |StartWatchingAll| and ensure it'll be started. |
- ThreadWatcherList::StartWatchingAll(*CommandLine::ForCurrentProcess()); |
- message_loop_for_ui.PostDelayedTask( |
- FROM_HERE, |
- message_loop_for_ui.QuitClosure(), |
- base::TimeDelta::FromSeconds( |
- ThreadWatcherList::g_initialize_delay_seconds + 1)); |
- message_loop_for_ui.Run(); |
- EXPECT_TRUE(ThreadWatcherList::g_thread_watcher_list_); |
- EXPECT_FALSE(ThreadWatcherList::g_stopped_); |
- |
- // Finally, StopWatchingAll() must stop. |
- ThreadWatcherList::StopWatchingAll(); |
- message_loop_for_ui.PostDelayedTask( |
- FROM_HERE, |
- message_loop_for_ui.QuitClosure(), |
- base::TimeDelta::FromSeconds( |
- ThreadWatcherList::g_initialize_delay_seconds)); |
- message_loop_for_ui.Run(); |
- EXPECT_FALSE(ThreadWatcherList::g_thread_watcher_list_); |
- EXPECT_TRUE(ThreadWatcherList::g_stopped_); |
-} |