Index: base/threading/simple_thread_unittest.cc |
diff --git a/base/threading/simple_thread_unittest.cc b/base/threading/simple_thread_unittest.cc |
index 969418b219a6fda80d03965630ed292c9a770b8e..0e52500c522d7d84b6bebc6f69c9d2ad1e7289c6 100644 |
--- a/base/threading/simple_thread_unittest.cc |
+++ b/base/threading/simple_thread_unittest.cc |
@@ -129,11 +129,17 @@ |
EXPECT_EQ(0, stack_int); |
DelegateSimpleThread thread(&runner, "int_setter"); |
+ EXPECT_FALSE(thread.HasBeenStarted()); |
+ EXPECT_FALSE(thread.HasBeenJoined()); |
EXPECT_EQ(0, stack_int); |
thread.Start(); |
+ EXPECT_TRUE(thread.HasBeenStarted()); |
+ EXPECT_FALSE(thread.HasBeenJoined()); |
+ |
thread.Join(); |
- |
+ EXPECT_TRUE(thread.HasBeenStarted()); |
+ EXPECT_TRUE(thread.HasBeenJoined()); |
EXPECT_EQ(7, stack_int); |
} |
@@ -159,11 +165,16 @@ |
options.joinable = false; |
DelegateSimpleThread thread(&runner, "non_joinable", options); |
+ EXPECT_FALSE(thread.HasBeenStarted()); |
thread.Start(); |
- |
- // Wait until Run() is invoked. |
+ EXPECT_TRUE(thread.HasBeenStarted()); |
+ |
+ // Note: this is not quite the same as |thread.HasBeenStarted()| which |
+ // represents ThreadMain() getting ready to invoke Run() whereas |
+ // |runner.WaitUntilStarted()| ensures Run() was actually invoked. |
runner.WaitUntilStarted(); |
+ EXPECT_FALSE(thread.HasBeenJoined()); |
EXPECT_DCHECK_DEATH({ thread.Join(); }); |
} |