| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/thread.h" | 5 #include "base/thread.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/dynamic_annotations.h" | |
| 10 #include "base/lock.h" | 9 #include "base/lock.h" |
| 11 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| 12 #include "base/string_util.h" | 11 #include "base/string_util.h" |
| 12 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 #include "testing/platform_test.h" | 14 #include "testing/platform_test.h" |
| 15 | 15 |
| 16 using base::Thread; | 16 using base::Thread; |
| 17 | 17 |
| 18 typedef PlatformTest ThreadTest; | 18 typedef PlatformTest ThreadTest; |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 class ToggleValue : public Task { | 22 class ToggleValue : public Task { |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 // Upon leaving this scope, the thread is deleted. | 253 // Upon leaving this scope, the thread is deleted. |
| 254 } | 254 } |
| 255 | 255 |
| 256 // Check the order of events during shutdown. | 256 // Check the order of events during shutdown. |
| 257 ASSERT_EQ(4u, captured_events.size()); | 257 ASSERT_EQ(4u, captured_events.size()); |
| 258 EXPECT_EQ(THREAD_EVENT_INIT, captured_events[0]); | 258 EXPECT_EQ(THREAD_EVENT_INIT, captured_events[0]); |
| 259 EXPECT_EQ(THREAD_EVENT_CLEANUP, captured_events[1]); | 259 EXPECT_EQ(THREAD_EVENT_CLEANUP, captured_events[1]); |
| 260 EXPECT_EQ(THREAD_EVENT_MESSAGE_LOOP_DESTROYED, captured_events[2]); | 260 EXPECT_EQ(THREAD_EVENT_MESSAGE_LOOP_DESTROYED, captured_events[2]); |
| 261 EXPECT_EQ(THREAD_EVENT_CLEANUP_AFTER_LOOP, captured_events[3]); | 261 EXPECT_EQ(THREAD_EVENT_CLEANUP_AFTER_LOOP, captured_events[3]); |
| 262 } | 262 } |
| OLD | NEW |