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/file_system.h" | 5 #include "chrome/browser/chromeos/drive/file_system.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 // "Fast fetch" will fire an OnirectoryChanged event. | 305 // "Fast fetch" will fire an OnirectoryChanged event. |
306 ASSERT_EQ(1u, mock_directory_observer_->changed_directories().size()); | 306 ASSERT_EQ(1u, mock_directory_observer_->changed_directories().size()); |
307 EXPECT_EQ(base::FilePath(FILE_PATH_LITERAL("drive")), | 307 EXPECT_EQ(base::FilePath(FILE_PATH_LITERAL("drive")), |
308 mock_directory_observer_->changed_directories()[0]); | 308 mock_directory_observer_->changed_directories()[0]); |
309 } | 309 } |
310 | 310 |
311 TEST_F(FileSystemTest, GetGrandRootEntry) { | 311 TEST_F(FileSystemTest, GetGrandRootEntry) { |
312 const base::FilePath kFilePath(FILE_PATH_LITERAL("drive")); | 312 const base::FilePath kFilePath(FILE_PATH_LITERAL("drive")); |
313 scoped_ptr<ResourceEntry> entry = GetResourceEntrySync(kFilePath); | 313 scoped_ptr<ResourceEntry> entry = GetResourceEntrySync(kFilePath); |
314 ASSERT_TRUE(entry); | 314 ASSERT_TRUE(entry); |
315 EXPECT_EQ(util::kDriveGrandRootLocalId, entry->resource_id()); | 315 EXPECT_EQ(util::kDriveGrandRootLocalId, entry->local_id()); |
316 | 316 |
317 // Getting the grand root entry should not cause the resource load to happen. | 317 // Getting the grand root entry should not cause the resource load to happen. |
318 EXPECT_EQ(0, fake_drive_service_->about_resource_load_count()); | 318 EXPECT_EQ(0, fake_drive_service_->about_resource_load_count()); |
319 EXPECT_EQ(0, fake_drive_service_->resource_list_load_count()); | 319 EXPECT_EQ(0, fake_drive_service_->resource_list_load_count()); |
320 } | 320 } |
321 | 321 |
322 TEST_F(FileSystemTest, GetOtherDirEntry) { | 322 TEST_F(FileSystemTest, GetOtherDirEntry) { |
323 const base::FilePath kFilePath(FILE_PATH_LITERAL("drive/other")); | 323 const base::FilePath kFilePath(FILE_PATH_LITERAL("drive/other")); |
324 scoped_ptr<ResourceEntry> entry = GetResourceEntrySync(kFilePath); | 324 scoped_ptr<ResourceEntry> entry = GetResourceEntrySync(kFilePath); |
325 ASSERT_TRUE(entry); | 325 ASSERT_TRUE(entry); |
326 EXPECT_EQ(util::kDriveOtherDirLocalId, entry->resource_id()); | 326 EXPECT_EQ(util::kDriveOtherDirLocalId, entry->local_id()); |
327 | 327 |
328 // Getting the "other" directory entry should not cause the resource load to | 328 // Getting the "other" directory entry should not cause the resource load to |
329 // happen. | 329 // happen. |
330 EXPECT_EQ(0, fake_drive_service_->about_resource_load_count()); | 330 EXPECT_EQ(0, fake_drive_service_->about_resource_load_count()); |
331 EXPECT_EQ(0, fake_drive_service_->resource_list_load_count()); | 331 EXPECT_EQ(0, fake_drive_service_->resource_list_load_count()); |
332 } | 332 } |
333 | 333 |
334 TEST_F(FileSystemTest, GetMyDriveRoot) { | 334 TEST_F(FileSystemTest, GetMyDriveRoot) { |
335 const base::FilePath kFilePath(FILE_PATH_LITERAL("drive/root")); | 335 const base::FilePath kFilePath(FILE_PATH_LITERAL("drive/root")); |
336 scoped_ptr<ResourceEntry> entry = GetResourceEntrySync(kFilePath); | 336 scoped_ptr<ResourceEntry> entry = GetResourceEntrySync(kFilePath); |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
737 kEmbedOrigin, | 737 kEmbedOrigin, |
738 google_apis::test_util::CreateCopyResultCallback(&error, &share_url)); | 738 google_apis::test_util::CreateCopyResultCallback(&error, &share_url)); |
739 test_util::RunBlockingPoolTask(); | 739 test_util::RunBlockingPoolTask(); |
740 | 740 |
741 // Verify the error and the share url, which should be empty. | 741 // Verify the error and the share url, which should be empty. |
742 EXPECT_EQ(FILE_ERROR_FAILED, error); | 742 EXPECT_EQ(FILE_ERROR_FAILED, error); |
743 EXPECT_TRUE(share_url.is_empty()); | 743 EXPECT_TRUE(share_url.is_empty()); |
744 } | 744 } |
745 | 745 |
746 } // namespace drive | 746 } // namespace drive |
OLD | NEW |