| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/drive/test_util.h" | 5 #include "chrome/browser/drive/test_util.h" |
| 6 | 6 |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "chrome/browser/drive/drive_api_util.h" | 8 #include "chrome/browser/drive/drive_api_util.h" |
| 9 #include "chrome/browser/drive/fake_drive_service.h" | 9 #include "chrome/browser/drive/fake_drive_service.h" |
| 10 #include "google_apis/drive/drive_api_parser.h" | 10 #include "google_apis/drive/drive_api_parser.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 "This is some test content.", | 112 "This is some test content.", |
| 113 "1_folder_resource_id", | 113 "1_folder_resource_id", |
| 114 "Shared to The Account Owner.txt", | 114 "Shared to The Account Owner.txt", |
| 115 true, // shared_with_me | 115 true, // shared_with_me |
| 116 google_apis::test_util::CreateCopyResultCallback(&error, &entry)); | 116 google_apis::test_util::CreateCopyResultCallback(&error, &entry)); |
| 117 base::RunLoop().RunUntilIdle(); | 117 base::RunLoop().RunUntilIdle(); |
| 118 if (error != HTTP_CREATED) | 118 if (error != HTTP_CREATED) |
| 119 return false; | 119 return false; |
| 120 | 120 |
| 121 drive_service->AddNewDirectoryWithResourceId( | 121 drive_service->AddNewDirectoryWithResourceId( |
| 122 "sub_dir_folder_resource_id", | 122 "sub_dir_folder_resource_id", "1_folder_resource_id", |
| 123 "1_folder_resource_id", | 123 "Sub Directory Folder", AddNewDirectoryOptions(), |
| 124 "Sub Directory Folder", | |
| 125 DriveServiceInterface::AddNewDirectoryOptions(), | |
| 126 google_apis::test_util::CreateCopyResultCallback(&error, &entry)); | 124 google_apis::test_util::CreateCopyResultCallback(&error, &entry)); |
| 127 base::RunLoop().RunUntilIdle(); | 125 base::RunLoop().RunUntilIdle(); |
| 128 if (error != HTTP_CREATED) | 126 if (error != HTTP_CREATED) |
| 129 return false; | 127 return false; |
| 130 | 128 |
| 131 drive_service->AddNewDirectoryWithResourceId( | 129 drive_service->AddNewDirectoryWithResourceId( |
| 132 "sub_sub_directory_folder_id", | 130 "sub_sub_directory_folder_id", "sub_dir_folder_resource_id", |
| 133 "sub_dir_folder_resource_id", | 131 "Sub Sub Directory Folder", AddNewDirectoryOptions(), |
| 134 "Sub Sub Directory Folder", | |
| 135 DriveServiceInterface::AddNewDirectoryOptions(), | |
| 136 google_apis::test_util::CreateCopyResultCallback(&error, &entry)); | 132 google_apis::test_util::CreateCopyResultCallback(&error, &entry)); |
| 137 base::RunLoop().RunUntilIdle(); | 133 base::RunLoop().RunUntilIdle(); |
| 138 if (error != HTTP_CREATED) | 134 if (error != HTTP_CREATED) |
| 139 return false; | 135 return false; |
| 140 | 136 |
| 141 drive_service->AddNewDirectoryWithResourceId( | 137 drive_service->AddNewDirectoryWithResourceId( |
| 142 "slash_dir_folder_resource_id", | 138 "slash_dir_folder_resource_id", drive_service->GetRootResourceId(), |
| 143 drive_service->GetRootResourceId(), | 139 "Slash / in directory", AddNewDirectoryOptions(), |
| 144 "Slash / in directory", | |
| 145 DriveServiceInterface::AddNewDirectoryOptions(), | |
| 146 google_apis::test_util::CreateCopyResultCallback(&error, &entry)); | 140 google_apis::test_util::CreateCopyResultCallback(&error, &entry)); |
| 147 base::RunLoop().RunUntilIdle(); | 141 base::RunLoop().RunUntilIdle(); |
| 148 if (error != HTTP_CREATED) | 142 if (error != HTTP_CREATED) |
| 149 return false; | 143 return false; |
| 150 | 144 |
| 151 drive_service->AddNewFileWithResourceId( | 145 drive_service->AddNewFileWithResourceId( |
| 152 "slash_subdir_file", | 146 "slash_subdir_file", |
| 153 "audio/mpeg", | 147 "audio/mpeg", |
| 154 "This is some test content.", | 148 "This is some test content.", |
| 155 "slash_dir_folder_resource_id", | 149 "slash_dir_folder_resource_id", |
| 156 "Slash SubDir File.txt", | 150 "Slash SubDir File.txt", |
| 157 false, // shared_with_me | 151 false, // shared_with_me |
| 158 google_apis::test_util::CreateCopyResultCallback(&error, &entry)); | 152 google_apis::test_util::CreateCopyResultCallback(&error, &entry)); |
| 159 base::RunLoop().RunUntilIdle(); | 153 base::RunLoop().RunUntilIdle(); |
| 160 if (error != HTTP_CREATED) | 154 if (error != HTTP_CREATED) |
| 161 return false; | 155 return false; |
| 162 | 156 |
| 163 drive_service->AddNewDirectoryWithResourceId( | 157 drive_service->AddNewDirectoryWithResourceId( |
| 164 "sub_dir_folder_2_self_link", | 158 "sub_dir_folder_2_self_link", drive_service->GetRootResourceId(), |
| 165 drive_service->GetRootResourceId(), | 159 "Directory 2 excludeDir-test", AddNewDirectoryOptions(), |
| 166 "Directory 2 excludeDir-test", | |
| 167 DriveServiceInterface::AddNewDirectoryOptions(), | |
| 168 google_apis::test_util::CreateCopyResultCallback(&error, &entry)); | 160 google_apis::test_util::CreateCopyResultCallback(&error, &entry)); |
| 169 base::RunLoop().RunUntilIdle(); | 161 base::RunLoop().RunUntilIdle(); |
| 170 if (error != HTTP_CREATED) | 162 if (error != HTTP_CREATED) |
| 171 return false; | 163 return false; |
| 172 | 164 |
| 173 drive_service->AddNewFileWithResourceId( | 165 drive_service->AddNewFileWithResourceId( |
| 174 "1_orphanfile_resource_id", | 166 "1_orphanfile_resource_id", |
| 175 "text/plain", | 167 "text/plain", |
| 176 "This is some test content.", | 168 "This is some test content.", |
| 177 std::string(), | 169 std::string(), |
| (...skipping 14 matching lines...) Expand all Loading... |
| 192 google_apis::test_util::CreateCopyResultCallback(&error, &entry)); | 184 google_apis::test_util::CreateCopyResultCallback(&error, &entry)); |
| 193 base::RunLoop().RunUntilIdle(); | 185 base::RunLoop().RunUntilIdle(); |
| 194 if (error != HTTP_CREATED) | 186 if (error != HTTP_CREATED) |
| 195 return false; | 187 return false; |
| 196 | 188 |
| 197 return true; | 189 return true; |
| 198 } | 190 } |
| 199 | 191 |
| 200 } // namespace test_util | 192 } // namespace test_util |
| 201 } // namespace drive | 193 } // namespace drive |
| OLD | NEW |