| 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 <string> | 5 #include <string> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/files/file.h" | 8 #include "base/files/file.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 155 |
| 156 unmount.OnSuccess(kRequestId, | 156 unmount.OnSuccess(kRequestId, |
| 157 scoped_ptr<RequestValue>(new RequestValue()), | 157 scoped_ptr<RequestValue>(new RequestValue()), |
| 158 false /* has_more */); | 158 false /* has_more */); |
| 159 ASSERT_EQ(1u, callback_logger.events().size()); | 159 ASSERT_EQ(1u, callback_logger.events().size()); |
| 160 base::File::Error event_result = callback_logger.events()[0]; | 160 base::File::Error event_result = callback_logger.events()[0]; |
| 161 EXPECT_EQ(base::File::FILE_OK, event_result); | 161 EXPECT_EQ(base::File::FILE_OK, event_result); |
| 162 } | 162 } |
| 163 | 163 |
| 164 TEST_F(FileSystemProviderOperationsUnmountTest, OnError) { | 164 TEST_F(FileSystemProviderOperationsUnmountTest, OnError) { |
| 165 using extensions::api::file_system_provider_internal::UnmountRequestedError:: |
| 166 Params; |
| 167 |
| 165 LoggingDispatchEventImpl dispatcher(true /* dispatch_reply */); | 168 LoggingDispatchEventImpl dispatcher(true /* dispatch_reply */); |
| 166 CallbackLogger callback_logger; | 169 CallbackLogger callback_logger; |
| 167 | 170 |
| 168 Unmount unmount( | 171 Unmount unmount( |
| 169 NULL, | 172 NULL, |
| 170 file_system_info_, | 173 file_system_info_, |
| 171 base::Bind(&CallbackLogger::OnUnmount, callback_logger.GetWeakPtr())); | 174 base::Bind(&CallbackLogger::OnUnmount, callback_logger.GetWeakPtr())); |
| 172 unmount.SetDispatchEventImplForTesting( | 175 unmount.SetDispatchEventImplForTesting( |
| 173 base::Bind(&LoggingDispatchEventImpl::OnDispatchEventImpl, | 176 base::Bind(&LoggingDispatchEventImpl::OnDispatchEventImpl, |
| 174 base::Unretained(&dispatcher))); | 177 base::Unretained(&dispatcher))); |
| 175 | 178 |
| 176 EXPECT_TRUE(unmount.Execute(kRequestId)); | 179 EXPECT_TRUE(unmount.Execute(kRequestId)); |
| 177 | 180 |
| 178 unmount.OnError(kRequestId, | 181 unmount.OnError(kRequestId, base::File::FILE_ERROR_NOT_FOUND); |
| 179 scoped_ptr<RequestValue>(new RequestValue()), | |
| 180 base::File::FILE_ERROR_NOT_FOUND); | |
| 181 ASSERT_EQ(1u, callback_logger.events().size()); | 182 ASSERT_EQ(1u, callback_logger.events().size()); |
| 182 base::File::Error event_result = callback_logger.events()[0]; | 183 base::File::Error event_result = callback_logger.events()[0]; |
| 183 EXPECT_EQ(base::File::FILE_ERROR_NOT_FOUND, event_result); | 184 EXPECT_EQ(base::File::FILE_ERROR_NOT_FOUND, event_result); |
| 184 } | 185 } |
| 185 | 186 |
| 186 } // namespace operations | 187 } // namespace operations |
| 187 } // namespace file_system_provider | 188 } // namespace file_system_provider |
| 188 } // namespace chromeos | 189 } // namespace chromeos |
| OLD | NEW |