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 <string.h> | 7 #include <string.h> |
8 #include <gmock/gmock.h> | 8 #include <gmock/gmock.h> |
9 #include <ppapi/c/ppb_file_io.h> | 9 #include <ppapi/c/ppb_file_io.h> |
10 #include <ppapi/c/pp_errors.h> | 10 #include <ppapi/c/pp_errors.h> |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 SetUpFilesystemExpectations(PP_FILESYSTEMTYPE_LOCALPERSISTENT, 0); | 170 SetUpFilesystemExpectations(PP_FILESYSTEMTYPE_LOCALPERSISTENT, 0); |
171 InitFilesystem(); | 171 InitFilesystem(); |
172 SetUpNodeExpectations(); | 172 SetUpNodeExpectations(); |
173 InitNode(); | 173 InitNode(); |
174 } | 174 } |
175 | 175 |
176 void ReadEntriesAction(const PP_ArrayOutput& output) { | 176 void ReadEntriesAction(const PP_ArrayOutput& output) { |
177 const int fileref_resource_1 = 238; | 177 const int fileref_resource_1 = 238; |
178 const int fileref_resource_2 = 239; | 178 const int fileref_resource_2 = 239; |
179 | 179 |
180 std::vector<PP_DirectoryEntry_Dev> entries; | 180 std::vector<PP_DirectoryEntry> entries; |
181 PP_DirectoryEntry_Dev entry1 = { fileref_resource_1, PP_FILETYPE_REGULAR }; | 181 PP_DirectoryEntry entry1 = { fileref_resource_1, PP_FILETYPE_REGULAR }; |
182 PP_DirectoryEntry_Dev entry2 = { fileref_resource_2, PP_FILETYPE_REGULAR }; | 182 PP_DirectoryEntry entry2 = { fileref_resource_2, PP_FILETYPE_REGULAR }; |
183 entries.push_back(entry1); | 183 entries.push_back(entry1); |
184 entries.push_back(entry2); | 184 entries.push_back(entry2); |
185 | 185 |
186 void* dest = output.GetDataBuffer( | 186 void* dest = output.GetDataBuffer( |
187 output.user_data, 2, sizeof(PP_DirectoryEntry_Dev)); | 187 output.user_data, 2, sizeof(PP_DirectoryEntry)); |
188 memcpy(dest, &entries[0], sizeof(PP_DirectoryEntry_Dev) * 2); | 188 memcpy(dest, &entries[0], sizeof(PP_DirectoryEntry) * 2); |
189 } | 189 } |
190 | 190 |
191 class MountHtml5FsNodeAsyncTest : public MountHtml5FsNodeTest { | 191 class MountHtml5FsNodeAsyncTest : public MountHtml5FsNodeTest { |
192 public: | 192 public: |
193 virtual void SetUp(); | 193 virtual void SetUp(); |
194 virtual void TearDown(); | 194 virtual void TearDown(); |
195 | 195 |
196 private: | 196 private: |
197 static void* ThreadThunk(void* param); | 197 static void* ThreadThunk(void* param); |
198 void Thread(); | 198 void Thread(); |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 EXPECT_CALL(*ppapi_, ReleaseResource(fileref_resource_2)); | 445 EXPECT_CALL(*ppapi_, ReleaseResource(fileref_resource_2)); |
446 | 446 |
447 struct dirent dirents[2]; | 447 struct dirent dirents[2]; |
448 memset(&dirents[0], 0, sizeof(dirents)); | 448 memset(&dirents[0], 0, sizeof(dirents)); |
449 int result = node_->GetDents(0, &dirents[0], sizeof(dirent) * 2); | 449 int result = node_->GetDents(0, &dirents[0], sizeof(dirent) * 2); |
450 | 450 |
451 EXPECT_EQ(0, result); | 451 EXPECT_EQ(0, result); |
452 EXPECT_STREQ(&fileref_name_cstr_1[0], &dirents[0].d_name[0]); | 452 EXPECT_STREQ(&fileref_name_cstr_1[0], &dirents[0].d_name[0]); |
453 EXPECT_STREQ(&fileref_name_cstr_2[0], &dirents[1].d_name[0]); | 453 EXPECT_STREQ(&fileref_name_cstr_2[0], &dirents[1].d_name[0]); |
454 } | 454 } |
OLD | NEW |