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

Side by Side Diff: chrome/browser/net/net_log_temp_file_unittest.cc

Issue 177923007: Move AppendFile and *CurrentDirectory to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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) 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 "chrome/browser/net/net_log_temp_file.h" 5 #include "chrome/browser/net/net_log_temp_file.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 225
226 net_log_temp_file_->ProcessCommand(NetLogTempFile::DO_STOP); 226 net_log_temp_file_->ProcessCommand(NetLogTempFile::DO_STOP);
227 VerifyFileAndStateAfterDoStop(); 227 VerifyFileAndStateAfterDoStop();
228 228
229 int64 stop_file_size; 229 int64 stop_file_size;
230 EXPECT_TRUE(base::GetFileSize(net_export_log_, &stop_file_size)); 230 EXPECT_TRUE(base::GetFileSize(net_export_log_, &stop_file_size));
231 EXPECT_GE(stop_file_size, start_file_size); 231 EXPECT_GE(stop_file_size, start_file_size);
232 232
233 // Add some junk at the end of the file. 233 // Add some junk at the end of the file.
234 std::string junk_data("Hello"); 234 std::string junk_data("Hello");
235 EXPECT_GT(file_util::AppendToFile( 235 EXPECT_GT(base::AppendToFile(
236 net_export_log_, junk_data.c_str(), junk_data.size()), 0); 236 net_export_log_, junk_data.c_str(), junk_data.size()), 0);
237 237
238 int64 junk_file_size; 238 int64 junk_file_size;
239 EXPECT_TRUE(base::GetFileSize(net_export_log_, &junk_file_size)); 239 EXPECT_TRUE(base::GetFileSize(net_export_log_, &junk_file_size));
240 EXPECT_GT(junk_file_size, stop_file_size); 240 EXPECT_GT(junk_file_size, stop_file_size);
241 241
242 // Execute DO_START/DO_STOP commands and make sure the file is back to the 242 // Execute DO_START/DO_STOP commands and make sure the file is back to the
243 // size before addition of junk data. 243 // size before addition of junk data.
244 net_log_temp_file_->ProcessCommand(NetLogTempFile::DO_START); 244 net_log_temp_file_->ProcessCommand(NetLogTempFile::DO_START);
245 VerifyFileAndStateAfterDoStart(); 245 VerifyFileAndStateAfterDoStart();
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 // Log an event. 277 // Log an event.
278 net_log_->AddGlobalEntry(net::NetLog::TYPE_CANCELLED); 278 net_log_->AddGlobalEntry(net::NetLog::TYPE_CANCELLED);
279 279
280 net_log_temp_file_->ProcessCommand(NetLogTempFile::DO_STOP); 280 net_log_temp_file_->ProcessCommand(NetLogTempFile::DO_STOP);
281 VerifyFileAndStateAfterDoStop(); 281 VerifyFileAndStateAfterDoStop();
282 282
283 int64 new_stop_file_size; 283 int64 new_stop_file_size;
284 EXPECT_TRUE(base::GetFileSize(net_export_log_, &new_stop_file_size)); 284 EXPECT_TRUE(base::GetFileSize(net_export_log_, &new_stop_file_size));
285 EXPECT_GE(new_stop_file_size, stop_file_size); 285 EXPECT_GE(new_stop_file_size, stop_file_size);
286 } 286 }
OLDNEW
« no previous file with comments | « chrome/browser/media_galleries/win/mtp_device_operations_util.cc ('k') | chrome/common/net/url_fixer_upper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698