| 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/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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 EXPECT_TRUE(expected_results.count(results->at(i).path.AsUTF8Unsafe())) | 46 EXPECT_TRUE(expected_results.count(results->at(i).path.AsUTF8Unsafe())) |
| 47 << results->at(i).path.AsUTF8Unsafe(); | 47 << results->at(i).path.AsUTF8Unsafe(); |
| 48 } | 48 } |
| 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::GDataErrorCode status = google_apis::GDATA_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(), |
| 60 "New Directory 1!", | 60 "New Directory 1!", |
| 61 DriveServiceInterface::AddNewDirectoryOptions(), | 61 DriveServiceInterface::AddNewDirectoryOptions(), |
| 62 google_apis::test_util::CreateCopyResultCallback(&status, &server_entry)); | 62 google_apis::test_util::CreateCopyResultCallback(&status, &server_entry)); |
| 63 content::RunAllBlockingPoolTasksUntilIdle(); | 63 content::RunAllBlockingPoolTasksUntilIdle(); |
| 64 ASSERT_EQ(google_apis::HTTP_CREATED, status); | 64 ASSERT_EQ(google_apis::HTTP_CREATED, status); |
| 65 | 65 |
| 66 // 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 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 // Unlock, this should resume the pending search. | 149 // Unlock, this should resume the pending search. |
| 150 lock.reset(); | 150 lock.reset(); |
| 151 content::RunAllBlockingPoolTasksUntilIdle(); | 151 content::RunAllBlockingPoolTasksUntilIdle(); |
| 152 EXPECT_EQ(FILE_ERROR_OK, error); | 152 EXPECT_EQ(FILE_ERROR_OK, error); |
| 153 ASSERT_TRUE(results); | 153 ASSERT_TRUE(results); |
| 154 EXPECT_EQ(1u, results->size()); | 154 EXPECT_EQ(1u, results->size()); |
| 155 } | 155 } |
| 156 | 156 |
| 157 } // namespace file_system | 157 } // namespace file_system |
| 158 } // namespace drive | 158 } // namespace drive |
| OLD | NEW |