OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "webkit/browser/fileapi/upload_file_system_file_element_reader.h" | 5 #include "webkit/browser/fileapi/upload_file_system_file_element_reader.h" |
6 | 6 |
7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/message_loop/message_loop.h" |
8 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "content/public/test/test_file_system_context.h" |
9 #include "net/base/io_buffer.h" | 11 #include "net/base/io_buffer.h" |
10 #include "net/base/test_completion_callback.h" | 12 #include "net/base/test_completion_callback.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
12 #include "webkit/browser/fileapi/async_file_test_helper.h" | 14 #include "webkit/browser/fileapi/async_file_test_helper.h" |
13 #include "webkit/browser/fileapi/file_system_backend.h" | 15 #include "webkit/browser/fileapi/file_system_backend.h" |
14 #include "webkit/browser/fileapi/file_system_context.h" | 16 #include "webkit/browser/fileapi/file_system_context.h" |
15 #include "webkit/browser/fileapi/file_system_operation_context.h" | 17 #include "webkit/browser/fileapi/file_system_operation_context.h" |
16 #include "webkit/browser/fileapi/file_system_url.h" | 18 #include "webkit/browser/fileapi/file_system_url.h" |
17 #include "webkit/browser/fileapi/mock_file_system_context.h" | |
18 | 19 |
19 namespace fileapi { | 20 namespace fileapi { |
20 | 21 |
21 namespace { | 22 namespace { |
22 | 23 |
23 const char kFileSystemURLOrigin[] = "http://remote"; | 24 const char kFileSystemURLOrigin[] = "http://remote"; |
24 const fileapi::FileSystemType kFileSystemType = | 25 const fileapi::FileSystemType kFileSystemType = |
25 fileapi::kFileSystemTypeTemporary; | 26 fileapi::kFileSystemTypeTemporary; |
26 | 27 |
27 } // namespace | 28 } // namespace |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 TEST_F(UploadFileSystemFileElementReaderTest, WrongURL) { | 269 TEST_F(UploadFileSystemFileElementReaderTest, WrongURL) { |
269 const GURL wrong_url = GetFileSystemURL("wrong_file_name.dat"); | 270 const GURL wrong_url = GetFileSystemURL("wrong_file_name.dat"); |
270 reader_.reset(new UploadFileSystemFileElementReader( | 271 reader_.reset(new UploadFileSystemFileElementReader( |
271 file_system_context_.get(), wrong_url, 0, kuint64max, base::Time())); | 272 file_system_context_.get(), wrong_url, 0, kuint64max, base::Time())); |
272 net::TestCompletionCallback init_callback; | 273 net::TestCompletionCallback init_callback; |
273 ASSERT_EQ(net::ERR_IO_PENDING, reader_->Init(init_callback.callback())); | 274 ASSERT_EQ(net::ERR_IO_PENDING, reader_->Init(init_callback.callback())); |
274 EXPECT_EQ(net::ERR_FILE_NOT_FOUND, init_callback.WaitForResult()); | 275 EXPECT_EQ(net::ERR_FILE_NOT_FOUND, init_callback.WaitForResult()); |
275 } | 276 } |
276 | 277 |
277 } // namespace fileapi | 278 } // namespace fileapi |
OLD | NEW |