Title: [111945] trunk/Tools
Revision
111945
Author
[email protected]
Date
2012-03-23 17:53:34 -0700 (Fri, 23 Mar 2012)

Log Message

nrwt: don't wait for safari to exit before exiting after showing the results file
https://bugs.webkit.org/show_bug.cgi?id=81845

Reviewed by Ryosuke Niwa.

Prior to this change, if you ran new-run-webkit-tests and
displayed the HTML results file at the end, we would block
waiting for the user to quit the browser. There doesn't seem to
be a need for that, and the Chromium ports don't do this.

Also, update the mac tests to capture the output and be quiet :).

* Scripts/webkitpy/common/system/executive_mock.py:
  Make popen() testable, implement should_log for it.
* Scripts/webkitpy/layout_tests/port/mac.py:
(MacPort.show_results_html_file):
* Scripts/webkitpy/layout_tests/port/mac_unittest.py:
  Silence some of the tests via outputcapture.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (111944 => 111945)


--- trunk/Tools/ChangeLog	2012-03-24 00:52:56 UTC (rev 111944)
+++ trunk/Tools/ChangeLog	2012-03-24 00:53:34 UTC (rev 111945)
@@ -1,3 +1,24 @@
+2012-03-23  Dirk Pranke  <[email protected]>
+
+        nrwt: don't wait for safari to exit before exiting after showing the results file
+        https://bugs.webkit.org/show_bug.cgi?id=81845
+
+        Reviewed by Ryosuke Niwa.
+
+        Prior to this change, if you ran new-run-webkit-tests and
+        displayed the HTML results file at the end, we would block
+        waiting for the user to quit the browser. There doesn't seem to
+        be a need for that, and the Chromium ports don't do this.
+
+        Also, update the mac tests to capture the output and be quiet :).
+
+        * Scripts/webkitpy/common/system/executive_mock.py:
+          Make popen() testable, implement should_log for it.
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+        (MacPort.show_results_html_file):
+        * Scripts/webkitpy/layout_tests/port/mac_unittest.py:
+          Silence some of the tests via outputcapture.
+
 2012-03-23  Gustavo Noronha Silva  <[email protected]>
 
         [GTK] libgcrypt and p11-kit should not be in jhbuild modules

Modified: trunk/Tools/Scripts/webkitpy/common/system/executive_mock.py (111944 => 111945)


--- trunk/Tools/Scripts/webkitpy/common/system/executive_mock.py	2012-03-24 00:52:56 UTC (rev 111944)
+++ trunk/Tools/Scripts/webkitpy/common/system/executive_mock.py	2012-03-24 00:53:34 UTC (rev 111945)
@@ -95,8 +95,15 @@
     def cpu_count(self):
         return 2
 
-    def popen(self, *args, **kwargs):
-        # FIXME: Implement logging when self._should_log is set.
+    def popen(self, args, cwd=None, env=None, **kwargs):
+        if self._should_log:
+            cwd_string = ""
+            if cwd:
+                cwd_string = ", cwd=%s" % cwd
+            env_string = ""
+            if env:
+                env_string = ", env=%s" % env
+            log("MOCK popen: %s%s%s" % (args, cwd_string, env_string))
         if not self._proc:
             self._proc = MockProcess()
         return self._proc

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/mac.py (111944 => 111945)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/mac.py	2012-03-24 00:52:56 UTC (rev 111944)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/mac.py	2012-03-24 00:53:34 UTC (rev 111945)
@@ -139,7 +139,10 @@
         return self._build_path('WebCore.framework/Versions/A/WebCore')
 
     def show_results_html_file(self, results_filename):
-        self._run_script('run-safari', ['--no-saved-state', '-NSOpen', results_filename])
+        # We don't use self._run_script() because we don't want to wait for the script
+        # to exit and we want the output to show up on stdout in case there are errors
+        # launching the browser.
+        self._executive.popen([self._config.script_path('run-safari')] + self._arguments_for_configuration() + ['--no-saved-state', '-NSOpen', results_filename], cwd=self._config.webkit_base_dir())
 
     # FIXME: The next two routines turn off the http locking in order
     # to work around failures on the bots caused when the slave restarts.

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/mac_unittest.py (111944 => 111945)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/mac_unittest.py	2012-03-24 00:52:56 UTC (rev 111944)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/mac_unittest.py	2012-03-24 00:53:34 UTC (rev 111945)
@@ -172,7 +172,7 @@
         port = self.make_port()
         # Delay setting a should_log executive to avoid logging from MacPort.__init__.
         port._executive = MockExecutive(should_log=True)
-        expected_stderr = "MOCK run_command: ['Tools/Scripts/run-safari', '--release', '--no-saved-state', '-NSOpen', 'test.html'], cwd=/mock-checkout\n"
+        expected_stderr = "MOCK popen: ['Tools/Scripts/run-safari', '--release', '--no-saved-state', '-NSOpen', 'test.html'], cwd=/mock-checkout\n"
         OutputCapture().assert_outputs(self, port.show_results_html_file, ["test.html"], expected_stderr=expected_stderr)
 
     def test_operating_system(self):
@@ -196,9 +196,12 @@
     def test_helper_starts(self):
         host = MockSystemHost(MockExecutive())
         port = self.make_port(host)
+        oc = OutputCapture()
+        oc.capture_output()
         host.executive._proc = MockProcess('ready\n')
         port.start_helper()
         port.stop_helper()
+        oc.restore_output()
 
         # make sure trying to stop the helper twice is safe.
         port.stop_helper()
@@ -206,8 +209,11 @@
     def test_helper_fails_to_start(self):
         host = MockSystemHost(MockExecutive())
         port = self.make_port(host)
+        oc = OutputCapture()
+        oc.capture_output()
         port.start_helper()
         port.stop_helper()
+        oc.restore_output()
 
     def test_helper_fails_to_stop(self):
         host = MockSystemHost(MockExecutive())
@@ -218,5 +224,8 @@
         host.executive._proc.wait = bad_waiter
 
         port = self.make_port(host)
+        oc = OutputCapture()
+        oc.capture_output()
         port.start_helper()
         port.stop_helper()
+        oc.restore_output()
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to