| 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/sync_engine_initializer.
h" | 5 #include "chrome/browser/sync_file_system/drive_backend/sync_engine_initializer.
h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "chrome/browser/drive/drive_api_util.h" | 10 #include "chrome/browser/drive/drive_api_util.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 return SYNC_STATUS_OK; | 111 return SYNC_STATUS_OK; |
| 112 } | 112 } |
| 113 | 113 |
| 114 scoped_ptr<google_apis::FileResource> CreateRemoteFolder( | 114 scoped_ptr<google_apis::FileResource> CreateRemoteFolder( |
| 115 const std::string& parent_folder_id, | 115 const std::string& parent_folder_id, |
| 116 const std::string& title) { | 116 const std::string& title) { |
| 117 google_apis::GDataErrorCode error = google_apis::GDATA_OTHER_ERROR; | 117 google_apis::GDataErrorCode error = google_apis::GDATA_OTHER_ERROR; |
| 118 scoped_ptr<google_apis::ResourceEntry> entry; | 118 scoped_ptr<google_apis::ResourceEntry> entry; |
| 119 fake_drive_service_.AddNewDirectory( | 119 fake_drive_service_.AddNewDirectory( |
| 120 parent_folder_id, title, | 120 parent_folder_id, title, |
| 121 drive::DriveServiceInterface::AddNewDirectoryOptions(), |
| 121 CreateResultReceiver(&error, &entry)); | 122 CreateResultReceiver(&error, &entry)); |
| 122 base::RunLoop().RunUntilIdle(); | 123 base::RunLoop().RunUntilIdle(); |
| 123 | 124 |
| 124 EXPECT_EQ(google_apis::HTTP_CREATED, error); | 125 EXPECT_EQ(google_apis::HTTP_CREATED, error); |
| 125 if (!entry) | 126 if (!entry) |
| 126 scoped_ptr<google_apis::FileResource>(); | 127 scoped_ptr<google_apis::FileResource>(); |
| 127 return drive::util::ConvertResourceEntryToFileResource(*entry); | 128 return drive::util::ConvertResourceEntryToFileResource(*entry); |
| 128 } | 129 } |
| 129 | 130 |
| 130 scoped_ptr<google_apis::FileResource> CreateRemoteSyncRoot() { | 131 scoped_ptr<google_apis::FileResource> CreateRemoteSyncRoot() { |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 | 326 |
| 326 EXPECT_EQ(0u, CountTrackersForFile(sync_root->file_id())); | 327 EXPECT_EQ(0u, CountTrackersForFile(sync_root->file_id())); |
| 327 EXPECT_FALSE(HasNoParent(sync_root->file_id())); | 328 EXPECT_FALSE(HasNoParent(sync_root->file_id())); |
| 328 | 329 |
| 329 EXPECT_EQ(1u, NumberOfMetadata()); | 330 EXPECT_EQ(1u, NumberOfMetadata()); |
| 330 EXPECT_EQ(1u, NumberOfTrackers()); | 331 EXPECT_EQ(1u, NumberOfTrackers()); |
| 331 } | 332 } |
| 332 | 333 |
| 333 } // namespace drive_backend | 334 } // namespace drive_backend |
| 334 } // namespace sync_file_system | 335 } // namespace sync_file_system |
| OLD | NEW |