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

Side by Side Diff: chrome/browser/chromeos/drive/file_system/search_operation_unittest.cc

Issue 1042803002: Drive: Move inner structures of DriveAPIService under drive namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests. Created 5 years, 8 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
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 } 49 }
50 50
51 TEST_F(SearchOperationTest, ContentSearchWithNewEntry) { 51 TEST_F(SearchOperationTest, ContentSearchWithNewEntry) {
52 SearchOperation operation(blocking_task_runner(), scheduler(), metadata(), 52 SearchOperation operation(blocking_task_runner(), scheduler(), metadata(),
53 loader_controller()); 53 loader_controller());
54 54
55 // Create a new directory in the drive service. 55 // Create a new directory in the drive service.
56 google_apis::DriveApiErrorCode status = google_apis::DRIVE_OTHER_ERROR; 56 google_apis::DriveApiErrorCode status = google_apis::DRIVE_OTHER_ERROR;
57 scoped_ptr<google_apis::FileResource> server_entry; 57 scoped_ptr<google_apis::FileResource> server_entry;
58 fake_service()->AddNewDirectory( 58 fake_service()->AddNewDirectory(
59 fake_service()->GetRootResourceId(), 59 fake_service()->GetRootResourceId(), "New Directory 1!",
60 "New Directory 1!", 60 AddNewDirectoryOptions(),
61 DriveServiceInterface::AddNewDirectoryOptions(),
62 google_apis::test_util::CreateCopyResultCallback(&status, &server_entry)); 61 google_apis::test_util::CreateCopyResultCallback(&status, &server_entry));
63 content::RunAllBlockingPoolTasksUntilIdle(); 62 content::RunAllBlockingPoolTasksUntilIdle();
64 ASSERT_EQ(google_apis::HTTP_CREATED, status); 63 ASSERT_EQ(google_apis::HTTP_CREATED, status);
65 64
66 // As the result of the first Search(), only entries in the current file 65 // As the result of the first Search(), only entries in the current file
67 // system snapshot are expected to be returned in the "right" path. New 66 // system snapshot are expected to be returned in the "right" path. New
68 // entries like "New Directory 1!" is temporarily added to "drive/other". 67 // entries like "New Directory 1!" is temporarily added to "drive/other".
69 std::set<std::string> expected_results; 68 std::set<std::string> expected_results;
70 expected_results.insert("drive/root/Directory 1"); 69 expected_results.insert("drive/root/Directory 1");
71 expected_results.insert("drive/other/New Directory 1!"); 70 expected_results.insert("drive/other/New Directory 1!");
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 // Unlock, this should resume the pending search. 148 // Unlock, this should resume the pending search.
150 lock.reset(); 149 lock.reset();
151 content::RunAllBlockingPoolTasksUntilIdle(); 150 content::RunAllBlockingPoolTasksUntilIdle();
152 EXPECT_EQ(FILE_ERROR_OK, error); 151 EXPECT_EQ(FILE_ERROR_OK, error);
153 ASSERT_TRUE(results); 152 ASSERT_TRUE(results);
154 EXPECT_EQ(1u, results->size()); 153 EXPECT_EQ(1u, results->size());
155 } 154 }
156 155
157 } // namespace file_system 156 } // namespace file_system
158 } // namespace drive 157 } // namespace drive
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698