| OLD | NEW |
| 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/path_service.h" | 7 #include "base/path_service.h" |
| 8 | 8 |
| 9 void BaseTest::SetUp() { | 9 void BaseTest::SetUp() { |
| 10 PathService::Get(base::DIR_SOURCE_ROOT, &test_dir_); | 10 DCHECK(PathService::Get(base::DIR_SOURCE_ROOT, &test_dir_)); |
| 11 test_dir_ = test_dir_.AppendASCII("courgette"); | 11 test_dir_ = test_dir_.AppendASCII("courgette"); |
| 12 test_dir_ = test_dir_.AppendASCII("testdata"); | 12 test_dir_ = test_dir_.AppendASCII("testdata"); |
| 13 } | 13 } |
| 14 | 14 |
| 15 void BaseTest::TearDown() { | 15 void BaseTest::TearDown() { |
| 16 } | 16 } |
| 17 | 17 |
| 18 // Reads a test file into a string. | 18 // Reads a test file into a string. |
| 19 std::string BaseTest::FileContents(const char* file_name) const { | 19 std::string BaseTest::FileContents(const char* file_name) const { |
| 20 FilePath file_path = test_dir_; | 20 FilePath file_path = test_dir_; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 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 } |
| OLD | NEW |