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 "base/sync_socket.h" | 5 #include "base/sync_socket.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 #include <string> | 8 #include <string> |
9 #include <sstream> | 9 #include <sstream> |
10 | 10 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
13 #include "base/process_util.h" | |
14 #include "base/threading/thread.h" | 13 #include "base/threading/thread.h" |
15 #include "ipc/ipc_test_base.h" | 14 #include "ipc/ipc_test_base.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
17 | 16 |
18 #if defined(OS_POSIX) | 17 #if defined(OS_POSIX) |
19 #include "base/file_descriptor_posix.h" | 18 #include "base/file_descriptor_posix.h" |
20 #endif | 19 #endif |
21 | 20 |
22 // IPC messages for testing ---------------------------------------------------- | 21 // IPC messages for testing ---------------------------------------------------- |
23 | 22 |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 | 299 |
301 // Read from another socket to free some space for a new write. | 300 // Read from another socket to free some space for a new write. |
302 char hello[kHelloStringLength] = {0}; | 301 char hello[kHelloStringLength] = {0}; |
303 pair[1].Receive(&hello[0], sizeof(hello)); | 302 pair[1].Receive(&hello[0], sizeof(hello)); |
304 | 303 |
305 // Should be able to write more data to the buffer now. | 304 // Should be able to write more data to the buffer now. |
306 EXPECT_EQ(kHelloStringLength, pair[0].Send(kHelloString, kHelloStringLength)); | 305 EXPECT_EQ(kHelloStringLength, pair[0].Send(kHelloString, kHelloStringLength)); |
307 } | 306 } |
308 | 307 |
309 } // namespace | 308 } // namespace |
OLD | NEW |