| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/eintr_wrapper.h" | 7 #include "base/eintr_wrapper.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/platform_thread.h" | |
| 11 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
| 12 #include "base/task.h" | 11 #include "base/task.h" |
| 12 #include "base/threading/platform_thread.h" |
| 13 #include "base/thread.h" | 13 #include "base/thread.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 | 15 |
| 16 #if defined(OS_WIN) | 16 #if defined(OS_WIN) |
| 17 #include "base/message_pump_win.h" | 17 #include "base/message_pump_win.h" |
| 18 #include "base/scoped_handle.h" | 18 #include "base/scoped_handle.h" |
| 19 #endif | 19 #endif |
| 20 #if defined(OS_POSIX) | 20 #if defined(OS_POSIX) |
| 21 #include "base/message_pump_libevent.h" | 21 #include "base/message_pump_libevent.h" |
| 22 #endif | 22 #endif |
| 23 | 23 |
| 24 using base::PlatformThread; |
| 24 using base::Thread; | 25 using base::Thread; |
| 25 using base::Time; | 26 using base::Time; |
| 26 using base::TimeDelta; | 27 using base::TimeDelta; |
| 27 | 28 |
| 28 // TODO(darin): Platform-specific MessageLoop tests should be grouped together | 29 // TODO(darin): Platform-specific MessageLoop tests should be grouped together |
| 29 // to avoid chopping this file up with so many #ifdefs. | 30 // to avoid chopping this file up with so many #ifdefs. |
| 30 | 31 |
| 31 namespace { | 32 namespace { |
| 32 | 33 |
| 33 class MessageLoopTest : public testing::Test {}; | 34 class MessageLoopTest : public testing::Test {}; |
| (...skipping 1670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1704 loop->PostDelayedTask( | 1705 loop->PostDelayedTask( |
| 1705 FROM_HERE, | 1706 FROM_HERE, |
| 1706 new RunAtDestructionTask(&task_destroyed, &destruction_observer_called), | 1707 new RunAtDestructionTask(&task_destroyed, &destruction_observer_called), |
| 1707 kDelayMS); | 1708 kDelayMS); |
| 1708 delete loop; | 1709 delete loop; |
| 1709 EXPECT_TRUE(observer.task_destroyed_before_message_loop()); | 1710 EXPECT_TRUE(observer.task_destroyed_before_message_loop()); |
| 1710 // The task should have been destroyed when we deleted the loop. | 1711 // The task should have been destroyed when we deleted the loop. |
| 1711 EXPECT_TRUE(task_destroyed); | 1712 EXPECT_TRUE(task_destroyed); |
| 1712 EXPECT_TRUE(destruction_observer_called); | 1713 EXPECT_TRUE(destruction_observer_called); |
| 1713 } | 1714 } |
| OLD | NEW |