| 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 <stddef.h> |
| 8 #include <stdio.h> | 8 #include <stdio.h> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <sstream> | 10 #include <sstream> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/bind.h" | 13 #include "base/bind.h" |
| 14 #include "base/location.h" | 14 #include "base/location.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/message_loop/message_loop.h" |
| 16 #include "base/run_loop.h" | 17 #include "base/run_loop.h" |
| 17 #include "base/single_thread_task_runner.h" | 18 #include "base/single_thread_task_runner.h" |
| 18 #include "base/threading/thread.h" | 19 #include "base/threading/thread.h" |
| 19 #include "build/build_config.h" | 20 #include "build/build_config.h" |
| 20 #include "ipc/ipc_test_base.h" | 21 #include "ipc/ipc_test_base.h" |
| 21 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
| 22 | 23 |
| 23 #if defined(OS_POSIX) | 24 #if defined(OS_POSIX) |
| 24 #include "base/file_descriptor_posix.h" | 25 #include "base/file_descriptor_posix.h" |
| 25 #endif | 26 #endif |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 | 299 |
| 299 // 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. |
| 300 char hello[kHelloStringLength] = {0}; | 301 char hello[kHelloStringLength] = {0}; |
| 301 pair[1].Receive(&hello[0], sizeof(hello)); | 302 pair[1].Receive(&hello[0], sizeof(hello)); |
| 302 | 303 |
| 303 // Should be able to write more data to the buffer now. | 304 // Should be able to write more data to the buffer now. |
| 304 EXPECT_EQ(kHelloStringLength, pair[0].Send(kHelloString, kHelloStringLength)); | 305 EXPECT_EQ(kHelloStringLength, pair[0].Send(kHelloString, kHelloStringLength)); |
| 305 } | 306 } |
| 306 | 307 |
| 307 } // namespace | 308 } // namespace |
| OLD | NEW |