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 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 // The opened file is downloaded, which means the file is available | 742 // The opened file is downloaded, which means the file is available |
743 // offline. The directory change should be notified so Files.app can change | 743 // offline. The directory change should be notified so Files.app can change |
744 // the offline availability status of the file. | 744 // the offline availability status of the file. |
745 ASSERT_EQ(1u, mock_directory_observer_->changed_directories().size()); | 745 ASSERT_EQ(1u, mock_directory_observer_->changed_directories().size()); |
746 EXPECT_EQ(base::FilePath(FILE_PATH_LITERAL("drive/root")), | 746 EXPECT_EQ(base::FilePath(FILE_PATH_LITERAL("drive/root")), |
747 mock_directory_observer_->changed_directories()[0]); | 747 mock_directory_observer_->changed_directories()[0]); |
748 | 748 |
749 // Verify that the file contents match the expected contents. | 749 // Verify that the file contents match the expected contents. |
750 const std::string kExpectedContent = "This is some test content."; | 750 const std::string kExpectedContent = "This is some test content."; |
751 std::string cache_file_data; | 751 std::string cache_file_data; |
752 EXPECT_TRUE(file_util::ReadFileToString(opened_file_path, &cache_file_data)); | 752 EXPECT_TRUE(base::ReadFileToString(opened_file_path, &cache_file_data)); |
753 EXPECT_EQ(kExpectedContent, cache_file_data); | 753 EXPECT_EQ(kExpectedContent, cache_file_data); |
754 | 754 |
755 FileCacheEntry cache_entry; | 755 FileCacheEntry cache_entry; |
756 EXPECT_TRUE(cache_->GetCacheEntry(file_resource_id, &cache_entry)); | 756 EXPECT_TRUE(cache_->GetCacheEntry(file_resource_id, &cache_entry)); |
757 EXPECT_TRUE(cache_entry.is_present()); | 757 EXPECT_TRUE(cache_entry.is_present()); |
758 EXPECT_TRUE(cache_entry.is_dirty()); | 758 EXPECT_TRUE(cache_entry.is_dirty()); |
759 | 759 |
760 base::FilePath cache_file_path; | 760 base::FilePath cache_file_path; |
761 EXPECT_EQ(FILE_ERROR_OK, cache_->GetFile(file_resource_id, &cache_file_path)); | 761 EXPECT_EQ(FILE_ERROR_OK, cache_->GetFile(file_resource_id, &cache_file_path)); |
762 EXPECT_EQ(cache_file_path, opened_file_path); | 762 EXPECT_EQ(cache_file_path, opened_file_path); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 kEmbedOrigin, | 867 kEmbedOrigin, |
868 google_apis::test_util::CreateCopyResultCallback(&error, &share_url)); | 868 google_apis::test_util::CreateCopyResultCallback(&error, &share_url)); |
869 test_util::RunBlockingPoolTask(); | 869 test_util::RunBlockingPoolTask(); |
870 | 870 |
871 // Verify the error and the share url, which should be empty. | 871 // Verify the error and the share url, which should be empty. |
872 EXPECT_EQ(FILE_ERROR_FAILED, error); | 872 EXPECT_EQ(FILE_ERROR_FAILED, error); |
873 EXPECT_TRUE(share_url.is_empty()); | 873 EXPECT_TRUE(share_url.is_empty()); |
874 } | 874 } |
875 | 875 |
876 } // namespace drive | 876 } // namespace drive |
OLD | NEW |