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 | 5 |
6 #include <fcntl.h> | 6 #include <fcntl.h> |
7 #include <gmock/gmock.h> | 7 #include <gmock/gmock.h> |
8 #include <ppapi/c/ppb_file_io.h> | 8 #include <ppapi/c/ppb_file_io.h> |
9 #include <ppapi/c/pp_errors.h> | 9 #include <ppapi/c/pp_errors.h> |
10 #include <ppapi/c/pp_instance.h> | 10 #include <ppapi/c/pp_instance.h> |
11 #include <sys/stat.h> | 11 #include <sys/stat.h> |
12 #include <sys/types.h> | 12 #include <sys/types.h> |
13 | 13 |
14 #include "mock_util.h" | 14 #include "mock_util.h" |
15 #include "nacl_io/kernel_intercept.h" | 15 #include "nacl_io/kernel_intercept.h" |
16 #include "nacl_io/mount_http.h" | 16 #include "nacl_io/mount_http.h" |
17 #include "nacl_io/mount_node_dir.h" | 17 #include "nacl_io/mount_node_dir.h" |
18 #include "nacl_io/osdirent.h" | 18 #include "nacl_io/osdirent.h" |
| 19 #include "nacl_io/osunistd.h" |
19 #include "pepper_interface_mock.h" | 20 #include "pepper_interface_mock.h" |
20 | 21 |
21 using ::testing::_; | 22 using ::testing::_; |
22 using ::testing::DoAll; | 23 using ::testing::DoAll; |
23 using ::testing::Mock; | 24 using ::testing::Mock; |
24 using ::testing::Return; | 25 using ::testing::Return; |
25 using ::testing::SetArgPointee; | 26 using ::testing::SetArgPointee; |
26 using ::testing::StrEq; | 27 using ::testing::StrEq; |
27 | 28 |
28 | 29 |
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
599 memset(&buf[0], 0, sizeof(buf)); | 600 memset(&buf[0], 0, sizeof(buf)); |
600 | 601 |
601 ExpectOpen("GET"); | 602 ExpectOpen("GET"); |
602 ExpectHeaders("Range: bytes=10-18\n"); | 603 ExpectHeaders("Range: bytes=10-18\n"); |
603 SetResponse(200, "Content-Length: 20\n"); | 604 SetResponse(200, "Content-Length: 20\n"); |
604 SetResponseBody("0123456789abcdefghij"); | 605 SetResponseBody("0123456789abcdefghij"); |
605 EXPECT_EQ(0, node_->Read(10, buf, sizeof(buf) - 1, &result_bytes)); | 606 EXPECT_EQ(0, node_->Read(10, buf, sizeof(buf) - 1, &result_bytes)); |
606 EXPECT_EQ(sizeof(buf) - 1, result_bytes); | 607 EXPECT_EQ(sizeof(buf) - 1, result_bytes); |
607 EXPECT_STREQ("abcdefghi", &buf[0]); | 608 EXPECT_STREQ("abcdefghi", &buf[0]); |
608 } | 609 } |
OLD | NEW |