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/bindings_support_impl.h" | 5 #include "mojo/public/utility/bindings_support_impl.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "mojo/public/system/core_cpp.h" | 8 #include "mojo/public/system/core_cpp.h" |
9 #include "mojo/public/tests/test_support.h" | 9 #include "mojo/public/tests/test_support.h" |
10 #include "mojo/public/utility/environment.h" | 10 #include "mojo/public/utility/environment.h" |
11 #include "mojo/public/utility/run_loop.h" | 11 #include "mojo/public/utility/run_loop.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 TestAsyncWaitCallback : public BindingsSupport::AsyncWaitCallback { | 17 class TestAsyncWaitCallback : public BindingsSupport::AsyncWaitCallback { |
19 public: | 18 public: |
20 TestAsyncWaitCallback() : result_count_(0), last_result_(MOJO_RESULT_OK) { | 19 TestAsyncWaitCallback() : result_count_(0), last_result_(MOJO_RESULT_OK) { |
21 } | 20 } |
22 virtual ~TestAsyncWaitCallback() {} | 21 virtual ~TestAsyncWaitCallback() {} |
23 | 22 |
24 int result_count() const { return result_count_; } | 23 int result_count() const { return result_count_; } |
25 | 24 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 EXPECT_EQ(MOJO_RESULT_OK, test::WriteEmptyMessage(test_pipe.handle1.get())); | 102 EXPECT_EQ(MOJO_RESULT_OK, test::WriteEmptyMessage(test_pipe.handle1.get())); |
104 | 103 |
105 BindingsSupport::Get()->CancelWait( | 104 BindingsSupport::Get()->CancelWait( |
106 BindingsSupport::Get()->AsyncWait(test_pipe.handle0.get(), | 105 BindingsSupport::Get()->AsyncWait(test_pipe.handle0.get(), |
107 MOJO_WAIT_FLAG_READABLE, &callback)); | 106 MOJO_WAIT_FLAG_READABLE, &callback)); |
108 RunLoop::current()->Run(); | 107 RunLoop::current()->Run(); |
109 EXPECT_EQ(0, callback.result_count()); | 108 EXPECT_EQ(0, callback.result_count()); |
110 } | 109 } |
111 | 110 |
112 } // namespace | 111 } // namespace |
113 } // namespace utility | |
114 } // namespace mojo | 112 } // namespace mojo |
OLD | NEW |