Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: chrome/browser/chromeos/drive/job_scheduler_unittest.cc

Issue 140513008: drive: Allow setting modified/accessed date with AddNewDirectory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/job_scheduler.h" 5 #include "chrome/browser/chromeos/drive/job_scheduler.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 google_apis::GDataErrorCode error = google_apis::GDATA_OTHER_ERROR; 268 google_apis::GDataErrorCode error = google_apis::GDATA_OTHER_ERROR;
269 269
270 // Create a new directory. 270 // Create a new directory.
271 // The loaded (initial) changestamp is 654321. Thus, by this operation, 271 // The loaded (initial) changestamp is 654321. Thus, by this operation,
272 // it should become 654322. 272 // it should become 654322.
273 { 273 {
274 scoped_ptr<google_apis::ResourceEntry> resource_entry; 274 scoped_ptr<google_apis::ResourceEntry> resource_entry;
275 fake_drive_service_->AddNewDirectory( 275 fake_drive_service_->AddNewDirectory(
276 fake_drive_service_->GetRootResourceId(), 276 fake_drive_service_->GetRootResourceId(),
277 "new directory", 277 "new directory",
278 DriveServiceInterface::AddNewDirectoryOptions(),
278 google_apis::test_util::CreateCopyResultCallback( 279 google_apis::test_util::CreateCopyResultCallback(
279 &error, &resource_entry)); 280 &error, &resource_entry));
280 base::RunLoop().RunUntilIdle(); 281 base::RunLoop().RunUntilIdle();
281 ASSERT_EQ(google_apis::HTTP_CREATED, error); 282 ASSERT_EQ(google_apis::HTTP_CREATED, error);
282 } 283 }
283 284
284 error = google_apis::GDATA_OTHER_ERROR; 285 error = google_apis::GDATA_OTHER_ERROR;
285 scoped_ptr<google_apis::ResourceList> resource_list; 286 scoped_ptr<google_apis::ResourceList> resource_list;
286 scheduler_->GetChangeList( 287 scheduler_->GetChangeList(
287 654321 + 1, // start_changestamp 288 654321 + 1, // start_changestamp
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after
1080 scheduler_->CancelJob(first_job_id); 1081 scheduler_->CancelJob(first_job_id);
1081 1082
1082 // Only the first job should be cancelled. 1083 // Only the first job should be cancelled.
1083 base::RunLoop().RunUntilIdle(); 1084 base::RunLoop().RunUntilIdle();
1084 EXPECT_EQ(google_apis::GDATA_CANCELLED, error1); 1085 EXPECT_EQ(google_apis::GDATA_CANCELLED, error1);
1085 EXPECT_EQ(google_apis::HTTP_SUCCESS, error2); 1086 EXPECT_EQ(google_apis::HTTP_SUCCESS, error2);
1086 EXPECT_TRUE(scheduler_->GetJobInfoList().empty()); 1087 EXPECT_TRUE(scheduler_->GetJobInfoList().empty());
1087 } 1088 }
1088 1089
1089 } // namespace drive 1090 } // namespace drive
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/drive/job_scheduler.cc ('k') | chrome/browser/chromeos/file_manager/file_manager_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698