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 "content/browser/fileapi/upload_file_system_file_element_reader.h" | 5 #include "content/browser/fileapi/upload_file_system_file_element_reader.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <limits> | 10 #include <limits> |
11 | 11 |
12 #include "base/files/scoped_temp_dir.h" | 12 #include "base/files/scoped_temp_dir.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
15 #include "base/run_loop.h" | 15 #include "base/run_loop.h" |
16 #include "content/public/test/async_file_test_helper.h" | |
17 #include "content/public/test/test_file_system_context.h" | |
18 #include "net/base/io_buffer.h" | 16 #include "net/base/io_buffer.h" |
19 #include "net/base/test_completion_callback.h" | 17 #include "net/base/test_completion_callback.h" |
20 #include "storage/browser/fileapi/file_system_backend.h" | 18 #include "storage/browser/fileapi/file_system_backend.h" |
21 #include "storage/browser/fileapi/file_system_context.h" | 19 #include "storage/browser/fileapi/file_system_context.h" |
22 #include "storage/browser/fileapi/file_system_operation_context.h" | 20 #include "storage/browser/fileapi/file_system_operation_context.h" |
23 #include "storage/browser/fileapi/file_system_url.h" | 21 #include "storage/browser/fileapi/file_system_url.h" |
| 22 #include "storage/browser/test/async_file_test_helper.h" |
| 23 #include "storage/browser/test/test_file_system_context.h" |
24 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
25 | 25 |
26 using content::AsyncFileTestHelper; | 26 using content::AsyncFileTestHelper; |
27 using storage::FileSystemContext; | 27 using storage::FileSystemContext; |
28 using storage::FileSystemType; | 28 using storage::FileSystemType; |
29 using storage::FileSystemURL; | 29 using storage::FileSystemURL; |
30 | 30 |
31 namespace content { | 31 namespace content { |
32 | 32 |
33 namespace { | 33 namespace { |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 const GURL wrong_url = GetFileSystemURL("wrong_file_name.dat"); | 275 const GURL wrong_url = GetFileSystemURL("wrong_file_name.dat"); |
276 reader_.reset(new UploadFileSystemFileElementReader( | 276 reader_.reset(new UploadFileSystemFileElementReader( |
277 file_system_context_.get(), wrong_url, 0, | 277 file_system_context_.get(), wrong_url, 0, |
278 std::numeric_limits<uint64_t>::max(), base::Time())); | 278 std::numeric_limits<uint64_t>::max(), base::Time())); |
279 net::TestCompletionCallback init_callback; | 279 net::TestCompletionCallback init_callback; |
280 ASSERT_EQ(net::ERR_IO_PENDING, reader_->Init(init_callback.callback())); | 280 ASSERT_EQ(net::ERR_IO_PENDING, reader_->Init(init_callback.callback())); |
281 EXPECT_EQ(net::ERR_FILE_NOT_FOUND, init_callback.WaitForResult()); | 281 EXPECT_EQ(net::ERR_FILE_NOT_FOUND, init_callback.WaitForResult()); |
282 } | 282 } |
283 | 283 |
284 } // namespace content | 284 } // namespace content |
OLD | NEW |