blob: 4efd3920d331e3f4908873741e07b39a74f567e9 [file]
// Copyright 2020 The PDFium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef TESTING_EMBEDDER_TEST_ENVIRONMENT_H_
#define TESTING_EMBEDDER_TEST_ENVIRONMENT_H_
#include <string>
#include "public/fpdfview.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/test_fonts.h"
class EmbedderTestEnvironment : public testing::Environment {
public:
EmbedderTestEnvironment();
~EmbedderTestEnvironment() override;
// Note: GetInstance() does not create one if it does not exist,
// so the main program must explicitly add this enviroment.
static EmbedderTestEnvironment* GetInstance();
// testing::Environment:
void SetUp() override;
void TearDown() override;
void SetBrotli(bool enabled) { brotli_enabled_ = enabled; }
void SetVersion(int version) { version_ = version; }
bool GetBrotli() const { return brotli_enabled_; }
int GetVersion() const { return version_; }
void AddFlags(int argc, char** argv);
bool write_pngs() const { return write_pngs_; }
private:
void AddFlag(const std::string& flag);
bool CheckFlags();
int version_ = 6;
FPDF_RENDERER_TYPE renderer_type_;
bool fontations_ = false;
bool write_pngs_ = false;
bool brotli_enabled_ = false;
TestFonts test_fonts_;
};
#endif // TESTING_EMBEDDER_TEST_ENVIRONMENT_H_