| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/fake_file_system.h" | 5 #include "chrome/browser/chromeos/drive/fake_file_system.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "chrome/browser/chromeos/drive/file_system_util.h" | 9 #include "chrome/browser/chromeos/drive/file_system_util.h" |
| 10 #include "chrome/browser/drive/fake_drive_service.h" | 10 #include "chrome/browser/drive/fake_drive_service.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 FileError error = FILE_ERROR_FAILED; | 115 FileError error = FILE_ERROR_FAILED; |
| 116 scoped_ptr<ResourceEntry> entry; | 116 scoped_ptr<ResourceEntry> entry; |
| 117 fake_file_system_->GetResourceEntry( | 117 fake_file_system_->GetResourceEntry( |
| 118 util::GetDriveMyDriveRootPath().AppendASCII( | 118 util::GetDriveMyDriveRootPath().AppendASCII( |
| 119 "Directory 1/Sub Directory Folder"), | 119 "Directory 1/Sub Directory Folder"), |
| 120 google_apis::test_util::CreateCopyResultCallback(&error, &entry)); | 120 google_apis::test_util::CreateCopyResultCallback(&error, &entry)); |
| 121 base::RunLoop().RunUntilIdle(); | 121 base::RunLoop().RunUntilIdle(); |
| 122 | 122 |
| 123 ASSERT_EQ(FILE_ERROR_OK, error); | 123 ASSERT_EQ(FILE_ERROR_OK, error); |
| 124 ASSERT_TRUE(entry); | 124 ASSERT_TRUE(entry); |
| 125 EXPECT_EQ("folder:sub_dir_folder_resource_id", entry->resource_id()); | 125 EXPECT_EQ("sub_dir_folder_resource_id", entry->resource_id()); |
| 126 } | 126 } |
| 127 | 127 |
| 128 TEST_F(FakeFileSystemTest, GetResourceEntry_Root) { | 128 TEST_F(FakeFileSystemTest, GetResourceEntry_Root) { |
| 129 FileError error = FILE_ERROR_FAILED; | 129 FileError error = FILE_ERROR_FAILED; |
| 130 scoped_ptr<ResourceEntry> entry; | 130 scoped_ptr<ResourceEntry> entry; |
| 131 fake_file_system_->GetResourceEntry( | 131 fake_file_system_->GetResourceEntry( |
| 132 util::GetDriveMyDriveRootPath(), | 132 util::GetDriveMyDriveRootPath(), |
| 133 google_apis::test_util::CreateCopyResultCallback(&error, &entry)); | 133 google_apis::test_util::CreateCopyResultCallback(&error, &entry)); |
| 134 base::RunLoop().RunUntilIdle(); | 134 base::RunLoop().RunUntilIdle(); |
| 135 | 135 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 147 util::GetDriveMyDriveRootPath().AppendASCII("Invalid File Name"), | 147 util::GetDriveMyDriveRootPath().AppendASCII("Invalid File Name"), |
| 148 google_apis::test_util::CreateCopyResultCallback(&error, &entry)); | 148 google_apis::test_util::CreateCopyResultCallback(&error, &entry)); |
| 149 base::RunLoop().RunUntilIdle(); | 149 base::RunLoop().RunUntilIdle(); |
| 150 | 150 |
| 151 ASSERT_EQ(FILE_ERROR_NOT_FOUND, error); | 151 ASSERT_EQ(FILE_ERROR_NOT_FOUND, error); |
| 152 ASSERT_FALSE(entry); | 152 ASSERT_FALSE(entry); |
| 153 } | 153 } |
| 154 | 154 |
| 155 } // namespace test_util | 155 } // namespace test_util |
| 156 } // namespace drive | 156 } // namespace drive |
| OLD | NEW |