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

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

Issue 669813003: Update from chromium https://crrev.com/301725/ (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « net/base/elements_upload_data_stream_unittest.cc ('k') | net/base/ip_endpoint_unittest.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/file_stream.h" 5 #include "net/base/file_stream.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/files/file.h" 9 #include "base/files/file.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 28 matching lines...) Expand all
39 IOBufferWithSize* CreateTestDataBuffer() { 39 IOBufferWithSize* CreateTestDataBuffer() {
40 IOBufferWithSize* buf = new IOBufferWithSize(kTestDataSize); 40 IOBufferWithSize* buf = new IOBufferWithSize(kTestDataSize);
41 memcpy(buf->data(), kTestData, kTestDataSize); 41 memcpy(buf->data(), kTestData, kTestDataSize);
42 return buf; 42 return buf;
43 } 43 }
44 44
45 } // namespace 45 } // namespace
46 46
47 class FileStreamTest : public PlatformTest { 47 class FileStreamTest : public PlatformTest {
48 public: 48 public:
49 virtual void SetUp() { 49 void SetUp() override {
50 PlatformTest::SetUp(); 50 PlatformTest::SetUp();
51 51
52 base::CreateTemporaryFile(&temp_file_path_); 52 base::CreateTemporaryFile(&temp_file_path_);
53 base::WriteFile(temp_file_path_, kTestData, kTestDataSize); 53 base::WriteFile(temp_file_path_, kTestData, kTestDataSize);
54 } 54 }
55 virtual void TearDown() { 55 void TearDown() override {
56 // FileStreamContexts must be asynchronously closed on the file task runner 56 // FileStreamContexts must be asynchronously closed on the file task runner
57 // before they can be deleted. Pump the RunLoop to avoid leaks. 57 // before they can be deleted. Pump the RunLoop to avoid leaks.
58 base::RunLoop().RunUntilIdle(); 58 base::RunLoop().RunUntilIdle();
59 EXPECT_TRUE(base::DeleteFile(temp_file_path_, false)); 59 EXPECT_TRUE(base::DeleteFile(temp_file_path_, false));
60 60
61 PlatformTest::TearDown(); 61 PlatformTest::TearDown();
62 } 62 }
63 63
64 const base::FilePath temp_file_path() const { return temp_file_path_; } 64 const base::FilePath temp_file_path() const { return temp_file_path_; }
65 65
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 total_bytes_read += rv; 874 total_bytes_read += rv;
875 data_read.append(buf->data(), rv); 875 data_read.append(buf->data(), rv);
876 } 876 }
877 EXPECT_EQ(file_size, total_bytes_read); 877 EXPECT_EQ(file_size, total_bytes_read);
878 } 878 }
879 #endif 879 #endif
880 880
881 } // namespace 881 } // namespace
882 882
883 } // namespace net 883 } // namespace net
OLDNEW
« no previous file with comments | « net/base/elements_upload_data_stream_unittest.cc ('k') | net/base/ip_endpoint_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698