| Index: net/base/upload_file_element_reader_unittest.cc
|
| diff --git a/net/base/upload_file_element_reader_unittest.cc b/net/base/upload_file_element_reader_unittest.cc
|
| index b0374acd966ba694ea832f5bba57bc116fff5195..719ce1e71c54cd103cc65d242ab961c0c08caa28 100644
|
| --- a/net/base/upload_file_element_reader_unittest.cc
|
| +++ b/net/base/upload_file_element_reader_unittest.cc
|
| @@ -210,25 +210,33 @@ TEST_F(UploadFileElementReaderTest, FileChanged) {
|
| // Expect one second before the actual modification time to simulate change.
|
| const base::Time expected_modification_time =
|
| info.last_modified - base::TimeDelta::FromSeconds(1);
|
| - reader_.reset(
|
| - new UploadFileElementReader(base::MessageLoopProxy::current().get(),
|
| - temp_file_path_,
|
| - 0,
|
| - kuint64max,
|
| - expected_modification_time));
|
| + reader_.reset(new UploadFileElementReader(
|
| + base::MessageLoopProxy::current().get(), temp_file_path_, 0, kuint64max,
|
| + expected_modification_time));
|
| TestCompletionCallback init_callback;
|
| ASSERT_EQ(ERR_IO_PENDING, reader_->Init(init_callback.callback()));
|
| EXPECT_EQ(ERR_UPLOAD_FILE_CHANGED, init_callback.WaitForResult());
|
| }
|
|
|
| +TEST_F(UploadFileElementReaderTest, InexactExpectedTimeStamp) {
|
| + base::File::Info info;
|
| + ASSERT_TRUE(base::GetFileInfo(temp_file_path_, &info));
|
| +
|
| + const base::Time expected_modification_time =
|
| + info.last_modified - base::TimeDelta::FromMilliseconds(900);
|
| + reader_.reset(new UploadFileElementReader(
|
| + base::MessageLoopProxy::current().get(), temp_file_path_, 0, kuint64max,
|
| + expected_modification_time));
|
| + TestCompletionCallback init_callback;
|
| + ASSERT_EQ(ERR_IO_PENDING, reader_->Init(init_callback.callback()));
|
| + EXPECT_EQ(OK, init_callback.WaitForResult());
|
| +}
|
| +
|
| TEST_F(UploadFileElementReaderTest, WrongPath) {
|
| const base::FilePath wrong_path(FILE_PATH_LITERAL("wrong_path"));
|
| reader_.reset(
|
| new UploadFileElementReader(base::MessageLoopProxy::current().get(),
|
| - wrong_path,
|
| - 0,
|
| - kuint64max,
|
| - base::Time()));
|
| + wrong_path, 0, kuint64max, base::Time()));
|
| TestCompletionCallback init_callback;
|
| ASSERT_EQ(ERR_IO_PENDING, reader_->Init(init_callback.callback()));
|
| EXPECT_EQ(ERR_FILE_NOT_FOUND, init_callback.WaitForResult());
|
|
|