| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <atlbase.h> | 5 #include <atlbase.h> |
| 6 #include <atlcom.h> | 6 #include <atlcom.h> |
| 7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/process.h" |
| 10 #include "chrome_frame/crash_server_init.h" |
| 11 #include "chrome_frame/test/chrome_frame_test_utils.h" |
| 9 #include "gtest/gtest.h" | 12 #include "gtest/gtest.h" |
| 10 | 13 |
| 11 class ObligatoryModule: public CAtlExeModuleT<ObligatoryModule> { | 14 class ObligatoryModule: public CAtlExeModuleT<ObligatoryModule> { |
| 12 }; | 15 }; |
| 13 | 16 |
| 14 ObligatoryModule g_obligatory_atl_module; | 17 ObligatoryModule g_obligatory_atl_module; |
| 15 | 18 |
| 16 static base::AtExitManager* g_at_exit_manager = NULL; | 19 static base::AtExitManager* g_at_exit_manager = NULL; |
| 17 | 20 |
| 18 void DeleteAllSingletons() { | 21 void DeleteAllSingletons() { |
| 19 if (g_at_exit_manager) { | 22 if (g_at_exit_manager) { |
| 20 g_at_exit_manager->ProcessCallbacksNow(); | 23 g_at_exit_manager->ProcessCallbacksNow(); |
| 21 } | 24 } |
| 22 } | 25 } |
| 23 | 26 |
| 24 int main(int argc, char** argv) { | 27 int main(int argc, char** argv) { |
| 25 testing::InitGoogleTest(&argc, argv); | 28 testing::InitGoogleTest(&argc, argv); |
| 26 | 29 |
| 27 base::AtExitManager at_exit_manager; | 30 base::AtExitManager at_exit_manager; |
| 28 g_at_exit_manager = &at_exit_manager; | 31 g_at_exit_manager = &at_exit_manager; |
| 32 |
| 33 base::ProcessHandle crash_service = chrome_frame_test::StartCrashService(); |
| 34 |
| 35 google_breakpad::scoped_ptr<google_breakpad::ExceptionHandler> breakpad( |
| 36 InitializeCrashReporting(HEADLESS)); |
| 37 |
| 29 CommandLine::Init(argc, argv); | 38 CommandLine::Init(argc, argv); |
| 30 | 39 |
| 31 RUN_ALL_TESTS(); | 40 RUN_ALL_TESTS(); |
| 32 | 41 |
| 33 g_at_exit_manager = NULL; | 42 g_at_exit_manager = NULL; |
| 43 |
| 44 if (crash_service) |
| 45 base::KillProcess(crash_service, 0, false); |
| 34 } | 46 } |
| OLD | NEW |