| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "mojo/message_pump/handle_watcher.h" | 5 #include "mojo/message_pump/handle_watcher.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 base::RunLoop* run_loop_; | 114 base::RunLoop* run_loop_; |
| 115 | 115 |
| 116 base::WeakPtrFactory<CallbackHelper> weak_factory_; | 116 base::WeakPtrFactory<CallbackHelper> weak_factory_; |
| 117 | 117 |
| 118 private: | 118 private: |
| 119 DISALLOW_COPY_AND_ASSIGN(CallbackHelper); | 119 DISALLOW_COPY_AND_ASSIGN(CallbackHelper); |
| 120 }; | 120 }; |
| 121 | 121 |
| 122 class HandleWatcherTest : public testing::TestWithParam<MessageLoopConfig> { | 122 class HandleWatcherTest : public testing::TestWithParam<MessageLoopConfig> { |
| 123 public: | 123 public: |
| 124 HandleWatcherTest() : message_loop_(CreateMessageLoop(GetParam())) {} | 124 HandleWatcherTest() |
| 125 : tick_clock_(base::TimeTicks()), |
| 126 message_loop_(CreateMessageLoop(GetParam())) {} |
| 125 virtual ~HandleWatcherTest() { | 127 virtual ~HandleWatcherTest() { |
| 126 test::SetTickClockForTest(NULL); | 128 test::SetTickClockForTest(NULL); |
| 127 } | 129 } |
| 128 | 130 |
| 129 protected: | 131 protected: |
| 130 void TearDownMessageLoop() { | 132 void TearDownMessageLoop() { |
| 131 message_loop_.reset(); | 133 message_loop_.reset(); |
| 132 } | 134 } |
| 133 | 135 |
| 134 void InstallTickClock() { | 136 void InstallTickClock() { |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 message_loop.task_runner(), | 477 message_loop.task_runner(), |
| 476 &run_loop, &threads_active_counter)); | 478 &run_loop, &threads_active_counter)); |
| 477 } | 479 } |
| 478 run_loop.Run(); | 480 run_loop.Run(); |
| 479 ASSERT_EQ(0, threads_active_counter); | 481 ASSERT_EQ(0, threads_active_counter); |
| 480 } | 482 } |
| 481 | 483 |
| 482 } // namespace test | 484 } // namespace test |
| 483 } // namespace common | 485 } // namespace common |
| 484 } // namespace mojo | 486 } // namespace mojo |
| OLD | NEW |