cef/tests/unittests/test_suite.cc
Marshall Greenblatt 6b134b4def - Add CefSettings.local_storage_quota and session_storage_quota options for setting localStorage and sessionStorage quota limits respectively (issue #348).
- Add Cef*Storage() functions and CefStorageVisitor interface for accessing localStorage and sessionStorage data via the native API (issue #361).
- Add a "cache_path" command-line flag option to cef_unittests for running the unit tests with a cache path value (issue #368).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@302 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2011-10-06 13:34:47 +00:00

40 lines
1.1 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 "include/cef.h"
#include "test_suite.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;
CommandLine* command_line = CommandLine::ForCurrentProcess();
if (command_line->HasSwitch("cache_path")) {
// Set the cache_path value.
std::string cache_path = command_line->GetSwitchValueASCII("cache_path");
CefString(&settings.cache_path).FromASCII(cache_path.c_str());
}
CefInitialize(settings);
}
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();
}