OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stddef.h> | 5 #include <stddef.h> |
6 #include <sys/socket.h> | 6 #include <sys/socket.h> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/scoped_ptr.h" |
12 #include "base/path_service.h" | 13 #include "base/path_service.h" |
13 #include "base/posix/eintr_wrapper.h" | 14 #include "base/posix/eintr_wrapper.h" |
14 #include "base/single_thread_task_runner.h" | 15 #include "base/single_thread_task_runner.h" |
15 #include "base/synchronization/waitable_event.h" | 16 #include "base/synchronization/waitable_event.h" |
16 #include "base/threading/thread.h" | 17 #include "base/threading/thread.h" |
17 #include "base/threading/thread_restrictions.h" | 18 #include "base/threading/thread_restrictions.h" |
18 #include "ipc/unix_domain_socket_util.h" | 19 #include "ipc/unix_domain_socket_util.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
20 | 21 |
21 namespace { | 22 namespace { |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 HANDLE_EINTR(send(connection.client_fd(), buffer, buf_len, 0)); | 167 HANDLE_EINTR(send(connection.client_fd(), buffer, buf_len, 0)); |
167 ASSERT_EQ(buf_len, sent_bytes); | 168 ASSERT_EQ(buf_len, sent_bytes); |
168 char recv_buf[sizeof(buffer)]; | 169 char recv_buf[sizeof(buffer)]; |
169 size_t received_bytes = | 170 size_t received_bytes = |
170 HANDLE_EINTR(recv(connection.server_fd(), recv_buf, buf_len, 0)); | 171 HANDLE_EINTR(recv(connection.server_fd(), recv_buf, buf_len, 0)); |
171 ASSERT_EQ(buf_len, received_bytes); | 172 ASSERT_EQ(buf_len, received_bytes); |
172 ASSERT_EQ(0, memcmp(recv_buf, buffer, buf_len)); | 173 ASSERT_EQ(0, memcmp(recv_buf, buffer, buf_len)); |
173 } | 174 } |
174 | 175 |
175 } // namespace | 176 } // namespace |
OLD | NEW |