Index: base/threading/thread_unittest.cc |
diff --git a/base/threading/thread_unittest.cc b/base/threading/thread_unittest.cc |
index 3c3541657ebffbe5c2b0cbd5e37340509764598e..999cc7af30559d636f7c354bc2b2a03df1e0f3d7 100644 |
--- a/base/threading/thread_unittest.cc |
+++ b/base/threading/thread_unittest.cc |
@@ -194,6 +194,20 @@ TEST_F(ThreadTest, ThreadName) { |
EXPECT_EQ("ThreadName", a.thread_name()); |
} |
+TEST_F(ThreadTest, ThreadId) { |
+ Thread a("ThreadId0"); |
+ Thread b("ThreadId1"); |
+ a.StartAndWaitForTesting(); |
+ b.StartAndWaitForTesting(); |
+ |
+ // A started thread should have a valid ID. |
+ EXPECT_NE(base::kInvalidThreadId, a.thread_id()); |
+ EXPECT_NE(base::kInvalidThreadId, b.thread_id()); |
+ |
+ // Each thread should have a different thread ID. |
+ EXPECT_NE(a.thread_id(), b.thread_id()); |
+} |
+ |
// Make sure Init() is called after Start() and before |
// WaitUntilThreadInitialized() returns. |
TEST_F(ThreadTest, SleepInsideInit) { |