OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #elif defined(OS_POSIX) | 9 #elif defined(OS_POSIX) |
10 #include <sys/types.h> | 10 #include <sys/types.h> |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "ipc/ipc_descriptors.h" | 27 #include "ipc/ipc_descriptors.h" |
28 #include "ipc/ipc_channel.h" | 28 #include "ipc/ipc_channel.h" |
29 #include "ipc/ipc_channel_proxy.h" | 29 #include "ipc/ipc_channel_proxy.h" |
30 #include "ipc/ipc_message_utils.h" | 30 #include "ipc/ipc_message_utils.h" |
31 #include "ipc/ipc_multiprocess_test.h" | 31 #include "ipc/ipc_multiprocess_test.h" |
32 #include "ipc/ipc_sender.h" | 32 #include "ipc/ipc_sender.h" |
33 #include "ipc/ipc_switches.h" | 33 #include "ipc/ipc_switches.h" |
34 #include "ipc/ipc_test_base.h" | 34 #include "ipc/ipc_test_base.h" |
35 #include "testing/multiprocess_func_list.h" | 35 #include "testing/multiprocess_func_list.h" |
36 | 36 |
| 37 namespace { |
| 38 |
37 const size_t kLongMessageStringNumBytes = 50000; | 39 const size_t kLongMessageStringNumBytes = 50000; |
38 | 40 |
39 class IPCChannelTest : public IPCTestBase { | 41 class IPCChannelTest : public IPCTestBase { |
40 }; | 42 }; |
41 | 43 |
42 TEST_F(IPCChannelTest, BasicMessageTest) { | 44 TEST_F(IPCChannelTest, BasicMessageTest) { |
43 int v1 = 10; | 45 int v1 = 10; |
44 std::string v2("foobar"); | 46 std::string v2("foobar"); |
45 std::wstring v3(L"hello world"); | 47 std::wstring v3(L"hello world"); |
46 | 48 |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 // setup IPC channel | 329 // setup IPC channel |
328 IPC::Channel chan(kTestClientChannel, IPC::Channel::MODE_CLIENT, | 330 IPC::Channel chan(kTestClientChannel, IPC::Channel::MODE_CLIENT, |
329 &channel_listener); | 331 &channel_listener); |
330 CHECK(chan.Connect()); | 332 CHECK(chan.Connect()); |
331 channel_listener.Init(&chan); | 333 channel_listener.Init(&chan); |
332 Send(&chan, "hello from child"); | 334 Send(&chan, "hello from child"); |
333 // run message loop | 335 // run message loop |
334 MessageLoop::current()->Run(); | 336 MessageLoop::current()->Run(); |
335 return 0; | 337 return 0; |
336 } | 338 } |
| 339 |
| 340 } // namespace |
OLD | NEW |