Tom Sepez | 2281853 | 2020-07-22 20:40:56 +0000 | [diff] [blame] | 1 | // Copyright 2020 PDFium 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 "testing/pdf_test_environment.h" |
| 6 | |
| 7 | #include "core/fxge/cfx_gemodule.h" |
Tom Anderson | 1d91b81 | 2021-11-18 01:37:22 +0000 | [diff] [blame] | 8 | #include "testing/gtest/include/gtest/gtest.h" |
Tom Anderson | 331f3eb | 2021-10-22 00:49:44 +0000 | [diff] [blame] | 9 | #include "testing/utils/path_service.h" |
Tom Sepez | 2281853 | 2020-07-22 20:40:56 +0000 | [diff] [blame] | 10 | |
| 11 | PDFTestEnvironment::PDFTestEnvironment() = default; |
| 12 | |
| 13 | PDFTestEnvironment::~PDFTestEnvironment() = default; |
| 14 | |
| 15 | // testing::Environment: |
| 16 | void PDFTestEnvironment::SetUp() { |
Tom Anderson | 1d91b81 | 2021-11-18 01:37:22 +0000 | [diff] [blame] | 17 | ASSERT_TRUE(PathService::GetExecutableDir(&font_path_)); |
| 18 | font_path_.push_back(PATH_SEPARATOR); |
| 19 | font_path_.append("test_fonts"); |
| 20 | font_paths_[0] = font_path_.c_str(); |
| 21 | font_paths_[1] = nullptr; |
| 22 | CFX_GEModule::Create(font_paths_); |
Tom Sepez | 2281853 | 2020-07-22 20:40:56 +0000 | [diff] [blame] | 23 | } |
| 24 | |
| 25 | void PDFTestEnvironment::TearDown() { |
| 26 | CFX_GEModule::Destroy(); |
| 27 | } |