summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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() {