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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 kOpenRequestId, | 153 kOpenRequestId, |
154 base::Bind(&CallbackLogger::OnCloseFile, callback_logger.GetWeakPtr())); | 154 base::Bind(&CallbackLogger::OnCloseFile, callback_logger.GetWeakPtr())); |
155 close_file.SetDispatchEventImplForTesting( | 155 close_file.SetDispatchEventImplForTesting( |
156 base::Bind(&LoggingDispatchEventImpl::OnDispatchEventImpl, | 156 base::Bind(&LoggingDispatchEventImpl::OnDispatchEventImpl, |
157 base::Unretained(&dispatcher))); | 157 base::Unretained(&dispatcher))); |
158 | 158 |
159 EXPECT_TRUE(close_file.Execute(kRequestId)); | 159 EXPECT_TRUE(close_file.Execute(kRequestId)); |
160 | 160 |
161 close_file.OnSuccess(kRequestId, | 161 close_file.OnSuccess(kRequestId, |
162 scoped_ptr<RequestValue>(new RequestValue()), | 162 scoped_ptr<RequestValue>(new RequestValue()), |
163 false /* has_next */); | 163 false /* has_more */); |
164 ASSERT_EQ(1u, callback_logger.events().size()); | 164 ASSERT_EQ(1u, callback_logger.events().size()); |
165 EXPECT_EQ(base::File::FILE_OK, callback_logger.events()[0]); | 165 EXPECT_EQ(base::File::FILE_OK, callback_logger.events()[0]); |
166 } | 166 } |
167 | 167 |
168 TEST_F(FileSystemProviderOperationsCloseFileTest, OnError) { | 168 TEST_F(FileSystemProviderOperationsCloseFileTest, OnError) { |
169 using extensions::api::file_system_provider_internal:: | 169 using extensions::api::file_system_provider_internal:: |
170 CloseFileRequestedError::Params; | 170 CloseFileRequestedError::Params; |
171 | 171 |
172 LoggingDispatchEventImpl dispatcher(true /* dispatch_reply */); | 172 LoggingDispatchEventImpl dispatcher(true /* dispatch_reply */); |
173 CallbackLogger callback_logger; | 173 CallbackLogger callback_logger; |
(...skipping 11 matching lines...) Expand all Loading... |
185 | 185 |
186 close_file.OnError(kRequestId, base::File::FILE_ERROR_TOO_MANY_OPENED); | 186 close_file.OnError(kRequestId, base::File::FILE_ERROR_TOO_MANY_OPENED); |
187 ASSERT_EQ(1u, callback_logger.events().size()); | 187 ASSERT_EQ(1u, callback_logger.events().size()); |
188 EXPECT_EQ(base::File::FILE_ERROR_TOO_MANY_OPENED, | 188 EXPECT_EQ(base::File::FILE_ERROR_TOO_MANY_OPENED, |
189 callback_logger.events()[0]); | 189 callback_logger.events()[0]); |
190 } | 190 } |
191 | 191 |
192 } // namespace operations | 192 } // namespace operations |
193 } // namespace file_system_provider | 193 } // namespace file_system_provider |
194 } // namespace chromeos | 194 } // namespace chromeos |
OLD | NEW |