OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/system/embedder.h" | 5 #include "mojo/system/embedder.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 CHECK(store_channel_info_here); | 27 CHECK(store_channel_info_here); |
28 CHECK(channel_info); | 28 CHECK(channel_info); |
29 *store_channel_info_here = channel_info; | 29 *store_channel_info_here = channel_info; |
30 } | 30 } |
31 | 31 |
32 TEST_F(EmbedderTest, ChannelsBasic) { | 32 TEST_F(EmbedderTest, ChannelsBasic) { |
33 Init(); | 33 Init(); |
34 | 34 |
35 // TODO(vtl): |PlatformChannelPair| not implemented on Windows yet. | 35 // TODO(vtl): |PlatformChannelPair| not implemented on Windows yet. |
36 #if !defined(OS_WIN) | 36 #if !defined(OS_WIN) |
37 system::PlatformChannelPair channel_pair; | 37 PlatformChannelPair channel_pair; |
38 system::ScopedPlatformHandle server_handle = channel_pair.PassServerHandle(); | 38 ScopedPlatformHandle server_handle = channel_pair.PassServerHandle(); |
39 system::ScopedPlatformHandle client_handle = channel_pair.PassClientHandle(); | 39 ScopedPlatformHandle client_handle = channel_pair.PassClientHandle(); |
40 | 40 |
41 ChannelInfo* server_channel_info = NULL; | 41 ChannelInfo* server_channel_info = NULL; |
42 MojoHandle server_mp = CreateChannel(server_handle.Pass(), | 42 MojoHandle server_mp = CreateChannel(server_handle.Pass(), |
43 io_thread_task_runner(), | 43 io_thread_task_runner(), |
44 base::Bind(&StoreChannelInfo, | 44 base::Bind(&StoreChannelInfo, |
45 &server_channel_info)); | 45 &server_channel_info)); |
46 EXPECT_NE(server_mp, MOJO_HANDLE_INVALID); | 46 EXPECT_NE(server_mp, MOJO_HANDLE_INVALID); |
47 | 47 |
48 ChannelInfo* client_channel_info = NULL; | 48 ChannelInfo* client_channel_info = NULL; |
49 MojoHandle client_mp = CreateChannel(client_handle.Pass(), | 49 MojoHandle client_mp = CreateChannel(client_handle.Pass(), |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 test::Shutdown(); | 94 test::Shutdown(); |
95 } | 95 } |
96 | 96 |
97 // TODO(vtl): Test immediate write & close. | 97 // TODO(vtl): Test immediate write & close. |
98 // TODO(vtl): Test broken-connection cases. | 98 // TODO(vtl): Test broken-connection cases. |
99 | 99 |
100 } // namespace | 100 } // namespace |
101 } // namespace embedder | 101 } // namespace embedder |
102 } // namespace mojo | 102 } // namespace mojo |
OLD | NEW |