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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 | 202 |
203 EXPECT_EQ(0, bytes_written()); | 203 EXPECT_EQ(0, bytes_written()); |
204 EXPECT_EQ(base::File::FILE_OK, status()); | 204 EXPECT_EQ(base::File::FILE_OK, status()); |
205 EXPECT_TRUE(complete()); | 205 EXPECT_TRUE(complete()); |
206 | 206 |
207 EXPECT_EQ(1, change_observer()->get_and_reset_modify_file_count()); | 207 EXPECT_EQ(1, change_observer()->get_and_reset_modify_file_count()); |
208 } | 208 } |
209 | 209 |
210 | 210 |
211 TEST_F(FileSystemOperationImplWriteTest, TestWriteInvalidBlobUrl) { | 211 TEST_F(FileSystemOperationImplWriteTest, TestWriteInvalidBlobUrl) { |
212 scoped_ptr<storage::BlobDataHandle> null_handle; | 212 scoped_ptr<storage::BlobDataSnapshotHandle> null_handle; |
213 file_system_context_->operation_runner()->Write( | 213 file_system_context_->operation_runner()->Write( |
214 &url_request_context(), URLForPath(virtual_path_), | 214 &url_request_context(), URLForPath(virtual_path_), |
215 null_handle.Pass(), 0, RecordWriteCallback()); | 215 null_handle.Pass(), 0, RecordWriteCallback()); |
216 base::MessageLoop::current()->Run(); | 216 base::MessageLoop::current()->Run(); |
217 | 217 |
218 EXPECT_EQ(0, bytes_written()); | 218 EXPECT_EQ(0, bytes_written()); |
219 EXPECT_EQ(base::File::FILE_ERROR_FAILED, status()); | 219 EXPECT_EQ(base::File::FILE_ERROR_FAILED, status()); |
220 EXPECT_TRUE(complete()); | 220 EXPECT_TRUE(complete()); |
221 | 221 |
222 EXPECT_EQ(0, change_observer()->get_and_reset_modify_file_count()); | 222 EXPECT_EQ(0, change_observer()->get_and_reset_modify_file_count()); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 EXPECT_EQ(base::File::FILE_ERROR_ABORT, status()); | 323 EXPECT_EQ(base::File::FILE_ERROR_ABORT, status()); |
324 EXPECT_EQ(base::File::FILE_OK, cancel_status()); | 324 EXPECT_EQ(base::File::FILE_OK, cancel_status()); |
325 EXPECT_TRUE(complete()); | 325 EXPECT_TRUE(complete()); |
326 | 326 |
327 EXPECT_EQ(0, change_observer()->get_and_reset_modify_file_count()); | 327 EXPECT_EQ(0, change_observer()->get_and_reset_modify_file_count()); |
328 } | 328 } |
329 | 329 |
330 // TODO(ericu,dmikurube,kinuko): Add more tests for cancel cases. | 330 // TODO(ericu,dmikurube,kinuko): Add more tests for cancel cases. |
331 | 331 |
332 } // namespace content | 332 } // namespace content |
OLD | NEW |