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/file_task_executor.h" | 5 #include "chrome/browser/chromeos/drive/file_task_executor.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 return fake_drive_service_.get(); | 40 return fake_drive_service_.get(); |
41 } | 41 } |
42 | 42 |
43 void OpenBrowserWindow(const GURL& open_link) override { | 43 void OpenBrowserWindow(const GURL& open_link) override { |
44 opend_urls_->insert(open_link.spec()); | 44 opend_urls_->insert(open_link.spec()); |
45 } | 45 } |
46 | 46 |
47 // Sets up files on the fake Drive service. | 47 // Sets up files on the fake Drive service. |
48 bool SetUpTestFiles() { | 48 bool SetUpTestFiles() { |
49 { | 49 { |
50 google_apis::GDataErrorCode result = google_apis::GDATA_OTHER_ERROR; | 50 google_apis::DriveApiErrorCode result = google_apis::DRIVE_OTHER_ERROR; |
51 scoped_ptr<google_apis::FileResource> file; | 51 scoped_ptr<google_apis::FileResource> file; |
52 fake_drive_service_->AddNewFileWithResourceId( | 52 fake_drive_service_->AddNewFileWithResourceId( |
53 "id1", | 53 "id1", |
54 "text/plain", | 54 "text/plain", |
55 "random data", | 55 "random data", |
56 fake_drive_service_->GetRootResourceId(), | 56 fake_drive_service_->GetRootResourceId(), |
57 "file1.txt", | 57 "file1.txt", |
58 false, | 58 false, |
59 google_apis::test_util::CreateCopyResultCallback(&result, &file)); | 59 google_apis::test_util::CreateCopyResultCallback(&result, &file)); |
60 base::RunLoop().RunUntilIdle(); | 60 base::RunLoop().RunUntilIdle(); |
61 if (result != google_apis::HTTP_CREATED) | 61 if (result != google_apis::HTTP_CREATED) |
62 return false; | 62 return false; |
63 } | 63 } |
64 { | 64 { |
65 google_apis::GDataErrorCode result = google_apis::GDATA_OTHER_ERROR; | 65 google_apis::DriveApiErrorCode result = google_apis::DRIVE_OTHER_ERROR; |
66 scoped_ptr<google_apis::FileResource> file; | 66 scoped_ptr<google_apis::FileResource> file; |
67 fake_drive_service_->AddNewFileWithResourceId( | 67 fake_drive_service_->AddNewFileWithResourceId( |
68 "id2", | 68 "id2", |
69 "text/plain", | 69 "text/plain", |
70 "random data", | 70 "random data", |
71 fake_drive_service_->GetRootResourceId(), | 71 fake_drive_service_->GetRootResourceId(), |
72 "file2.txt", | 72 "file2.txt", |
73 false, | 73 false, |
74 google_apis::test_util::CreateCopyResultCallback(&result, &file)); | 74 google_apis::test_util::CreateCopyResultCallback(&result, &file)); |
75 base::RunLoop().RunUntilIdle(); | 75 base::RunLoop().RunUntilIdle(); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 extensions::api::file_manager_private::TASK_RESULT_NONE; | 143 extensions::api::file_manager_private::TASK_RESULT_NONE; |
144 executor->Execute(urls, | 144 executor->Execute(urls, |
145 google_apis::test_util::CreateCopyResultCallback(&result)); | 145 google_apis::test_util::CreateCopyResultCallback(&result)); |
146 base::RunLoop().RunUntilIdle(); | 146 base::RunLoop().RunUntilIdle(); |
147 | 147 |
148 EXPECT_EQ(extensions::api::file_manager_private::TASK_RESULT_FAILED, result); | 148 EXPECT_EQ(extensions::api::file_manager_private::TASK_RESULT_FAILED, result); |
149 ASSERT_TRUE(opend_urls.empty()); | 149 ASSERT_TRUE(opend_urls.empty()); |
150 } | 150 } |
151 | 151 |
152 } // namespace drive | 152 } // namespace drive |
OLD | NEW |