| 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> |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 int32_t open_flags = PP_FILEOPENFLAG_READ | PP_FILEOPENFLAG_WRITE | | 154 int32_t open_flags = PP_FILEOPENFLAG_READ | PP_FILEOPENFLAG_WRITE | |
| 155 PP_FILEOPENFLAG_CREATE; | 155 PP_FILEOPENFLAG_CREATE; |
| 156 EXPECT_CALL(*fileio_, | 156 EXPECT_CALL(*fileio_, |
| 157 Open(fileio_resource_, fileref_resource_, open_flags, _)) | 157 Open(fileio_resource_, fileref_resource_, open_flags, _)) |
| 158 .WillOnce(Return(int32_t(PP_OK))); | 158 .WillOnce(Return(int32_t(PP_OK))); |
| 159 | 159 |
| 160 // Close. | 160 // Close. |
| 161 EXPECT_CALL(*fileio_, Close(fileio_resource_)); | 161 EXPECT_CALL(*fileio_, Close(fileio_resource_)); |
| 162 EXPECT_CALL(*ppapi_, ReleaseResource(fileref_resource_)); | 162 EXPECT_CALL(*ppapi_, ReleaseResource(fileref_resource_)); |
| 163 EXPECT_CALL(*ppapi_, ReleaseResource(fileio_resource_)); | 163 EXPECT_CALL(*ppapi_, ReleaseResource(fileio_resource_)); |
| 164 EXPECT_CALL(*fileio_, Flush(fileio_resource_, _)); |
| 164 | 165 |
| 165 node_ = mnt_->Open(Path(path_), O_CREAT | O_RDWR); | 166 node_ = mnt_->Open(Path(path_), O_CREAT | O_RDWR); |
| 166 ASSERT_NE((MountNode*)NULL, node_); | 167 ASSERT_NE((MountNode*)NULL, node_); |
| 167 } | 168 } |
| 168 | 169 |
| 169 void MountHtml5FsNodeTest::TearDown() { | 170 void MountHtml5FsNodeTest::TearDown() { |
| 170 mnt_->ReleaseNode(node_); | 171 mnt_->ReleaseNode(node_); |
| 171 delete mnt_; | 172 delete mnt_; |
| 172 } | 173 } |
| 173 | 174 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 EXPECT_CALL(*ppapi_, ReleaseResource(dir_reader_resource)); | 348 EXPECT_CALL(*ppapi_, ReleaseResource(dir_reader_resource)); |
| 348 | 349 |
| 349 struct dirent dirents[2]; | 350 struct dirent dirents[2]; |
| 350 memset(&dirents[0], 0, sizeof(dirents)); | 351 memset(&dirents[0], 0, sizeof(dirents)); |
| 351 int result = node_->GetDents(0, &dirents[0], sizeof(dirent) * 2); | 352 int result = node_->GetDents(0, &dirents[0], sizeof(dirent) * 2); |
| 352 | 353 |
| 353 EXPECT_EQ(0, result); | 354 EXPECT_EQ(0, result); |
| 354 EXPECT_STREQ(&fileref_name_cstr_1[0], &dirents[0].d_name[0]); | 355 EXPECT_STREQ(&fileref_name_cstr_1[0], &dirents[0].d_name[0]); |
| 355 EXPECT_STREQ(&fileref_name_cstr_2[0], &dirents[1].d_name[0]); | 356 EXPECT_STREQ(&fileref_name_cstr_2[0], &dirents[1].d_name[0]); |
| 356 } | 357 } |
| OLD | NEW |