Title: [113339] trunk/Tools
Revision
113339
Author
[email protected]
Date
2012-04-05 11:15:59 -0700 (Thu, 05 Apr 2012)

Log Message

gtk_unittest.GtkPortTest.test_get_crash_log failing on windows
https://bugs.webkit.org/show_bug.cgi?id=83176

Patch by Philippe Normand <[email protected]> on 2012-04-05
Reviewed by Tony Chang.

Refactored the test to use os.path.join() to specify the
core_pattern value of the empty crash log mock.

* Scripts/webkitpy/layout_tests/port/gtk_unittest.py:
(GtkPortTest):
(GtkPortTest.assertLinesEqual):
(GtkPortTest.test_get_crash_log):
(_mock_gdb_output):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (113338 => 113339)


--- trunk/Tools/ChangeLog	2012-04-05 18:01:07 UTC (rev 113338)
+++ trunk/Tools/ChangeLog	2012-04-05 18:15:59 UTC (rev 113339)
@@ -1,3 +1,19 @@
+2012-04-05  Philippe Normand  <[email protected]>
+
+        gtk_unittest.GtkPortTest.test_get_crash_log failing on windows
+        https://bugs.webkit.org/show_bug.cgi?id=83176
+
+        Reviewed by Tony Chang.
+
+        Refactored the test to use os.path.join() to specify the
+        core_pattern value of the empty crash log mock.
+
+        * Scripts/webkitpy/layout_tests/port/gtk_unittest.py:
+        (GtkPortTest):
+        (GtkPortTest.assertLinesEqual):
+        (GtkPortTest.test_get_crash_log):
+        (_mock_gdb_output):
+
 2012-04-05  Csaba Osztrogonác  <[email protected]>
 
         [Qt] Fix includes after QtDeclarative -> QtQML renaming

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/gtk_unittest.py (113338 => 113339)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/gtk_unittest.py	2012-04-05 18:01:07 UTC (rev 113338)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/gtk_unittest.py	2012-04-05 18:15:59 UTC (rev 113339)
@@ -41,18 +41,7 @@
 class GtkPortTest(port_testcase.PortTestCase):
     port_name = 'gtk'
     port_maker = GtkPort
-    _mock_crash_log = """\
-Crash log for DumpRenderTree (pid 28529):
 
-Coredump core-pid_28529-_-process_DumpRenderTree not found. To enable crash logs:
-
-- run this command as super-user: echo "%(core_directory)s/core-pid_%%p-_-process_%%e" > /proc/sys/kernel/core_pattern
-- enable core dumps: ulimit -c unlimited
-- set the WEBKIT_CORE_DUMPS_DIRECTORY environment variable: export WEBKIT_CORE_DUMPS_DIRECTORY=%(core_directory)s
-
-
-STDERR: <empty>""" % {'core_directory': os.environ.get('WEBKIT_CORE_DUMPS_DIRECTORY', '/path/to/coredumps')}
-
     def test_show_results_html_file(self):
         port = self.make_port()
         port._executive = MockExecutive(should_log=True)
@@ -65,13 +54,26 @@
         else:
             self.assertEqual(a.splitlines(), b.splitlines())
 
-    def _mock_gdb_output(self, coredump_path):
-        return (self._mock_crash_log, [])
 
     def test_get_crash_log(self):
-        if not sys.platform.startswith("linux"):
-            return
+        core_directory = os.environ.get('WEBKIT_CORE_DUMPS_DIRECTORY', '/path/to/coredumps')
+        core_pattern = os.path.join(core_directory, "core-pid_%p-_-process_%e")
+        mock_empty_crash_log = """\
+Crash log for DumpRenderTree (pid 28529):
+
+Coredump core-pid_28529-_-process_DumpRenderTree not found. To enable crash logs:
+
+- run this command as super-user: echo "%(core_pattern)s" > /proc/sys/kernel/core_pattern
+- enable core dumps: ulimit -c unlimited
+- set the WEBKIT_CORE_DUMPS_DIRECTORY environment variable: export WEBKIT_CORE_DUMPS_DIRECTORY=%(core_directory)s
+
+
+STDERR: <empty>""" % locals()
+
+        def _mock_gdb_output(coredump_path):
+            return (mock_empty_crash_log, [])
+
         port = self.make_port()
-        port._get_gdb_output = self._mock_gdb_output
+        port._get_gdb_output = mock_empty_crash_log
         log = port._get_crash_log("DumpRenderTree", 28529, "", "")
-        self.assertLinesEqual(log, self._mock_crash_log)
+        self.assertLinesEqual(log, mock_empty_crash_log)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to