[email protected] | 7dd06a0 | 2010-12-09 02:56:24 | [diff] [blame] | 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. | ||||
[email protected] | f781782 | 2009-09-24 05:11:58 | [diff] [blame] | 4 | |
5 | #include <atlbase.h> | ||||
6 | #include <atlcom.h> | ||||
7 | #include "base/at_exit.h" | ||||
8 | #include "base/command_line.h" | ||||
[email protected] | 2e1101f | 2011-06-27 17:08:24 | [diff] [blame] | 9 | #include "base/process.h" |
10 | #include "chrome_frame/crash_server_init.h" | ||||
11 | #include "chrome_frame/test/chrome_frame_test_utils.h" | ||||
[email protected] | f781782 | 2009-09-24 05:11:58 | [diff] [blame] | 12 | #include "gtest/gtest.h" |
13 | |||||
14 | class ObligatoryModule: public CAtlExeModuleT<ObligatoryModule> { | ||||
15 | }; | ||||
16 | |||||
17 | ObligatoryModule g_obligatory_atl_module; | ||||
18 | |||||
[email protected] | 7dd06a0 | 2010-12-09 02:56:24 | [diff] [blame] | 19 | static base::AtExitManager* g_at_exit_manager = NULL; |
20 | |||||
21 | void DeleteAllSingletons() { | ||||
22 | if (g_at_exit_manager) { | ||||
23 | g_at_exit_manager->ProcessCallbacksNow(); | ||||
24 | } | ||||
25 | } | ||||
26 | |||||
[email protected] | f781782 | 2009-09-24 05:11:58 | [diff] [blame] | 27 | int main(int argc, char** argv) { |
28 | testing::InitGoogleTest(&argc, argv); | ||||
29 | |||||
30 | base::AtExitManager at_exit_manager; | ||||
[email protected] | 7dd06a0 | 2010-12-09 02:56:24 | [diff] [blame] | 31 | g_at_exit_manager = &at_exit_manager; |
[email protected] | 2e1101f | 2011-06-27 17:08:24 | [diff] [blame] | 32 | |
33 | base::ProcessHandle crash_service = chrome_frame_test::StartCrashService(); | ||||
34 | |||||
35 | google_breakpad::scoped_ptr<google_breakpad::ExceptionHandler> breakpad( | ||||
36 | InitializeCrashReporting(HEADLESS)); | ||||
37 | |||||
[email protected] | f781782 | 2009-09-24 05:11:58 | [diff] [blame] | 38 | CommandLine::Init(argc, argv); |
39 | |||||
40 | RUN_ALL_TESTS(); | ||||
[email protected] | 7dd06a0 | 2010-12-09 02:56:24 | [diff] [blame] | 41 | |
42 | g_at_exit_manager = NULL; | ||||
[email protected] | 2e1101f | 2011-06-27 17:08:24 | [diff] [blame] | 43 | |
44 | if (crash_service) | ||||
45 | base::KillProcess(crash_service, 0, false); | ||||
[email protected] | f781782 | 2009-09-24 05:11:58 | [diff] [blame] | 46 | } |