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

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

Issue 101143006: Convert base::file_util to use File instead of PlatformFile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove base:: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/common/plugin_list_posix.cc ('k') | net/base/upload_file_element_reader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_data_stream.h" 5 #include "net/base/upload_data_stream.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 ASSERT_EQ(OK, error_code); 547 ASSERT_EQ(OK, error_code);
548 } 548 }
549 549
550 TEST_F(UploadDataStreamTest, FileChanged) { 550 TEST_F(UploadDataStreamTest, FileChanged) {
551 base::FilePath temp_file_path; 551 base::FilePath temp_file_path;
552 ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(), 552 ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(),
553 &temp_file_path)); 553 &temp_file_path));
554 ASSERT_EQ(static_cast<int>(kTestDataSize), 554 ASSERT_EQ(static_cast<int>(kTestDataSize),
555 file_util::WriteFile(temp_file_path, kTestData, kTestDataSize)); 555 file_util::WriteFile(temp_file_path, kTestData, kTestDataSize));
556 556
557 base::PlatformFileInfo file_info; 557 base::File::Info file_info;
558 ASSERT_TRUE(base::GetFileInfo(temp_file_path, &file_info)); 558 ASSERT_TRUE(base::GetFileInfo(temp_file_path, &file_info));
559 559
560 // Test file not changed. 560 // Test file not changed.
561 FileChangedHelper(temp_file_path, file_info.last_modified, false); 561 FileChangedHelper(temp_file_path, file_info.last_modified, false);
562 562
563 // Test file changed. 563 // Test file changed.
564 FileChangedHelper(temp_file_path, 564 FileChangedHelper(temp_file_path,
565 file_info.last_modified - base::TimeDelta::FromSeconds(1), 565 file_info.last_modified - base::TimeDelta::FromSeconds(1),
566 true); 566 true);
567 } 567 }
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 wrapped_buffer2.get(), buf2.size(), read_callback2.callback())); 811 wrapped_buffer2.get(), buf2.size(), read_callback2.callback()));
812 EXPECT_EQ(static_cast<int>(buf2.size()), read_callback2.WaitForResult()); 812 EXPECT_EQ(static_cast<int>(buf2.size()), read_callback2.WaitForResult());
813 EXPECT_EQ(expected_data, buf2); 813 EXPECT_EQ(expected_data, buf2);
814 EXPECT_TRUE(stream.IsEOF()); 814 EXPECT_TRUE(stream.IsEOF());
815 815
816 // Make sure callbacks are not called for cancelled operations. 816 // Make sure callbacks are not called for cancelled operations.
817 EXPECT_FALSE(read_callback1.have_result()); 817 EXPECT_FALSE(read_callback1.have_result());
818 } 818 }
819 819
820 } // namespace net 820 } // namespace net
OLDNEW
« no previous file with comments | « content/common/plugin_list_posix.cc ('k') | net/base/upload_file_element_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698