diff options
Diffstat (limited to 'webkit/tools/test_shell')
-rw-r--r-- | webkit/tools/test_shell/run_all_tests.cc | 5 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_main.cc | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/webkit/tools/test_shell/run_all_tests.cc b/webkit/tools/test_shell/run_all_tests.cc index 05cdc43..3c4148d 100644 --- a/webkit/tools/test_shell/run_all_tests.cc +++ b/webkit/tools/test_shell/run_all_tests.cc @@ -33,6 +33,7 @@ #include <windows.h> #include <commctrl.h> +#include "base/at_exit.h" #include "base/icu_util.h" #include "base/message_loop.h" #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" @@ -50,6 +51,10 @@ const char* TestShellTest::kJavascriptDelayExitScript = "</script>"; int main(int argc, char* argv[]) { + // Some unittests may use base::Singleton<>, thus we need to instanciate + // the AtExitManager or else we will leak objects. + base::AtExitManager at_exit_manager; + TestShell::InitLogging(true); // suppress error dialogs // Initialize test shell in non-interactive mode, which will let us load one diff --git a/webkit/tools/test_shell/test_shell_main.cc b/webkit/tools/test_shell/test_shell_main.cc index 468ec36..4b1940e 100644 --- a/webkit/tools/test_shell/test_shell_main.cc +++ b/webkit/tools/test_shell/test_shell_main.cc @@ -34,6 +34,7 @@ #include <windows.h> #include <commctrl.h> +#include "base/at_exit.h" #include "base/basictypes.h" #include "base/command_line.h" #include "base/event_recorder.h" @@ -136,6 +137,9 @@ int main(int argc, char* argv[]) _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR); _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE); #endif + // Some tests may use base::Singleton<>, thus we need to instanciate + // the AtExitManager or else we will leak objects. + base::AtExitManager at_exit_manager; CommandLine parsed_command_line; if (parsed_command_line.HasSwitch(test_shell::kStartupDialog)) |