summaryrefslogtreecommitdiffstats
path: root/webkit/tools/test_shell/run_all_tests.cc
diff options
context:
space:
mode:
authorcpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-01 03:06:25 +0000
committercpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-01 03:06:25 +0000
commitae645471f62870fbe4d09eaa82e9043ffe7284b8 (patch)
tree7fa75ac4be77464cce7077b145a553d721824119 /webkit/tools/test_shell/run_all_tests.cc
parentf0118db83aa396c97628c33a030627f72bdf0444 (diff)
downloadchromium_src-ae645471f62870fbe4d09eaa82e9043ffe7284b8.zip
chromium_src-ae645471f62870fbe4d09eaa82e9043ffe7284b8.tar.gz
chromium_src-ae645471f62870fbe4d09eaa82e9043ffe7284b8.tar.bz2
Adds new class AtExitManager which manages the dtors of all singletons.
- Previously this job was done by the CRT's atexit() which runs later than we want and under the loader lock. - Had to modify most main() functions for the testing executables so we don't trigger leak detectors. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@219 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell/run_all_tests.cc')
-rw-r--r--webkit/tools/test_shell/run_all_tests.cc5
1 files changed, 5 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