| 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 "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/format_macros.h" | 8 #include "base/format_macros.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 fake_drive_service_.reset(new drive::FakeDriveService); | 45 fake_drive_service_.reset(new drive::FakeDriveService); |
| 46 ASSERT_TRUE(fake_drive_service_->LoadAccountMetadataForWapi( | 46 ASSERT_TRUE(fake_drive_service_->LoadAccountMetadataForWapi( |
| 47 "sync_file_system/account_metadata.json")); | 47 "sync_file_system/account_metadata.json")); |
| 48 ASSERT_TRUE(fake_drive_service_->LoadResourceListForWapi( | 48 ASSERT_TRUE(fake_drive_service_->LoadResourceListForWapi( |
| 49 "gdata/empty_feed.json")); | 49 "gdata/empty_feed.json")); |
| 50 | 50 |
| 51 drive_uploader_.reset(new drive::DriveUploader( | 51 drive_uploader_.reset(new drive::DriveUploader( |
| 52 fake_drive_service_.get(), base::MessageLoopProxy::current())); | 52 fake_drive_service_.get(), base::MessageLoopProxy::current())); |
| 53 | 53 |
| 54 fake_drive_service_helper_.reset(new FakeDriveServiceHelper( | 54 fake_drive_service_helper_.reset(new FakeDriveServiceHelper( |
| 55 fake_drive_service_.get(), drive_uploader_.get())); | 55 fake_drive_service_.get(), drive_uploader_.get(), |
| 56 kSyncRootFolderTitle)); |
| 56 | 57 |
| 57 ASSERT_EQ(google_apis::HTTP_CREATED, | 58 ASSERT_EQ(google_apis::HTTP_CREATED, |
| 58 fake_drive_service_helper_->AddOrphanedFolder( | 59 fake_drive_service_helper_->AddOrphanedFolder( |
| 59 kSyncRootFolderTitle, &sync_root_folder_id_)); | 60 kSyncRootFolderTitle, &sync_root_folder_id_)); |
| 60 } | 61 } |
| 61 | 62 |
| 62 virtual void TearDown() OVERRIDE { | 63 virtual void TearDown() OVERRIDE { |
| 63 metadata_database_.reset(); | 64 metadata_database_.reset(); |
| 64 base::RunLoop().RunUntilIdle(); | 65 base::RunLoop().RunUntilIdle(); |
| 65 } | 66 } |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 | 324 |
| 324 CreateMetadataDatabase(db.Pass()); | 325 CreateMetadataDatabase(db.Pass()); |
| 325 RunRegisterAppTask(kAppID); | 326 RunRegisterAppTask(kAppID); |
| 326 | 327 |
| 327 EXPECT_EQ(1u, CountRegisteredAppRoot()); | 328 EXPECT_EQ(1u, CountRegisteredAppRoot()); |
| 328 EXPECT_TRUE(IsAppRegistered(kAppID)); | 329 EXPECT_TRUE(IsAppRegistered(kAppID)); |
| 329 } | 330 } |
| 330 | 331 |
| 331 } // namespace drive_backend | 332 } // namespace drive_backend |
| 332 } // namespace sync_file_system | 333 } // namespace sync_file_system |
| OLD | NEW |