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/sync_file_system/drive_backend/register_app_task.h" | 5 #include "chrome/browser/sync_file_system/drive_backend/register_app_task.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <utility> | 10 #include <utility> |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 | 198 |
199 bool IsAppRegistered(const std::string& app_id) { | 199 bool IsAppRegistered(const std::string& app_id) { |
200 TrackerIDSet trackers; | 200 TrackerIDSet trackers; |
201 if (!context_->GetMetadataDatabase()->FindTrackersByParentAndTitle( | 201 if (!context_->GetMetadataDatabase()->FindTrackersByParentAndTitle( |
202 kSyncRootTrackerID, app_id, &trackers)) | 202 kSyncRootTrackerID, app_id, &trackers)) |
203 return false; | 203 return false; |
204 return trackers.has_active(); | 204 return trackers.has_active(); |
205 } | 205 } |
206 | 206 |
207 size_t CountRemoteFileInSyncRoot() { | 207 size_t CountRemoteFileInSyncRoot() { |
208 ScopedVector<google_apis::FileResource> files; | 208 std::vector<std::unique_ptr<google_apis::FileResource>> files; |
209 EXPECT_EQ(google_apis::HTTP_SUCCESS, | 209 EXPECT_EQ(google_apis::HTTP_SUCCESS, |
210 fake_drive_service_helper_->ListFilesInFolder( | 210 fake_drive_service_helper_->ListFilesInFolder( |
211 sync_root_folder_id_, &files)); | 211 sync_root_folder_id_, &files)); |
212 return files.size(); | 212 return files.size(); |
213 } | 213 } |
214 | 214 |
215 bool GetAppRootFolderID(const std::string& app_id, | 215 bool GetAppRootFolderID(const std::string& app_id, |
216 std::string* app_root_folder_id) { | 216 std::string* app_root_folder_id) { |
217 TrackerIDSet files; | 217 TrackerIDSet files; |
218 if (!context_->GetMetadataDatabase()->FindTrackersByParentAndTitle( | 218 if (!context_->GetMetadataDatabase()->FindTrackersByParentAndTitle( |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 | 335 |
336 CreateMetadataDatabase(std::move(db)); | 336 CreateMetadataDatabase(std::move(db)); |
337 RunRegisterAppTask(kAppID); | 337 RunRegisterAppTask(kAppID); |
338 | 338 |
339 EXPECT_EQ(1u, CountRegisteredAppRoot()); | 339 EXPECT_EQ(1u, CountRegisteredAppRoot()); |
340 EXPECT_TRUE(IsAppRegistered(kAppID)); | 340 EXPECT_TRUE(IsAppRegistered(kAppID)); |
341 } | 341 } |
342 | 342 |
343 } // namespace drive_backend | 343 } // namespace drive_backend |
344 } // namespace sync_file_system | 344 } // namespace sync_file_system |
OLD | NEW |