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/sync_file_system/drive_backend/sync_worker.h" | 5 #include "chrome/browser/sync_file_system/drive_backend/sync_worker.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 base::RunLoop().RunUntilIdle(); | 198 base::RunLoop().RunUntilIdle(); |
199 EXPECT_EQ(SYNC_STATUS_OK, sync_status); | 199 EXPECT_EQ(SYNC_STATUS_OK, sync_status); |
200 ASSERT_FALSE(metadata_database()->FindAppRootTracker(kAppID, &tracker)); | 200 ASSERT_FALSE(metadata_database()->FindAppRootTracker(kAppID, &tracker)); |
201 } | 201 } |
202 | 202 |
203 TEST_F(SyncWorkerTest, UpdateRegisteredApps) { | 203 TEST_F(SyncWorkerTest, UpdateRegisteredApps) { |
204 SyncStatusCode sync_status = SYNC_STATUS_UNKNOWN; | 204 SyncStatusCode sync_status = SYNC_STATUS_UNKNOWN; |
205 for (int i = 0; i < 3; i++) { | 205 for (int i = 0; i < 3; i++) { |
206 scoped_refptr<const extensions::Extension> extension = | 206 scoped_refptr<const extensions::Extension> extension = |
207 extensions::ExtensionBuilder() | 207 extensions::ExtensionBuilder() |
208 .SetManifest(std::move(extensions::DictionaryBuilder() | 208 .SetManifest(extensions::DictionaryBuilder() |
209 .Set("name", "foo") | 209 .Set("name", "foo") |
210 .Set("version", "1.0") | 210 .Set("version", "1.0") |
211 .Set("manifest_version", 2))) | 211 .Set("manifest_version", 2) |
| 212 .Build()) |
212 .SetID(base::StringPrintf("app_%d", i)) | 213 .SetID(base::StringPrintf("app_%d", i)) |
213 .Build(); | 214 .Build(); |
214 extension_service()->AddExtension(extension.get()); | 215 extension_service()->AddExtension(extension.get()); |
215 GURL origin = extensions::Extension::GetBaseURLFromExtensionId( | 216 GURL origin = extensions::Extension::GetBaseURLFromExtensionId( |
216 extension->id()); | 217 extension->id()); |
217 sync_status = SYNC_STATUS_UNKNOWN; | 218 sync_status = SYNC_STATUS_UNKNOWN; |
218 sync_worker()->RegisterOrigin(origin, CreateResultReceiver(&sync_status)); | 219 sync_worker()->RegisterOrigin(origin, CreateResultReceiver(&sync_status)); |
219 base::RunLoop().RunUntilIdle(); | 220 base::RunLoop().RunUntilIdle(); |
220 EXPECT_EQ(SYNC_STATUS_OK, sync_status); | 221 EXPECT_EQ(SYNC_STATUS_OK, sync_status); |
221 } | 222 } |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 base::Bind(&SyncWorkerTest::CheckServiceState, | 381 base::Bind(&SyncWorkerTest::CheckServiceState, |
381 AsWeakPtr(), | 382 AsWeakPtr(), |
382 SYNC_STATUS_OK, | 383 SYNC_STATUS_OK, |
383 REMOTE_SERVICE_OK)); | 384 REMOTE_SERVICE_OK)); |
384 | 385 |
385 base::RunLoop().RunUntilIdle(); | 386 base::RunLoop().RunUntilIdle(); |
386 } | 387 } |
387 | 388 |
388 } // namespace drive_backend | 389 } // namespace drive_backend |
389 } // namespace sync_file_system | 390 } // namespace sync_file_system |
OLD | NEW |