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

Side by Side Diff: net/base/upload_data_stream_unittest.cc

Issue 3347005: Moving file_util::FileInfo to base::PlatformFileInfo, and adding the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_data_stream.h" 5 #include "net/base/upload_data_stream.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 else 102 else
103 ASSERT_TRUE(stream.get() && error_code == net::OK); 103 ASSERT_TRUE(stream.get() && error_code == net::OK);
104 } 104 }
105 105
106 TEST_F(UploadDataStreamTest, FileChanged) { 106 TEST_F(UploadDataStreamTest, FileChanged) {
107 FilePath temp_file_path; 107 FilePath temp_file_path;
108 ASSERT_TRUE(file_util::CreateTemporaryFile(&temp_file_path)); 108 ASSERT_TRUE(file_util::CreateTemporaryFile(&temp_file_path));
109 ASSERT_EQ(kTestDataSize, file_util::WriteFile(temp_file_path, 109 ASSERT_EQ(kTestDataSize, file_util::WriteFile(temp_file_path,
110 kTestData, kTestDataSize)); 110 kTestData, kTestDataSize));
111 111
112 file_util::FileInfo file_info; 112 base::PlatformFileInfo file_info;
113 ASSERT_TRUE(file_util::GetFileInfo(temp_file_path, &file_info)); 113 ASSERT_TRUE(file_util::GetFileInfo(temp_file_path, &file_info));
114 114
115 // Test file not changed. 115 // Test file not changed.
116 FileChangedHelper(temp_file_path, file_info.last_modified, false); 116 FileChangedHelper(temp_file_path, file_info.last_modified, false);
117 117
118 // Test file changed. 118 // Test file changed.
119 FileChangedHelper(temp_file_path, 119 FileChangedHelper(temp_file_path,
120 file_info.last_modified - base::TimeDelta::FromSeconds(1), 120 file_info.last_modified - base::TimeDelta::FromSeconds(1),
121 true); 121 true);
122 122
123 file_util::Delete(temp_file_path, false); 123 file_util::Delete(temp_file_path, false);
124 } 124 }
125 125
126 } // namespace net 126 } // namespace net
127
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698