| 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 <errno.h> | 6 #include <errno.h> |
| 7 #include <fcntl.h> | 7 #include <fcntl.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 #include <gmock/gmock.h> | 9 #include <gmock/gmock.h> |
| 10 #include <ppapi/c/ppb_file_io.h> | 10 #include <ppapi/c/ppb_file_io.h> |
| 11 #include <ppapi/c/pp_directory_entry.h> | 11 #include <ppapi/c/pp_directory_entry.h> |
| 12 #include <ppapi/c/pp_errors.h> | 12 #include <ppapi/c/pp_errors.h> |
| 13 #include <ppapi/c/pp_instance.h> | 13 #include <ppapi/c/pp_instance.h> |
| 14 #if defined(WIN32) | 14 #if defined(WIN32) |
| 15 #include <windows.h> // For Sleep() | 15 #include <windows.h> // For Sleep() |
| 16 #endif | 16 #endif |
| 17 | 17 |
| 18 #include "mock_util.h" | 18 #include "mock_util.h" |
| 19 #include "nacl_io/mount_html5fs.h" | 19 #include "nacl_io/mount_html5fs.h" |
| 20 #include "nacl_io/osdirent.h" | 20 #include "nacl_io/osdirent.h" |
| 21 #include "nacl_io/osunistd.h" |
| 21 #include "pepper_interface_mock.h" | 22 #include "pepper_interface_mock.h" |
| 22 | 23 |
| 23 using ::testing::_; | 24 using ::testing::_; |
| 24 using ::testing::DoAll; | 25 using ::testing::DoAll; |
| 25 using ::testing::Invoke; | 26 using ::testing::Invoke; |
| 26 using ::testing::Return; | 27 using ::testing::Return; |
| 27 using ::testing::SaveArg; | 28 using ::testing::SaveArg; |
| 28 using ::testing::SetArgPointee; | 29 using ::testing::SetArgPointee; |
| 29 using ::testing::StrEq; | 30 using ::testing::StrEq; |
| 30 using ::testing::WithArgs; | 31 using ::testing::WithArgs; |
| (...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 ASSERT_EQ(sizeof(dirent) * 2, result_bytes); | 623 ASSERT_EQ(sizeof(dirent) * 2, result_bytes); |
| 623 EXPECT_LT(0, dirents[0].d_ino); // 0 is an invalid inode number. | 624 EXPECT_LT(0, dirents[0].d_ino); // 0 is an invalid inode number. |
| 624 EXPECT_EQ(sizeof(dirent), dirents[0].d_off); | 625 EXPECT_EQ(sizeof(dirent), dirents[0].d_off); |
| 625 EXPECT_EQ(sizeof(dirent), dirents[0].d_reclen); | 626 EXPECT_EQ(sizeof(dirent), dirents[0].d_reclen); |
| 626 EXPECT_STREQ(fileref_name_cstr_1, dirents[0].d_name); | 627 EXPECT_STREQ(fileref_name_cstr_1, dirents[0].d_name); |
| 627 EXPECT_LT(0, dirents[1].d_ino); // 0 is an invalid inode number. | 628 EXPECT_LT(0, dirents[1].d_ino); // 0 is an invalid inode number. |
| 628 EXPECT_EQ(sizeof(dirent), dirents[1].d_off); | 629 EXPECT_EQ(sizeof(dirent), dirents[1].d_off); |
| 629 EXPECT_EQ(sizeof(dirent), dirents[1].d_reclen); | 630 EXPECT_EQ(sizeof(dirent), dirents[1].d_reclen); |
| 630 EXPECT_STREQ(fileref_name_cstr_2, dirents[1].d_name); | 631 EXPECT_STREQ(fileref_name_cstr_2, dirents[1].d_name); |
| 631 } | 632 } |
| OLD | NEW |