OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "courgette/base_test_unittest.h" |
| 6 |
| 7 #include "base/path_service.h" |
| 8 |
| 9 void BaseTest::SetUp() { |
| 10 PathService::Get(base::DIR_SOURCE_ROOT, &test_dir_); |
| 11 test_dir_ = test_dir_.AppendASCII("courgette"); |
| 12 test_dir_ = test_dir_.AppendASCII("testdata"); |
| 13 } |
| 14 |
| 15 void BaseTest::TearDown() { |
| 16 } |
| 17 |
| 18 // Reads a test file into a string. |
| 19 std::string BaseTest::FileContents(const char* file_name) const { |
| 20 FilePath file_path = test_dir_; |
| 21 file_path = file_path.AppendASCII(file_name); |
| 22 std::string file_bytes; |
| 23 |
| 24 EXPECT_TRUE(file_util::ReadFileToString(file_path, &file_bytes)); |
| 25 |
| 26 return file_bytes; |
| 27 } |
OLD | NEW |