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

Unified Diff: trunk/src/chrome/browser/metrics/thread_watcher_unittest.cc

Issue 188643006: Revert 255322 "ThreadWatcher: fixes Start/StopWatchingAll." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « trunk/src/chrome/browser/metrics/thread_watcher.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_);
-}
« no previous file with comments | « trunk/src/chrome/browser/metrics/thread_watcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698