1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
8 #include "base/at_exit.h"
9 #include "base/command_line.h"
10 #include "base/process/kill.h"
11 #include "base/process/process.h"
12 #include "chrome_frame/crash_server_init.h"
13 #include "chrome_frame/test/chrome_frame_test_utils.h"
14 #include "gtest/gtest.h"
16 class ObligatoryModule: public CAtlExeModuleT<ObligatoryModule> {
19 ObligatoryModule g_obligatory_atl_module;
21 static base::AtExitManager* g_at_exit_manager = NULL;
23 void DeleteAllSingletons() {
24 if (g_at_exit_manager) {
25 g_at_exit_manager->ProcessCallbacksNow();
29 int main(int argc, char** argv) {
30 testing::InitGoogleTest(&argc, argv);
32 base::AtExitManager at_exit_manager;
33 g_at_exit_manager = &at_exit_manager;
35 base::ProcessHandle crash_service = chrome_frame_test::StartCrashService();
37 google_breakpad::scoped_ptr<google_breakpad::ExceptionHandler> breakpad(
38 InitializeCrashReporting(HEADLESS));
40 CommandLine::Init(argc, argv);
44 g_at_exit_manager = NULL;
47 base::KillProcess(crash_service, 0, false);