2016-11-16 21:24:13 +01:00
|
|
|
// Copyright 2016 The Chromium Embedded Framework Authors. Postions copyright
|
|
|
|
// 2012 The Chromium Authors. All rights reserved. Use of this source code is
|
|
|
|
// governed by a BSD-style license that can be found in the LICENSE file.
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2020-08-20 00:23:42 +02:00
|
|
|
#ifndef CEF_TESTS_CEFTESTS_TEST_SUITE_H_
|
|
|
|
#define CEF_TESTS_CEFTESTS_TEST_SUITE_H_
|
2012-04-03 03:34:16 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
2017-08-04 00:55:19 +02:00
|
|
|
#include <vector>
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2016-11-16 21:24:13 +01:00
|
|
|
#include "include/cef_command_line.h"
|
|
|
|
#include "include/wrapper/cef_helpers.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2016-11-16 21:24:13 +01:00
|
|
|
// A single instance of this object will be created by main() in
|
|
|
|
// run_all_unittests.cc.
|
|
|
|
class CefTestSuite {
|
2012-04-03 03:34:16 +02:00
|
|
|
public:
|
|
|
|
CefTestSuite(int argc, char** argv);
|
2016-11-16 21:24:13 +01:00
|
|
|
~CefTestSuite();
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2016-11-16 21:24:13 +01:00
|
|
|
static CefTestSuite* GetInstance();
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2016-11-16 21:24:13 +01:00
|
|
|
void InitMainProcess();
|
|
|
|
int Run();
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2016-11-16 21:24:13 +01:00
|
|
|
void GetSettings(CefSettings& settings) const;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2017-08-04 00:55:19 +02:00
|
|
|
// Register a temp directory that should be deleted on shutdown.
|
|
|
|
void RegisterTempDirectory(const CefString& directory);
|
|
|
|
|
|
|
|
// Called after shutdown to delete any registered temp directories.
|
|
|
|
void DeleteTempDirectories();
|
|
|
|
|
2016-11-16 21:24:13 +01:00
|
|
|
CefRefPtr<CefCommandLine> command_line() const { return command_line_; }
|
2021-04-07 00:09:45 +02:00
|
|
|
CefString root_cache_path() const { return root_cache_path_; }
|
2016-11-16 21:24:13 +01:00
|
|
|
|
|
|
|
// The return value from Run().
|
|
|
|
int retval() const { return retval_; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
void PreInitialize();
|
|
|
|
void Initialize();
|
|
|
|
void Shutdown();
|
|
|
|
|
|
|
|
int argc_;
|
|
|
|
CefScopedArgArray argv_;
|
|
|
|
CefRefPtr<CefCommandLine> command_line_;
|
|
|
|
|
2017-08-04 00:55:19 +02:00
|
|
|
std::vector<CefString> temp_directories_;
|
|
|
|
base::Lock temp_directories_lock_;
|
|
|
|
|
2021-04-07 00:09:45 +02:00
|
|
|
CefString root_cache_path_;
|
|
|
|
|
2016-11-16 21:24:13 +01:00
|
|
|
int retval_;
|
2012-04-03 03:34:16 +02:00
|
|
|
};
|
|
|
|
|
2015-02-18 18:28:56 +01:00
|
|
|
#define CEF_SETTINGS_ACCEPT_LANGUAGE "en-GB"
|
|
|
|
|
2020-08-20 00:23:42 +02:00
|
|
|
#endif // CEF_TESTS_CEFTESTS_TEST_SUITE_H_
|