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

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

Issue 99923002: Move temp file functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | « extensions/common/file_util_unittest.cc ('k') | net/base/upload_data_stream_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/file_util.h" 9 #include "base/file_util.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 28 matching lines...) Expand all
39 return buf; 39 return buf;
40 } 40 }
41 41
42 } // namespace 42 } // namespace
43 43
44 class FileStreamTest : public PlatformTest { 44 class FileStreamTest : public PlatformTest {
45 public: 45 public:
46 virtual void SetUp() { 46 virtual void SetUp() {
47 PlatformTest::SetUp(); 47 PlatformTest::SetUp();
48 48
49 file_util::CreateTemporaryFile(&temp_file_path_); 49 base::CreateTemporaryFile(&temp_file_path_);
50 file_util::WriteFile(temp_file_path_, kTestData, kTestDataSize); 50 file_util::WriteFile(temp_file_path_, kTestData, kTestDataSize);
51 } 51 }
52 virtual void TearDown() { 52 virtual void TearDown() {
53 EXPECT_TRUE(base::DeleteFile(temp_file_path_, false)); 53 EXPECT_TRUE(base::DeleteFile(temp_file_path_, false));
54 54
55 // FileStreamContexts must be asynchronously closed on the file task runner 55 // FileStreamContexts must be asynchronously closed on the file task runner
56 // before they can be deleted. Pump the RunLoop to avoid leaks. 56 // before they can be deleted. Pump the RunLoop to avoid leaks.
57 base::RunLoop().RunUntilIdle(); 57 base::RunLoop().RunUntilIdle();
58 PlatformTest::TearDown(); 58 PlatformTest::TearDown();
59 } 59 }
(...skipping 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after
1222 total_bytes_read += rv; 1222 total_bytes_read += rv;
1223 data_read.append(buf->data(), rv); 1223 data_read.append(buf->data(), rv);
1224 } 1224 }
1225 EXPECT_EQ(file_size, total_bytes_read); 1225 EXPECT_EQ(file_size, total_bytes_read);
1226 } 1226 }
1227 #endif 1227 #endif
1228 1228
1229 } // namespace 1229 } // namespace
1230 1230
1231 } // namespace net 1231 } // namespace net
OLDNEW
« no previous file with comments | « extensions/common/file_util_unittest.cc ('k') | net/base/upload_data_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698