OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "mojo/edk/embedder/platform_channel_pair.h" | 5 #include "mojo/edk/embedder/platform_channel_pair.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <poll.h> | 8 #include <poll.h> |
9 #include <signal.h> | 9 #include <signal.h> |
10 #include <stdio.h> | 10 #include <stdio.h> |
11 #include <sys/socket.h> | 11 #include <sys/socket.h> |
12 #include <sys/types.h> | 12 #include <sys/types.h> |
13 #include <sys/uio.h> | 13 #include <sys/uio.h> |
14 #include <unistd.h> | 14 #include <unistd.h> |
15 | 15 |
16 #include <deque> | 16 #include <deque> |
17 | 17 |
18 #include "base/files/file_path.h" | 18 #include "base/files/file_path.h" |
19 #include "base/files/file_util.h" | 19 #include "base/files/file_util.h" |
20 #include "base/files/scoped_file.h" | 20 #include "base/files/scoped_file.h" |
21 #include "base/files/scoped_temp_dir.h" | 21 #include "base/files/scoped_temp_dir.h" |
22 #include "base/logging.h" | 22 #include "base/logging.h" |
23 #include "mojo/edk/embedder/platform_channel_utils_posix.h" | 23 #include "mojo/edk/embedder/platform_channel_utils_posix.h" |
24 #include "mojo/edk/embedder/platform_handle.h" | 24 #include "mojo/edk/embedder/platform_handle.h" |
25 #include "mojo/edk/embedder/platform_handle_vector.h" | 25 #include "mojo/edk/embedder/platform_handle_vector.h" |
26 #include "mojo/edk/embedder/scoped_platform_handle.h" | 26 #include "mojo/edk/embedder/scoped_platform_handle.h" |
27 #include "mojo/edk/test/test_utils.h" | 27 #include "mojo/edk/test/test_utils.h" |
28 #include "mojo/public/cpp/system/macros.h" | |
29 #include "testing/gtest/include/gtest/gtest.h" | 28 #include "testing/gtest/include/gtest/gtest.h" |
| 29 #include "third_party/mojo/src/mojo/public/cpp/system/macros.h" |
30 | 30 |
31 namespace mojo { | 31 namespace mojo { |
32 namespace edk { | 32 namespace edk { |
33 namespace { | 33 namespace { |
34 | 34 |
35 void WaitReadable(PlatformHandle h) { | 35 void WaitReadable(PlatformHandle h) { |
36 struct pollfd pfds = {}; | 36 struct pollfd pfds = {}; |
37 pfds.fd = h.fd; | 37 pfds.fd = h.fd; |
38 pfds.events = POLLIN; | 38 pfds.events = POLLIN; |
39 CHECK_EQ(poll(&pfds, 1, -1), 1); | 39 CHECK_EQ(poll(&pfds, 1, -1), 1); |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 char read_buf[100]; | 251 char read_buf[100]; |
252 size_t bytes_read = fread(read_buf, 1, sizeof(read_buf), fp.get()); | 252 size_t bytes_read = fread(read_buf, 1, sizeof(read_buf), fp.get()); |
253 EXPECT_EQ(file_contents.size(), bytes_read); | 253 EXPECT_EQ(file_contents.size(), bytes_read); |
254 EXPECT_EQ(file_contents, std::string(read_buf, bytes_read)); | 254 EXPECT_EQ(file_contents, std::string(read_buf, bytes_read)); |
255 } | 255 } |
256 } | 256 } |
257 | 257 |
258 } // namespace | 258 } // namespace |
259 } // namespace edk | 259 } // namespace edk |
260 } // namespace mojo | 260 } // namespace mojo |
OLD | NEW |