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

Unified Diff: base/threading/thread_unittest.cc

Issue 2186703002: Remove ThreadTest.Restart (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: check !IsRunning() before Start() Created 4 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/thread_unittest.cc
diff --git a/base/threading/thread_unittest.cc b/base/threading/thread_unittest.cc
index dfa04c6ac48fce2e445daccb4e14911bda951757..81fc4e964c3e6a544950cc9032495ee998f24cc4 100644
--- a/base/threading/thread_unittest.cc
+++ b/base/threading/thread_unittest.cc
@@ -120,28 +120,6 @@ void ReturnThreadId(base::Thread* thread,
} // namespace
-TEST_F(ThreadTest, Restart) {
- Thread a("Restart");
- a.Stop();
- EXPECT_FALSE(a.message_loop());
- EXPECT_FALSE(a.IsRunning());
- EXPECT_TRUE(a.Start());
- EXPECT_TRUE(a.message_loop());
- EXPECT_TRUE(a.IsRunning());
- a.Stop();
- EXPECT_FALSE(a.message_loop());
- EXPECT_FALSE(a.IsRunning());
- EXPECT_TRUE(a.Start());
- EXPECT_TRUE(a.message_loop());
- EXPECT_TRUE(a.IsRunning());
- a.Stop();
- EXPECT_FALSE(a.message_loop());
- EXPECT_FALSE(a.IsRunning());
- a.Stop();
- EXPECT_FALSE(a.message_loop());
- EXPECT_FALSE(a.IsRunning());
-}
-
TEST_F(ThreadTest, StartWithOptions_StackSize) {
Thread a("StartWithStackSize");
// Ensure that the thread can work with only 12 kb and still process a
@@ -216,9 +194,13 @@ TEST_F(ThreadTest, StopTwiceNop) {
TEST_F(ThreadTest, StartTwice) {
Thread a("StartTwice");
+ EXPECT_FALSE(a.message_loop());
+ EXPECT_FALSE(a.IsRunning());
+
EXPECT_TRUE(a.Start());
EXPECT_TRUE(a.message_loop());
EXPECT_TRUE(a.IsRunning());
+
a.Stop();
EXPECT_FALSE(a.message_loop());
EXPECT_FALSE(a.IsRunning());
@@ -226,6 +208,7 @@ TEST_F(ThreadTest, StartTwice) {
EXPECT_TRUE(a.Start());
EXPECT_TRUE(a.message_loop());
EXPECT_TRUE(a.IsRunning());
+
a.Stop();
EXPECT_FALSE(a.message_loop());
EXPECT_FALSE(a.IsRunning());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698