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

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

Issue 164537: Renames the function CreateTemporaryFilename to CreateTemporaryFile and track... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: CommandLine fix Created 11 years, 4 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 | « chrome/renderer/render_view_unittest.cc ('k') | net/url_request/url_request_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) 2008 The Chromium Authors. All rights reserved. Use of this 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the 2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file. 3 // LICENSE file.
4 4
5 #include "base/file_util.h" 5 #include "base/file_util.h"
6 #include "base/path_service.h" 6 #include "base/path_service.h"
7 #include "base/platform_file.h" 7 #include "base/platform_file.h"
8 #include "net/base/file_stream.h" 8 #include "net/base/file_stream.h"
9 #include "net/base/net_errors.h" 9 #include "net/base/net_errors.h"
10 #include "net/base/test_completion_callback.h" 10 #include "net/base/test_completion_callback.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 #include "testing/platform_test.h" 12 #include "testing/platform_test.h"
13 13
14 namespace { 14 namespace {
15 15
16 const char kTestData[] = "0123456789"; 16 const char kTestData[] = "0123456789";
17 const int kTestDataSize = arraysize(kTestData) - 1; 17 const int kTestDataSize = arraysize(kTestData) - 1;
18 18
19 class FileStreamTest : public PlatformTest { 19 class FileStreamTest : public PlatformTest {
20 public: 20 public:
21 virtual void SetUp() { 21 virtual void SetUp() {
22 PlatformTest::SetUp(); 22 PlatformTest::SetUp();
23 23
24 file_util::CreateTemporaryFileName(&temp_file_path_); 24 file_util::CreateTemporaryFile(&temp_file_path_);
25 file_util::WriteFile(temp_file_path_.ToWStringHack(), 25 file_util::WriteFile(temp_file_path_.ToWStringHack(),
26 kTestData, kTestDataSize); 26 kTestData, kTestDataSize);
27 } 27 }
28 virtual void TearDown() { 28 virtual void TearDown() {
29 file_util::Delete(temp_file_path_, false); 29 file_util::Delete(temp_file_path_, false);
30 30
31 PlatformTest::TearDown(); 31 PlatformTest::TearDown();
32 } 32 }
33 const FilePath temp_file_path() const { return temp_file_path_; } 33 const FilePath temp_file_path() const { return temp_file_path_; }
34 private: 34 private:
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 write_stream.Close(); 884 write_stream.Close();
885 885
886 // Read in the contents and make sure we get back what we expected. 886 // Read in the contents and make sure we get back what we expected.
887 std::string read_contents; 887 std::string read_contents;
888 EXPECT_TRUE(file_util::ReadFileToString(temp_file_path(), &read_contents)); 888 EXPECT_TRUE(file_util::ReadFileToString(temp_file_path(), &read_contents));
889 889
890 EXPECT_EQ("01230123", read_contents); 890 EXPECT_EQ("01230123", read_contents);
891 } 891 }
892 892
893 } // namespace 893 } // namespace
OLDNEW
« no previous file with comments | « chrome/renderer/render_view_unittest.cc ('k') | net/url_request/url_request_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698