| 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/public/utility/run_loop.h" | 5 #include "mojo/public/utility/run_loop.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "mojo/public/system/core_cpp.h" | 9 #include "mojo/public/system/core_cpp.h" |
| 10 #include "mojo/public/tests/test_support.h" | 10 #include "mojo/public/tests/test_support.h" |
| 11 #include "mojo/public/utility/run_loop_handler.h" | 11 #include "mojo/public/utility/run_loop_handler.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 namespace mojo { | 14 namespace mojo { |
| 15 namespace utility { | |
| 16 namespace { | 15 namespace { |
| 17 | 16 |
| 18 class TestRunLoopHandler : public RunLoopHandler { | 17 class TestRunLoopHandler : public RunLoopHandler { |
| 19 public: | 18 public: |
| 20 TestRunLoopHandler() | 19 TestRunLoopHandler() |
| 21 : ready_count_(0), | 20 : ready_count_(0), |
| 22 error_count_(0), | 21 error_count_(0), |
| 23 last_error_result_(MOJO_RESULT_OK) { | 22 last_error_result_(MOJO_RESULT_OK) { |
| 24 } | 23 } |
| 25 virtual ~TestRunLoopHandler() {} | 24 virtual ~TestRunLoopHandler() {} |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 TEST_F(RunLoopTest, Current) { | 182 TEST_F(RunLoopTest, Current) { |
| 184 EXPECT_TRUE(RunLoop::current() == NULL); | 183 EXPECT_TRUE(RunLoop::current() == NULL); |
| 185 { | 184 { |
| 186 RunLoop run_loop; | 185 RunLoop run_loop; |
| 187 EXPECT_EQ(&run_loop, RunLoop::current()); | 186 EXPECT_EQ(&run_loop, RunLoop::current()); |
| 188 } | 187 } |
| 189 EXPECT_TRUE(RunLoop::current() == NULL); | 188 EXPECT_TRUE(RunLoop::current() == NULL); |
| 190 } | 189 } |
| 191 | 190 |
| 192 } // namespace | 191 } // namespace |
| 193 } // namespace utility | |
| 194 } // namespace mojo | 192 } // namespace mojo |
| OLD | NEW |