OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/message_loop/message_loop_task_runner.h" | 5 #include "base/message_loop/message_loop_task_runner.h" |
6 | 6 |
7 #include "base/atomic_sequence_num.h" | 7 #include "base/atomic_sequence_num.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/debug/leak_annotations.h" | 9 #include "base/debug/leak_annotations.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "base/message_loop/message_loop_task_runner.h" | 12 #include "base/message_loop/message_loop_task_runner.h" |
13 #include "base/synchronization/waitable_event.h" | 13 #include "base/synchronization/waitable_event.h" |
14 #include "base/thread_task_runner_handle.h" | 14 #include "base/thread_task_runner_handle.h" |
15 #include "base/threading/thread.h" | 15 #include "base/threading/thread.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/googletest/include/gtest/gtest.h" |
17 #include "testing/platform_test.h" | 17 #include "testing/platform_test.h" |
18 | 18 |
19 namespace base { | 19 namespace base { |
20 | 20 |
21 class MessageLoopTaskRunnerTest : public testing::Test { | 21 class MessageLoopTaskRunnerTest : public testing::Test { |
22 public: | 22 public: |
23 MessageLoopTaskRunnerTest() | 23 MessageLoopTaskRunnerTest() |
24 : current_loop_(new MessageLoop()), | 24 : current_loop_(new MessageLoop()), |
25 task_thread_("task_thread"), | 25 task_thread_("task_thread"), |
26 thread_sync_(true, false) {} | 26 thread_sync_(true, false) {} |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 new Thread("MessageLoopTaskRunnerThreadingTest_Dummy")); | 349 new Thread("MessageLoopTaskRunnerThreadingTest_Dummy")); |
350 test_thread->Start(); | 350 test_thread->Start(); |
351 task_runner = test_thread->task_runner(); | 351 task_runner = test_thread->task_runner(); |
352 } | 352 } |
353 bool ret = task_runner->PostTask( | 353 bool ret = task_runner->PostTask( |
354 FROM_HERE, Bind(&MessageLoopTaskRunnerThreadingTest::AssertNotRun)); | 354 FROM_HERE, Bind(&MessageLoopTaskRunnerThreadingTest::AssertNotRun)); |
355 EXPECT_FALSE(ret); | 355 EXPECT_FALSE(ret); |
356 } | 356 } |
357 | 357 |
358 } // namespace base | 358 } // namespace base |
OLD | NEW |