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

Side by Side Diff: chrome/browser/chromeos/drive/file_system/search_operation_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
« no previous file with comments | « no previous file | chrome/browser/chromeos/drive/job_scheduler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/chromeos/drive/file_system/search_operation.h" 5 #include "chrome/browser/chromeos/drive/file_system/search_operation.h"
6 6
7 #include "base/callback_helpers.h" 7 #include "base/callback_helpers.h"
8 #include "chrome/browser/chromeos/drive/change_list_loader.h" 8 #include "chrome/browser/chromeos/drive/change_list_loader.h"
9 #include "chrome/browser/chromeos/drive/file_system/operation_test_base.h" 9 #include "chrome/browser/chromeos/drive/file_system/operation_test_base.h"
10 #include "chrome/browser/drive/fake_drive_service.h" 10 #include "chrome/browser/drive/fake_drive_service.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 TEST_F(SearchOperationTest, ContentSearchWithNewEntry) { 50 TEST_F(SearchOperationTest, ContentSearchWithNewEntry) {
51 SearchOperation operation(blocking_task_runner(), scheduler(), metadata(), 51 SearchOperation operation(blocking_task_runner(), scheduler(), metadata(),
52 loader_controller()); 52 loader_controller());
53 53
54 // Create a new directory in the drive service. 54 // Create a new directory in the drive service.
55 google_apis::GDataErrorCode gdata_error = google_apis::GDATA_OTHER_ERROR; 55 google_apis::GDataErrorCode gdata_error = google_apis::GDATA_OTHER_ERROR;
56 scoped_ptr<google_apis::ResourceEntry> resource_entry; 56 scoped_ptr<google_apis::ResourceEntry> resource_entry;
57 fake_service()->AddNewDirectory( 57 fake_service()->AddNewDirectory(
58 fake_service()->GetRootResourceId(), 58 fake_service()->GetRootResourceId(),
59 "New Directory 1!", 59 "New Directory 1!",
60 DriveServiceInterface::AddNewDirectoryOptions(),
60 google_apis::test_util::CreateCopyResultCallback( 61 google_apis::test_util::CreateCopyResultCallback(
61 &gdata_error, &resource_entry)); 62 &gdata_error, &resource_entry));
62 test_util::RunBlockingPoolTask(); 63 test_util::RunBlockingPoolTask();
63 ASSERT_EQ(google_apis::HTTP_CREATED, gdata_error); 64 ASSERT_EQ(google_apis::HTTP_CREATED, gdata_error);
64 65
65 // As the result of the first Search(), only entries in the current file 66 // As the result of the first Search(), only entries in the current file
66 // system snapshot are expected to be returned in the "right" path. New 67 // system snapshot are expected to be returned in the "right" path. New
67 // entries like "New Directory 1!" is temporarily added to "drive/other". 68 // entries like "New Directory 1!" is temporarily added to "drive/other".
68 std::set<std::string> expected_results; 69 std::set<std::string> expected_results;
69 expected_results.insert("drive/root/Directory 1"); 70 expected_results.insert("drive/root/Directory 1");
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 // Unlock, this should resume the pending search. 149 // Unlock, this should resume the pending search.
149 lock.reset(); 150 lock.reset();
150 test_util::RunBlockingPoolTask(); 151 test_util::RunBlockingPoolTask();
151 EXPECT_EQ(FILE_ERROR_OK, error); 152 EXPECT_EQ(FILE_ERROR_OK, error);
152 ASSERT_TRUE(results); 153 ASSERT_TRUE(results);
153 EXPECT_EQ(1u, results->size()); 154 EXPECT_EQ(1u, results->size());
154 } 155 }
155 156
156 } // namespace file_system 157 } // namespace file_system
157 } // namespace drive 158 } // namespace drive
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/drive/job_scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698