| 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 <stddef.h> |
| 7 #include <stdio.h> | 8 #include <stdio.h> |
| 8 #include <sstream> | 9 #include <sstream> |
| 9 #include <string> | 10 #include <string> |
| 10 | 11 |
| 11 #include "base/bind.h" | 12 #include "base/bind.h" |
| 12 #include "base/location.h" | 13 #include "base/location.h" |
| 14 #include "base/macros.h" |
| 13 #include "base/single_thread_task_runner.h" | 15 #include "base/single_thread_task_runner.h" |
| 14 #include "base/threading/thread.h" | 16 #include "base/threading/thread.h" |
| 17 #include "build/build_config.h" |
| 15 #include "ipc/ipc_test_base.h" | 18 #include "ipc/ipc_test_base.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| 17 | 20 |
| 18 #if defined(OS_POSIX) | 21 #if defined(OS_POSIX) |
| 19 #include "base/file_descriptor_posix.h" | 22 #include "base/file_descriptor_posix.h" |
| 20 #endif | 23 #endif |
| 21 | 24 |
| 22 // IPC messages for testing ---------------------------------------------------- | 25 // IPC messages for testing ---------------------------------------------------- |
| 23 | 26 |
| 24 #define IPC_MESSAGE_IMPL | 27 #define IPC_MESSAGE_IMPL |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 | 311 |
| 309 // Read from another socket to free some space for a new write. | 312 // Read from another socket to free some space for a new write. |
| 310 char hello[kHelloStringLength] = {0}; | 313 char hello[kHelloStringLength] = {0}; |
| 311 pair[1].Receive(&hello[0], sizeof(hello)); | 314 pair[1].Receive(&hello[0], sizeof(hello)); |
| 312 | 315 |
| 313 // Should be able to write more data to the buffer now. | 316 // Should be able to write more data to the buffer now. |
| 314 EXPECT_EQ(kHelloStringLength, pair[0].Send(kHelloString, kHelloStringLength)); | 317 EXPECT_EQ(kHelloStringLength, pair[0].Send(kHelloString, kHelloStringLength)); |
| 315 } | 318 } |
| 316 | 319 |
| 317 } // namespace | 320 } // namespace |
| OLD | NEW |