cef/tests/unittests/test_suite.cc
Marshall Greenblatt ff976bc07f Break cef.h into multiple headers (issue #142).
- Move wrapper classes from cef_wrapper.h to wrapper/ directory.
- Move C API functions/classes from cef_capi.h to capi/ directory.
- Move global function implementations from cef_context.cc to *_impl.cc files.
- Output auto-generated file paths in cef_paths.gypi.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@442 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2011-12-23 17:36:30 +00:00

51 lines
1.3 KiB
C++

// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include "test_suite.h"
#include "include/cef_app.h"
#include "base/command_line.h"
#include "build/build_config.h"
#include "base/threading/platform_thread.h"
#include "base/test/test_suite.h"
CefTestSuite::CefTestSuite(int argc, char** argv) : TestSuite(argc, argv) {
}
void CefTestSuite::Initialize() {
TestSuite::Initialize();
CefSettings settings;
settings.multi_threaded_message_loop = true;
std::string cache_path;
if (GetCachePath(cache_path)) {
// Set the cache_path value.
CefString(&settings.cache_path).FromASCII(cache_path.c_str());
}
CefInitialize(settings, NULL);
}
void CefTestSuite::Shutdown() {
// Delay a bit so that the system has a chance to finish destroying windows
// before CefShutdown() checks for memory leaks.
base::PlatformThread::Sleep(500);
CefShutdown();
TestSuite::Shutdown();
}
// static
bool CefTestSuite::GetCachePath(std::string& path) {
CommandLine* command_line = CommandLine::ForCurrentProcess();
if (command_line->HasSwitch("cache_path")) {
// Set the cache_path value.
path = command_line->GetSwitchValueASCII("cache_path");
return true;
}
return false;
}