OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "net/base/upload_file_element_reader.h" | 5 #include "net/base/upload_file_element_reader.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 | 10 |
11 #include "base/files/file_util.h" | 11 #include "base/files/file_util.h" |
12 #include "base/files/scoped_temp_dir.h" | 12 #include "base/files/scoped_temp_dir.h" |
13 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
14 #include "base/thread_task_runner_handle.h" | 14 #include "base/threading/thread_task_runner_handle.h" |
15 #include "net/base/io_buffer.h" | 15 #include "net/base/io_buffer.h" |
16 #include "net/base/net_errors.h" | 16 #include "net/base/net_errors.h" |
17 #include "net/base/test_completion_callback.h" | 17 #include "net/base/test_completion_callback.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
19 #include "testing/platform_test.h" | 19 #include "testing/platform_test.h" |
20 | 20 |
21 namespace net { | 21 namespace net { |
22 | 22 |
23 class UploadFileElementReaderTest : public PlatformTest { | 23 class UploadFileElementReaderTest : public PlatformTest { |
24 protected: | 24 protected: |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 const base::FilePath wrong_path(FILE_PATH_LITERAL("wrong_path")); | 234 const base::FilePath wrong_path(FILE_PATH_LITERAL("wrong_path")); |
235 reader_.reset(new UploadFileElementReader( | 235 reader_.reset(new UploadFileElementReader( |
236 base::ThreadTaskRunnerHandle::Get().get(), wrong_path, 0, | 236 base::ThreadTaskRunnerHandle::Get().get(), wrong_path, 0, |
237 std::numeric_limits<uint64_t>::max(), base::Time())); | 237 std::numeric_limits<uint64_t>::max(), base::Time())); |
238 TestCompletionCallback init_callback; | 238 TestCompletionCallback init_callback; |
239 ASSERT_EQ(ERR_IO_PENDING, reader_->Init(init_callback.callback())); | 239 ASSERT_EQ(ERR_IO_PENDING, reader_->Init(init_callback.callback())); |
240 EXPECT_EQ(ERR_FILE_NOT_FOUND, init_callback.WaitForResult()); | 240 EXPECT_EQ(ERR_FILE_NOT_FOUND, init_callback.WaitForResult()); |
241 } | 241 } |
242 | 242 |
243 } // namespace net | 243 } // namespace net |
OLD | NEW |