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

Side by Side Diff: courgette/base_test_unittest.cc

Issue 14820034: Cleanup: Remove unneeded base/file_util.h includes in chrome_frame, courgette, ipc, media, and net. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: fix build Created 7 years, 7 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 | « courgette/base_test_unittest.h ('k') | courgette/courgette_minimal_tool.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "courgette/base_test_unittest.h" 5 #include "courgette/base_test_unittest.h"
6 6
7 #include "base/file_util.h"
7 #include "base/path_service.h" 8 #include "base/path_service.h"
8 9
9 void BaseTest::SetUp() { 10 void BaseTest::SetUp() {
10 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &test_dir_)); 11 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &test_dir_));
11 test_dir_ = test_dir_.AppendASCII("courgette"); 12 test_dir_ = test_dir_.AppendASCII("courgette");
12 test_dir_ = test_dir_.AppendASCII("testdata"); 13 test_dir_ = test_dir_.AppendASCII("testdata");
13 } 14 }
14 15
15 void BaseTest::TearDown() { 16 void BaseTest::TearDown() {
16 } 17 }
17 18
18 // Reads a test file into a string. 19 // Reads a test file into a string.
19 std::string BaseTest::FileContents(const char* file_name) const { 20 std::string BaseTest::FileContents(const char* file_name) const {
20 base::FilePath file_path = test_dir_; 21 base::FilePath file_path = test_dir_;
21 file_path = file_path.AppendASCII(file_name); 22 file_path = file_path.AppendASCII(file_name);
22 std::string file_bytes; 23 std::string file_bytes;
23 24
24 EXPECT_TRUE(file_util::ReadFileToString(file_path, &file_bytes)); 25 EXPECT_TRUE(file_util::ReadFileToString(file_path, &file_bytes));
25 26
26 return file_bytes; 27 return file_bytes;
27 } 28 }
28 29
29 std::string BaseTest::FilesContents(std::list<std::string> file_names) const { 30 std::string BaseTest::FilesContents(std::list<std::string> file_names) const {
30
31 std::string result; 31 std::string result;
32 32
33 std::list<std::string>::iterator file_name = file_names.begin(); 33 std::list<std::string>::iterator file_name = file_names.begin();
34 34
35 while (file_name != file_names.end()) { 35 while (file_name != file_names.end()) {
36 result += FileContents(file_name->c_str()); 36 result += FileContents(file_name->c_str());
37 file_name++; 37 file_name++;
38 } 38 }
39 39
40 return result; 40 return result;
41 } 41 }
OLDNEW
« no previous file with comments | « courgette/base_test_unittest.h ('k') | courgette/courgette_minimal_tool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698