summaryrefslogtreecommitdiffstats
path: root/webkit/tools
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-11 01:24:32 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-11 01:24:32 +0000
commitd2abf5ce2ba01998a59c6625b2c40b7318f2d57b (patch)
treea41d6d03f48ec0112808cbaadfd8049e498aab93 /webkit/tools
parent153c6986284b7fc39fe5a875e0df5c8f29120957 (diff)
downloadchromium_src-d2abf5ce2ba01998a59c6625b2c40b7318f2d57b.zip
chromium_src-d2abf5ce2ba01998a59c6625b2c40b7318f2d57b.tar.gz
chromium_src-d2abf5ce2ba01998a59c6625b2c40b7318f2d57b.tar.bz2
Install more signal handlers so test shell cleanup after itself.
Found a couple more cases where we are littering files in /tmp. a) if we run test_shell and hit ctrl+c, b) if the test shell gets killed by KillAllTestShells(). Review URL: http://codereview.chromium.org/45003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11412 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools')
-rw-r--r--webkit/tools/test_shell/test_shell_gtk.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/webkit/tools/test_shell/test_shell_gtk.cc b/webkit/tools/test_shell/test_shell_gtk.cc
index e53d409..cc5f5d2 100644
--- a/webkit/tools/test_shell/test_shell_gtk.cc
+++ b/webkit/tools/test_shell/test_shell_gtk.cc
@@ -49,6 +49,11 @@ static FilePath* g_ahem_path = NULL;
}
+static void TerminationSignalHandler(int signatl) {
+ TestShell::ShutdownTestShell();
+ exit(0);
+}
+
// static
void TestShell::InitializeTestShell(bool layout_test_mode) {
window_list_ = new WindowList;
@@ -182,6 +187,10 @@ void TestShell::InitializeTestShell(bool layout_test_mode) {
if (!FcConfigSetCurrent(fontcfg))
LOG(FATAL) << "Failed to set the default font configuration";
+
+ // Install an signal handler so we clean up after ourselves.
+ signal(SIGINT, TerminationSignalHandler);
+ signal(SIGTERM, TerminationSignalHandler);
}
void TestShell::PlatformShutdown() {