Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Unified Diff: net/base/upload_file_element_reader_unittest.cc

Issue 868253012: [net] Subtract timestamps to determine if uploading file changed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/upload_file_element_reader.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..bf896a1420a443847dc4ce258e6520afe6da9f90 100644
--- a/net/base/upload_file_element_reader_unittest.cc
+++ b/net/base/upload_file_element_reader_unittest.cc
@@ -221,6 +221,20 @@ TEST_F(UploadFileElementReaderTest, FileChanged) {
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));
mmenke 2015/02/02 15:34:21 nit: While you're here, should format the identic
+ 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(
« no previous file with comments | « net/base/upload_file_element_reader.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698