1 // Copyright 2016 The Chromium Embedded Framework Authors. Postions copyright 2 // 2012 The Chromium Authors. All rights reserved. Use of this source code is 3 // governed by a BSD-style license that can be found in the LICENSE file. 4 5 #ifndef CEF_TESTS_CEFTESTS_TEST_SUITE_H_ 6 #define CEF_TESTS_CEFTESTS_TEST_SUITE_H_ 7 #pragma once 8 9 #include <string> 10 #include <vector> 11 12 #include "include/cef_command_line.h" 13 #include "include/wrapper/cef_helpers.h" 14 15 // A single instance of this object will be created by main() in 16 // run_all_unittests.cc. 17 class CefTestSuite { 18 public: 19 CefTestSuite(int argc, char** argv); 20 ~CefTestSuite(); 21 22 static CefTestSuite* GetInstance(); 23 24 void InitMainProcess(); 25 int Run(); 26 27 void GetSettings(CefSettings& settings) const; 28 29 // Register a temp directory that should be deleted on shutdown. 30 void RegisterTempDirectory(const CefString& directory); 31 32 // Called after shutdown to delete any registered temp directories. 33 void DeleteTempDirectories(); 34 command_line()35 CefRefPtr<CefCommandLine> command_line() const { return command_line_; } root_cache_path()36 CefString root_cache_path() const { return root_cache_path_; } 37 38 // The return value from Run(). retval()39 int retval() const { return retval_; } 40 41 private: 42 void PreInitialize(); 43 void Initialize(); 44 void Shutdown(); 45 46 int argc_; 47 CefScopedArgArray argv_; 48 CefRefPtr<CefCommandLine> command_line_; 49 50 std::vector<CefString> temp_directories_; 51 base::Lock temp_directories_lock_; 52 53 CefString root_cache_path_; 54 55 int retval_; 56 }; 57 58 #define CEF_SETTINGS_ACCEPT_LANGUAGE "en-GB" 59 60 #endif // CEF_TESTS_CEFTESTS_TEST_SUITE_H_ 61