| 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/chromeos/drive/directory_loader.h" | 5 #include "chrome/browser/chromeos/drive/directory_loader.h" |
| 6 | 6 |
| 7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
| 8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/prefs/testing_pref_service.h" | 10 #include "base/prefs/testing_pref_service.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 new DirectoryLoader(logger_.get(), | 100 new DirectoryLoader(logger_.get(), |
| 101 base::MessageLoopProxy::current().get(), | 101 base::MessageLoopProxy::current().get(), |
| 102 metadata_.get(), | 102 metadata_.get(), |
| 103 scheduler_.get(), | 103 scheduler_.get(), |
| 104 about_resource_loader_.get(), | 104 about_resource_loader_.get(), |
| 105 loader_controller_.get())); | 105 loader_controller_.get())); |
| 106 } | 106 } |
| 107 | 107 |
| 108 // Adds a new file to the root directory of the service. | 108 // Adds a new file to the root directory of the service. |
| 109 scoped_ptr<google_apis::FileResource> AddNewFile(const std::string& title) { | 109 scoped_ptr<google_apis::FileResource> AddNewFile(const std::string& title) { |
| 110 google_apis::GDataErrorCode error = google_apis::GDATA_FILE_ERROR; | 110 google_apis::DriveApiErrorCode error = google_apis::DRIVE_FILE_ERROR; |
| 111 scoped_ptr<google_apis::FileResource> entry; | 111 scoped_ptr<google_apis::FileResource> entry; |
| 112 drive_service_->AddNewFile( | 112 drive_service_->AddNewFile( |
| 113 "text/plain", | 113 "text/plain", |
| 114 "content text", | 114 "content text", |
| 115 drive_service_->GetRootResourceId(), | 115 drive_service_->GetRootResourceId(), |
| 116 title, | 116 title, |
| 117 false, // shared_with_me | 117 false, // shared_with_me |
| 118 google_apis::test_util::CreateCopyResultCallback(&error, &entry)); | 118 google_apis::test_util::CreateCopyResultCallback(&error, &entry)); |
| 119 base::RunLoop().RunUntilIdle(); | 119 base::RunLoop().RunUntilIdle(); |
| 120 EXPECT_EQ(google_apis::HTTP_CREATED, error); | 120 EXPECT_EQ(google_apis::HTTP_CREATED, error); |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 | 240 |
| 241 // Unlock the loader, this should resume the pending udpate. | 241 // Unlock the loader, this should resume the pending udpate. |
| 242 lock.reset(); | 242 lock.reset(); |
| 243 base::RunLoop().RunUntilIdle(); | 243 base::RunLoop().RunUntilIdle(); |
| 244 EXPECT_EQ(1U, observer.changed_directories().count( | 244 EXPECT_EQ(1U, observer.changed_directories().count( |
| 245 util::GetDriveMyDriveRootPath())); | 245 util::GetDriveMyDriveRootPath())); |
| 246 } | 246 } |
| 247 | 247 |
| 248 } // namespace internal | 248 } // namespace internal |
| 249 } // namespace drive | 249 } // namespace drive |
| OLD | NEW |