| 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 #include "chrome/browser/chromeos/drive/resource_metadata.h" | 5 #include "chrome/browser/chromeos/drive/resource_metadata.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 scoped_ptr<ResourceMetadataStorage, test_util::DestroyHelperForTests> | 152 scoped_ptr<ResourceMetadataStorage, test_util::DestroyHelperForTests> |
| 153 metadata_storage_; | 153 metadata_storage_; |
| 154 scoped_ptr<ResourceMetadata, test_util::DestroyHelperForTests> | 154 scoped_ptr<ResourceMetadata, test_util::DestroyHelperForTests> |
| 155 resource_metadata_; | 155 resource_metadata_; |
| 156 }; | 156 }; |
| 157 | 157 |
| 158 TEST_F(ResourceMetadataTest, LargestChangestamp) { | 158 TEST_F(ResourceMetadataTest, LargestChangestamp) { |
| 159 const int64 kChangestamp = 123456; | 159 const int64 kChangestamp = 123456; |
| 160 EXPECT_EQ(FILE_ERROR_OK, | 160 EXPECT_EQ(FILE_ERROR_OK, |
| 161 resource_metadata_->SetLargestChangestamp(kChangestamp)); | 161 resource_metadata_->SetLargestChangestamp(kChangestamp)); |
| 162 EXPECT_EQ(kChangestamp, resource_metadata_->GetLargestChangestamp()); | 162 int64 changestamp = 0; |
| 163 EXPECT_EQ(FILE_ERROR_OK, |
| 164 resource_metadata_->GetLargestChangestamp(&changestamp)); |
| 165 EXPECT_EQ(kChangestamp, changestamp); |
| 163 } | 166 } |
| 164 | 167 |
| 165 TEST_F(ResourceMetadataTest, GetResourceEntryByPath) { | 168 TEST_F(ResourceMetadataTest, GetResourceEntryByPath) { |
| 166 // Confirm that an existing file is found. | 169 // Confirm that an existing file is found. |
| 167 ResourceEntry entry; | 170 ResourceEntry entry; |
| 168 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->GetResourceEntryByPath( | 171 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->GetResourceEntryByPath( |
| 169 base::FilePath::FromUTF8Unsafe("drive/root/dir1/file4"), &entry)); | 172 base::FilePath::FromUTF8Unsafe("drive/root/dir1/file4"), &entry)); |
| 170 EXPECT_EQ("file4", entry.base_name()); | 173 EXPECT_EQ("file4", entry.base_name()); |
| 171 | 174 |
| 172 // Confirm that a non existing file is not found. | 175 // Confirm that a non existing file is not found. |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 EXPECT_EQ("file9", entry.base_name()); | 223 EXPECT_EQ("file9", entry.base_name()); |
| 221 EXPECT_TRUE(!entry.file_info().is_directory()); | 224 EXPECT_TRUE(!entry.file_info().is_directory()); |
| 222 EXPECT_EQ("md5:file9", entry.file_specific_info().md5()); | 225 EXPECT_EQ("md5:file9", entry.file_specific_info().md5()); |
| 223 | 226 |
| 224 // Rename it. | 227 // Rename it. |
| 225 ResourceEntry file_entry(entry); | 228 ResourceEntry file_entry(entry); |
| 226 file_entry.set_title("file100"); | 229 file_entry.set_title("file100"); |
| 227 EXPECT_EQ(FILE_ERROR_OK, | 230 EXPECT_EQ(FILE_ERROR_OK, |
| 228 resource_metadata_->RefreshEntry(file_entry)); | 231 resource_metadata_->RefreshEntry(file_entry)); |
| 229 | 232 |
| 230 EXPECT_EQ("drive/root/dir1/dir3/file100", | 233 base::FilePath path; |
| 231 resource_metadata_->GetFilePath(file_id).AsUTF8Unsafe()); | 234 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->GetFilePath(file_id, &path)); |
| 235 EXPECT_EQ("drive/root/dir1/dir3/file100", path.AsUTF8Unsafe()); |
| 232 entry.Clear(); | 236 entry.Clear(); |
| 233 EXPECT_EQ(FILE_ERROR_OK, | 237 EXPECT_EQ(FILE_ERROR_OK, |
| 234 resource_metadata_->GetResourceEntryById(file_id, &entry)); | 238 resource_metadata_->GetResourceEntryById(file_id, &entry)); |
| 235 EXPECT_EQ("file100", entry.base_name()); | 239 EXPECT_EQ("file100", entry.base_name()); |
| 236 EXPECT_TRUE(!entry.file_info().is_directory()); | 240 EXPECT_TRUE(!entry.file_info().is_directory()); |
| 237 EXPECT_EQ("md5:file9", entry.file_specific_info().md5()); | 241 EXPECT_EQ("md5:file9", entry.file_specific_info().md5()); |
| 238 | 242 |
| 239 // Update the file md5. | 243 // Update the file md5. |
| 240 const std::string updated_md5("md5:updated"); | 244 const std::string updated_md5("md5:updated"); |
| 241 file_entry = entry; | 245 file_entry = entry; |
| 242 file_entry.mutable_file_specific_info()->set_md5(updated_md5); | 246 file_entry.mutable_file_specific_info()->set_md5(updated_md5); |
| 243 EXPECT_EQ(FILE_ERROR_OK, | 247 EXPECT_EQ(FILE_ERROR_OK, |
| 244 resource_metadata_->RefreshEntry(file_entry)); | 248 resource_metadata_->RefreshEntry(file_entry)); |
| 245 | 249 |
| 246 EXPECT_EQ("drive/root/dir1/dir3/file100", | 250 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->GetFilePath(file_id, &path)); |
| 247 resource_metadata_->GetFilePath(file_id).AsUTF8Unsafe()); | 251 EXPECT_EQ("drive/root/dir1/dir3/file100", path.AsUTF8Unsafe()); |
| 248 entry.Clear(); | 252 entry.Clear(); |
| 249 EXPECT_EQ(FILE_ERROR_OK, | 253 EXPECT_EQ(FILE_ERROR_OK, |
| 250 resource_metadata_->GetResourceEntryById(file_id, &entry)); | 254 resource_metadata_->GetResourceEntryById(file_id, &entry)); |
| 251 EXPECT_EQ("file100", entry.base_name()); | 255 EXPECT_EQ("file100", entry.base_name()); |
| 252 EXPECT_TRUE(!entry.file_info().is_directory()); | 256 EXPECT_TRUE(!entry.file_info().is_directory()); |
| 253 EXPECT_EQ(updated_md5, entry.file_specific_info().md5()); | 257 EXPECT_EQ(updated_md5, entry.file_specific_info().md5()); |
| 254 | 258 |
| 255 // Make sure we get the same thing from GetResourceEntryByPath. | 259 // Make sure we get the same thing from GetResourceEntryByPath. |
| 256 entry.Clear(); | 260 entry.Clear(); |
| 257 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->GetResourceEntryByPath( | 261 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->GetResourceEntryByPath( |
| (...skipping 16 matching lines...) Expand all Loading... |
| 274 std::string dir3_id; | 278 std::string dir3_id; |
| 275 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->GetIdByPath( | 279 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->GetIdByPath( |
| 276 base::FilePath::FromUTF8Unsafe("drive/root/dir1/dir3"), &dir3_id)); | 280 base::FilePath::FromUTF8Unsafe("drive/root/dir1/dir3"), &dir3_id)); |
| 277 | 281 |
| 278 // Change the name to dir100 and change the parent to drive/dir1/dir3. | 282 // Change the name to dir100 and change the parent to drive/dir1/dir3. |
| 279 ResourceEntry dir_entry(entry); | 283 ResourceEntry dir_entry(entry); |
| 280 dir_entry.set_title("dir100"); | 284 dir_entry.set_title("dir100"); |
| 281 dir_entry.set_parent_local_id(dir3_id); | 285 dir_entry.set_parent_local_id(dir3_id); |
| 282 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->RefreshEntry(dir_entry)); | 286 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->RefreshEntry(dir_entry)); |
| 283 | 287 |
| 284 EXPECT_EQ("drive/root/dir1/dir3/dir100", | 288 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->GetFilePath(dir_id, &path)); |
| 285 resource_metadata_->GetFilePath(dir_id).AsUTF8Unsafe()); | 289 EXPECT_EQ("drive/root/dir1/dir3/dir100", path.AsUTF8Unsafe()); |
| 286 entry.Clear(); | 290 entry.Clear(); |
| 287 EXPECT_EQ(FILE_ERROR_OK, | 291 EXPECT_EQ(FILE_ERROR_OK, |
| 288 resource_metadata_->GetResourceEntryById(dir_id, &entry)); | 292 resource_metadata_->GetResourceEntryById(dir_id, &entry)); |
| 289 EXPECT_EQ("dir100", entry.base_name()); | 293 EXPECT_EQ("dir100", entry.base_name()); |
| 290 EXPECT_TRUE(entry.file_info().is_directory()); | 294 EXPECT_TRUE(entry.file_info().is_directory()); |
| 291 EXPECT_EQ("id:dir2", entry.resource_id()); | 295 EXPECT_EQ("id:dir2", entry.resource_id()); |
| 292 | 296 |
| 293 // Make sure the children have moved over. Test file6. | 297 // Make sure the children have moved over. Test file6. |
| 294 entry.Clear(); | 298 entry.Clear(); |
| 295 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->GetResourceEntryByPath( | 299 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->GetResourceEntryByPath( |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 resource_metadata_->RefreshEntry(new_entry)); | 340 resource_metadata_->RefreshEntry(new_entry)); |
| 337 } | 341 } |
| 338 | 342 |
| 339 TEST_F(ResourceMetadataTest, GetSubDirectoriesRecursively) { | 343 TEST_F(ResourceMetadataTest, GetSubDirectoriesRecursively) { |
| 340 std::set<base::FilePath> sub_directories; | 344 std::set<base::FilePath> sub_directories; |
| 341 | 345 |
| 342 // file9: not a directory, so no children. | 346 // file9: not a directory, so no children. |
| 343 std::string local_id; | 347 std::string local_id; |
| 344 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->GetIdByPath( | 348 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->GetIdByPath( |
| 345 base::FilePath::FromUTF8Unsafe("drive/root/dir1/dir3/file9"), &local_id)); | 349 base::FilePath::FromUTF8Unsafe("drive/root/dir1/dir3/file9"), &local_id)); |
| 346 resource_metadata_->GetSubDirectoriesRecursively(local_id, &sub_directories); | 350 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->GetSubDirectoriesRecursively( |
| 351 local_id, &sub_directories)); |
| 347 EXPECT_TRUE(sub_directories.empty()); | 352 EXPECT_TRUE(sub_directories.empty()); |
| 348 | 353 |
| 349 // dir2: no child directories. | 354 // dir2: no child directories. |
| 350 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->GetIdByPath( | 355 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->GetIdByPath( |
| 351 base::FilePath::FromUTF8Unsafe("drive/root/dir2"), &local_id)); | 356 base::FilePath::FromUTF8Unsafe("drive/root/dir2"), &local_id)); |
| 352 resource_metadata_->GetSubDirectoriesRecursively(local_id, &sub_directories); | 357 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->GetSubDirectoriesRecursively( |
| 358 local_id, &sub_directories)); |
| 353 EXPECT_TRUE(sub_directories.empty()); | 359 EXPECT_TRUE(sub_directories.empty()); |
| 354 const std::string dir2_id = local_id; | 360 const std::string dir2_id = local_id; |
| 355 | 361 |
| 356 // dir1: dir3 is the only child | 362 // dir1: dir3 is the only child |
| 357 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->GetIdByPath( | 363 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->GetIdByPath( |
| 358 base::FilePath::FromUTF8Unsafe("drive/root/dir1"), &local_id)); | 364 base::FilePath::FromUTF8Unsafe("drive/root/dir1"), &local_id)); |
| 359 resource_metadata_->GetSubDirectoriesRecursively(local_id, &sub_directories); | 365 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->GetSubDirectoriesRecursively( |
| 366 local_id, &sub_directories)); |
| 360 EXPECT_EQ(1u, sub_directories.size()); | 367 EXPECT_EQ(1u, sub_directories.size()); |
| 361 EXPECT_EQ(1u, sub_directories.count( | 368 EXPECT_EQ(1u, sub_directories.count( |
| 362 base::FilePath::FromUTF8Unsafe("drive/root/dir1/dir3"))); | 369 base::FilePath::FromUTF8Unsafe("drive/root/dir1/dir3"))); |
| 363 sub_directories.clear(); | 370 sub_directories.clear(); |
| 364 | 371 |
| 365 // Add a few more directories to make sure deeper nesting works. | 372 // Add a few more directories to make sure deeper nesting works. |
| 366 // dir2/dir100 | 373 // dir2/dir100 |
| 367 // dir2/dir101 | 374 // dir2/dir101 |
| 368 // dir2/dir101/dir102 | 375 // dir2/dir101/dir102 |
| 369 // dir2/dir101/dir103 | 376 // dir2/dir101/dir103 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 382 CreateDirectoryEntry("dir103", dir101_id), &local_id)); | 389 CreateDirectoryEntry("dir103", dir101_id), &local_id)); |
| 383 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->AddEntry( | 390 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->AddEntry( |
| 384 CreateDirectoryEntry("dir104", dir101_id), &local_id)); | 391 CreateDirectoryEntry("dir104", dir101_id), &local_id)); |
| 385 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->AddEntry( | 392 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->AddEntry( |
| 386 CreateDirectoryEntry("dir105", local_id), &local_id)); | 393 CreateDirectoryEntry("dir105", local_id), &local_id)); |
| 387 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->AddEntry( | 394 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->AddEntry( |
| 388 CreateDirectoryEntry("dir106", local_id), &local_id)); | 395 CreateDirectoryEntry("dir106", local_id), &local_id)); |
| 389 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->AddEntry( | 396 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->AddEntry( |
| 390 CreateDirectoryEntry("dir107", local_id), &local_id)); | 397 CreateDirectoryEntry("dir107", local_id), &local_id)); |
| 391 | 398 |
| 392 resource_metadata_->GetSubDirectoriesRecursively(dir2_id, &sub_directories); | 399 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->GetSubDirectoriesRecursively( |
| 400 dir2_id, &sub_directories)); |
| 393 EXPECT_EQ(8u, sub_directories.size()); | 401 EXPECT_EQ(8u, sub_directories.size()); |
| 394 EXPECT_EQ(1u, sub_directories.count(base::FilePath::FromUTF8Unsafe( | 402 EXPECT_EQ(1u, sub_directories.count(base::FilePath::FromUTF8Unsafe( |
| 395 "drive/root/dir2/dir101"))); | 403 "drive/root/dir2/dir101"))); |
| 396 EXPECT_EQ(1u, sub_directories.count(base::FilePath::FromUTF8Unsafe( | 404 EXPECT_EQ(1u, sub_directories.count(base::FilePath::FromUTF8Unsafe( |
| 397 "drive/root/dir2/dir101/dir104"))); | 405 "drive/root/dir2/dir101/dir104"))); |
| 398 EXPECT_EQ(1u, sub_directories.count(base::FilePath::FromUTF8Unsafe( | 406 EXPECT_EQ(1u, sub_directories.count(base::FilePath::FromUTF8Unsafe( |
| 399 "drive/root/dir2/dir101/dir104/dir105/dir106/dir107"))); | 407 "drive/root/dir2/dir101/dir104/dir105/dir106/dir107"))); |
| 400 } | 408 } |
| 401 | 409 |
| 402 TEST_F(ResourceMetadataTest, AddEntry) { | 410 TEST_F(ResourceMetadataTest, AddEntry) { |
| 403 base::FilePath drive_file_path; | |
| 404 | |
| 405 // Add a file to dir3. | 411 // Add a file to dir3. |
| 406 std::string local_id; | 412 std::string local_id; |
| 407 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->GetIdByPath( | 413 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->GetIdByPath( |
| 408 base::FilePath::FromUTF8Unsafe("drive/root/dir1/dir3"), &local_id)); | 414 base::FilePath::FromUTF8Unsafe("drive/root/dir1/dir3"), &local_id)); |
| 409 ResourceEntry file_entry = CreateFileEntry("file100", local_id); | 415 ResourceEntry file_entry = CreateFileEntry("file100", local_id); |
| 410 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->AddEntry(file_entry, &local_id)); | 416 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->AddEntry(file_entry, &local_id)); |
| 411 EXPECT_EQ("drive/root/dir1/dir3/file100", | 417 base::FilePath path; |
| 412 resource_metadata_->GetFilePath(local_id).AsUTF8Unsafe()); | 418 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->GetFilePath(local_id, &path)); |
| 419 EXPECT_EQ("drive/root/dir1/dir3/file100", path.AsUTF8Unsafe()); |
| 413 | 420 |
| 414 // Add a directory. | 421 // Add a directory. |
| 415 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->GetIdByPath( | 422 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->GetIdByPath( |
| 416 base::FilePath::FromUTF8Unsafe("drive/root/dir1"), &local_id)); | 423 base::FilePath::FromUTF8Unsafe("drive/root/dir1"), &local_id)); |
| 417 ResourceEntry dir_entry = CreateDirectoryEntry("dir101", local_id); | 424 ResourceEntry dir_entry = CreateDirectoryEntry("dir101", local_id); |
| 418 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->AddEntry(dir_entry, &local_id)); | 425 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->AddEntry(dir_entry, &local_id)); |
| 419 EXPECT_EQ("drive/root/dir1/dir101", | 426 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->GetFilePath(local_id, &path)); |
| 420 resource_metadata_->GetFilePath(local_id).AsUTF8Unsafe()); | 427 EXPECT_EQ("drive/root/dir1/dir101", path.AsUTF8Unsafe()); |
| 421 | 428 |
| 422 // Add to an invalid parent. | 429 // Add to an invalid parent. |
| 423 ResourceEntry file_entry3 = CreateFileEntry("file103", "id:invalid"); | 430 ResourceEntry file_entry3 = CreateFileEntry("file103", "id:invalid"); |
| 424 EXPECT_EQ(FILE_ERROR_NOT_FOUND, | 431 EXPECT_EQ(FILE_ERROR_NOT_FOUND, |
| 425 resource_metadata_->AddEntry(file_entry3, &local_id)); | 432 resource_metadata_->AddEntry(file_entry3, &local_id)); |
| 426 | 433 |
| 427 // Add an existing file. | 434 // Add an existing file. |
| 428 EXPECT_EQ(FILE_ERROR_EXISTS, | 435 EXPECT_EQ(FILE_ERROR_EXISTS, |
| 429 resource_metadata_->AddEntry(file_entry, &local_id)); | 436 resource_metadata_->AddEntry(file_entry, &local_id)); |
| 430 } | 437 } |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 std::vector<ResourceEntry> entries; | 622 std::vector<ResourceEntry> entries; |
| 616 ASSERT_EQ(FILE_ERROR_OK, | 623 ASSERT_EQ(FILE_ERROR_OK, |
| 617 resource_metadata_->ReadDirectoryByPath( | 624 resource_metadata_->ReadDirectoryByPath( |
| 618 base::FilePath::FromUTF8Unsafe("drive/root"), &entries)); | 625 base::FilePath::FromUTF8Unsafe("drive/root"), &entries)); |
| 619 ASSERT_FALSE(entries.empty()); | 626 ASSERT_FALSE(entries.empty()); |
| 620 | 627 |
| 621 // Reset. | 628 // Reset. |
| 622 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->Reset()); | 629 EXPECT_EQ(FILE_ERROR_OK, resource_metadata_->Reset()); |
| 623 | 630 |
| 624 // change stamp should be reset. | 631 // change stamp should be reset. |
| 625 EXPECT_EQ(0, resource_metadata_->GetLargestChangestamp()); | 632 int64 changestamp = 0; |
| 633 EXPECT_EQ(FILE_ERROR_OK, |
| 634 resource_metadata_->GetLargestChangestamp(&changestamp)); |
| 635 EXPECT_EQ(0, changestamp); |
| 626 | 636 |
| 627 // root should continue to exist. | 637 // root should continue to exist. |
| 628 ResourceEntry entry; | 638 ResourceEntry entry; |
| 629 ASSERT_EQ(FILE_ERROR_OK, | 639 ASSERT_EQ(FILE_ERROR_OK, |
| 630 resource_metadata_->GetResourceEntryByPath( | 640 resource_metadata_->GetResourceEntryByPath( |
| 631 base::FilePath::FromUTF8Unsafe("drive"), &entry)); | 641 base::FilePath::FromUTF8Unsafe("drive"), &entry)); |
| 632 EXPECT_EQ("drive", entry.base_name()); | 642 EXPECT_EQ("drive", entry.base_name()); |
| 633 ASSERT_TRUE(entry.file_info().is_directory()); | 643 ASSERT_TRUE(entry.file_info().is_directory()); |
| 634 EXPECT_EQ(util::kDriveGrandRootLocalId, entry.local_id()); | 644 EXPECT_EQ(util::kDriveGrandRootLocalId, entry.local_id()); |
| 635 | 645 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 647 | 657 |
| 648 // The "trash" directory should be empty. | 658 // The "trash" directory should be empty. |
| 649 ASSERT_EQ(FILE_ERROR_OK, | 659 ASSERT_EQ(FILE_ERROR_OK, |
| 650 resource_metadata_->ReadDirectoryByPath( | 660 resource_metadata_->ReadDirectoryByPath( |
| 651 base::FilePath::FromUTF8Unsafe("drive/trash"), &entries)); | 661 base::FilePath::FromUTF8Unsafe("drive/trash"), &entries)); |
| 652 EXPECT_TRUE(entries.empty()); | 662 EXPECT_TRUE(entries.empty()); |
| 653 } | 663 } |
| 654 | 664 |
| 655 } // namespace internal | 665 } // namespace internal |
| 656 } // namespace drive | 666 } // namespace drive |
| OLD | NEW |