2011-02-23 Tony Chang <tony@chromium.org>
authortony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Feb 2011 09:25:00 +0000 (09:25 +0000)
committertony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Feb 2011 09:25:00 +0000 (09:25 +0000)
        Reviewed by Kent Tamura.

        [chromium] DumpRenderTree --check-layout-test-sys-deps leaks 4 temp dirs
        https://bugs.webkit.org/show_bug.cgi?id=55004

        * DumpRenderTree/chromium/DumpRenderTree.cpp:
        (WebKitSupportTestEnvironment::WebKitSupportTestEnvironment):
        (WebKitSupportTestEnvironment::~WebKitSupportTestEnvironment):
        (main): Use a C++ object to ensure that TearDownTestEnvironment
            gets called when --check-layout-test-sys-deps is called

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@79422 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/DumpRenderTree/chromium/DumpRenderTree.cpp

index 11595fc..47a7038 100644 (file)
@@ -1,3 +1,16 @@
+2011-02-23  Tony Chang  <tony@chromium.org>
+
+        Reviewed by Kent Tamura.
+
+        [chromium] DumpRenderTree --check-layout-test-sys-deps leaks 4 temp dirs
+        https://bugs.webkit.org/show_bug.cgi?id=55004
+
+        * DumpRenderTree/chromium/DumpRenderTree.cpp:
+        (WebKitSupportTestEnvironment::WebKitSupportTestEnvironment):
+        (WebKitSupportTestEnvironment::~WebKitSupportTestEnvironment):
+        (main): Use a C++ object to ensure that TearDownTestEnvironment
+            gets called when --check-layout-test-sys-deps is called
+
 2011-02-23  Gopal Raghavan  <gopal.1.raghavan@nokia.com>
 
         Reviewed by Anders Carlsson.
index a4d13f7..e008432 100644 (file)
@@ -60,6 +60,18 @@ static const char optionStressDeopt[] = "--stress-deopt";
 static const char optionJavaScriptFlags[] = "--js-flags=";
 static const char optionNoTimeout[] = "--no-timeout";
 
+class WebKitSupportTestEnvironment {
+public:
+    WebKitSupportTestEnvironment()
+    {
+        webkit_support::SetUpTestEnvironment();
+    }
+    ~WebKitSupportTestEnvironment()
+    {
+        webkit_support::TearDownTestEnvironment();
+    }
+};
+
 static void runTest(TestShell& shell, TestParams& params, const string& testName, bool testShellMode)
 {
     int oldTimeoutMsec = shell.layoutTestTimeout();
@@ -109,7 +121,7 @@ static void runTest(TestShell& shell, TestParams& params, const string& testName
 
 int main(int argc, char* argv[])
 {
-    webkit_support::SetUpTestEnvironment();
+    WebKitSupportTestEnvironment testEnvironment;
     platformInit(&argc, &argv);
 
     TestParams params;
@@ -144,7 +156,7 @@ int main(int argc, char* argv[])
         else if (argument == optionStartupDialog)
             startupDialog = true;
         else if (argument == optionCheckLayoutTestSystemDeps)
-            exit(checkLayoutTestSystemDependencies() ? EXIT_SUCCESS : EXIT_FAILURE);
+            return checkLayoutTestSystemDependencies() ? EXIT_SUCCESS : EXIT_FAILURE;
         else if (argument == optionHardwareAcceleratedGL)
             hardwareAcceleratedGL = true;
         else if (argument == optionEnableAcceleratedCompositing)
@@ -218,6 +230,5 @@ int main(int argc, char* argv[])
         shell.resetTestController();
     }
 
-    webkit_support::TearDownTestEnvironment();
     return EXIT_SUCCESS;
 }