Back out local changes to Alex's Subversion working directory
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Mar 2019 12:56:32 +0000 (12:56 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Mar 2019 12:56:32 +0000 (12:56 +0000)
They were accidentally committed.

* Scripts/webkitpy/common/system/abstractexecutive.py:
(AbstractExecutive.wait_newest):
* Scripts/webkitpy/common/system/executive.py:
(Executive.running_pids):
* Scripts/webkitpy/common/system/executive_mock.py:
(MockExecutive.running_pids):
* Scripts/webkitpy/common/system/executive_unittest.py:
(ExecutiveTest.serial_test_running_pids):
* Scripts/webkitpy/port/darwin.py:
(DarwinPort.check_for_leaks):
* Scripts/webkitpy/port/leakdetector.py:
(LeakDetector.check_for_leaks):
- This was the hack attached to Bug 193772.

* WebKitTestRunner/mac/WebKitTestRunnerEvent.mm:
(+[WebKitTestRunnerEvent mouseLocation]):
- This works around a crash on an internal build.

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

Tools/ChangeLog
Tools/Scripts/webkitpy/common/system/abstractexecutive.py
Tools/Scripts/webkitpy/common/system/executive.py
Tools/Scripts/webkitpy/common/system/executive_mock.py
Tools/Scripts/webkitpy/common/system/executive_unittest.py
Tools/Scripts/webkitpy/port/darwin.py
Tools/Scripts/webkitpy/port/leakdetector.py
Tools/WebKitTestRunner/mac/WebKitTestRunnerEvent.mm

index ed32ce5..a209a3d 100644 (file)
@@ -1,3 +1,27 @@
+2019-03-22  David Kilzer  <ddkilzer@apple.com>
+
+        Back out local changes to Alex's Subversion working directory
+
+        They were accidentally committed.
+
+        * Scripts/webkitpy/common/system/abstractexecutive.py:
+        (AbstractExecutive.wait_newest):
+        * Scripts/webkitpy/common/system/executive.py:
+        (Executive.running_pids):
+        * Scripts/webkitpy/common/system/executive_mock.py:
+        (MockExecutive.running_pids):
+        * Scripts/webkitpy/common/system/executive_unittest.py:
+        (ExecutiveTest.serial_test_running_pids):
+        * Scripts/webkitpy/port/darwin.py:
+        (DarwinPort.check_for_leaks):
+        * Scripts/webkitpy/port/leakdetector.py:
+        (LeakDetector.check_for_leaks):
+        - This was the hack attached to Bug 193772.
+
+        * WebKitTestRunner/mac/WebKitTestRunnerEvent.mm:
+        (+[WebKitTestRunnerEvent mouseLocation]):
+        - This works around a crash on an internal build.
+
 2019-03-22  Tim Horton  <timothy_horton@apple.com>
 
         Fix the build after r243354
index f5600f6..ec6604e 100644 (file)
@@ -74,7 +74,7 @@ class AbstractExecutive(object):
         if not process_name_filter:
             process_name_filter = lambda process_name: True
 
-        running_pids, undef = self.running_pids(process_name_filter)
+        running_pids = self.running_pids(process_name_filter)
         if not running_pids:
             return
         pid = running_pids[-1]
index 07ade58..77cbce8 100644 (file)
@@ -268,13 +268,12 @@ class Executive(AbstractExecutive):
     def running_pids(self, process_name_filter=None):
         if self._is_native_win:
             # FIXME: running_pids isn't implemented on native Windows yet...
-            return [], []
+            return []
 
         if not process_name_filter:
             process_name_filter = lambda process_name: True
 
         running_pids = []
-        running_names = []
         if self._is_cygwin:
             ps_process = self.run_command(['ps', '-e'], ignore_errors=True)
             for line in ps_process.splitlines():
@@ -283,7 +282,6 @@ class Executive(AbstractExecutive):
                     pid, ppid, pgid, winpid, tty, uid, stime, process_name = tokens
                     if process_name_filter(process_name):
                         running_pids.append(int(pid))
-                        running_names.append(os.path.basename(process_name))
                         self.pid_to_system_pid[int(pid)] = int(winpid)
                 except ValueError as e:
                     pass
@@ -297,11 +295,10 @@ class Executive(AbstractExecutive):
                     pid, process_name = line.strip().split(' ', 1)
                     if process_name_filter(process_name):
                         running_pids.append(int(pid))
-                        running_names.append(os.path.basename(process_name))
                 except ValueError as e:
                     pass
 
-        return running_pids, running_names
+        return sorted(running_pids)
 
     def _windows_image_name(self, process_name):
         name, extension = os.path.splitext(process_name)
index d6d5db8..dc063ad 100644 (file)
@@ -82,15 +82,12 @@ class MockExecutive(object):
 
     def running_pids(self, process_name_filter):
         running_pids = []
-        running_names = []
         for process_name, process_pid in self._running_pids.iteritems():
             if process_name_filter(process_name):
                 running_pids.append(process_pid)
-                running_names.append(process_name)
 
         _log.info("MOCK running_pids: %s" % running_pids)
-        _log.info("MOCK running_names: %s" % running_names)
-        return running_pids, running_names
+        return running_pids
 
     def run_and_throw_if_fail(self, args, quiet=False, cwd=None, env=None):
         if self._should_log:
index 30cded6..78900e7 100644 (file)
@@ -231,9 +231,8 @@ class ExecutiveTest(unittest.TestCase):
             return  # This function isn't implemented on Windows yet.
 
         executive = Executive()
-        pids, names = executive.running_pids()
+        pids = executive.running_pids()
         self.assertIn(os.getpid(), pids)
-        self.assertIn(os.path.basename(sys.executable), names)
 
     def serial_test_run_in_parallel(self):
         # We run this test serially to avoid overloading the machine and throwing off the timing.
index 7fa7096..e989465 100644 (file)
@@ -22,7 +22,6 @@
 
 import logging
 import os
-import re
 import time
 
 from webkitpy.common.memoized import memoized
@@ -61,16 +60,7 @@ class DarwinPort(ApplePort):
         if not self.get_option('leaks'):
             return
         # We could use http://code.google.com/p/psutil/ to get the process_name from the pid.
-        if self.get_option('webkit_test_runner'):
-            # FIXME: This assumes no other processes spawning WebKit2 processes are running.
-            webkit_process_re = re.compile('.*/com\.apple\.WebKit\.\S+\.Development$')
-            process_name_filter = lambda process_name: re.match(webkit_process_re, process_name)
-            process_ids, process_names = self._executive.running_pids(process_name_filter) or []
-            process_ids.insert(0, process_pid)
-            process_names.insert(0, process_name)
-            self._leak_detector.check_for_leaks(process_names, process_ids)
-        else:
-            self._leak_detector.check_for_leaks(process_name, process_pid)
+        self._leak_detector.check_for_leaks(process_name, process_pid)
 
     def print_leaks_summary(self):
         if not self.get_option('leaks'):
index a1ec21c..d07e095 100644 (file)
@@ -118,19 +118,14 @@ class LeakDetector(object):
 
     def check_for_leaks(self, process_name, process_pid):
         _log.debug("Checking for leaks in %s" % process_name)
-        pids = process_pid if isinstance(process_pid, list) else [process_pid]
-        names = process_name if isinstance(process_name, list) else [process_name]
         try:
-            for i in range(len(pids)):
-                pid = pids[i]
-                name = names[i]
-                leaks_filename = self.leaks_file_name(name, pid)
-                leaks_output_path = self._filesystem.join(self._port.results_directory(), leaks_filename)
-                # Oddly enough, run-leaks (or the underlying leaks tool) does not seem to always output utf-8,
-                # thus we pass decode_output=False.  Without this code we've seen errors like:
-                # "UnicodeDecodeError: 'utf8' codec can't decode byte 0x88 in position 779874: unexpected code byte"
-                self._port._run_script("run-leaks", self._leaks_args(name, pid), include_configuration_arguments=False, decode_output=False)
-                leaks_output = self._filesystem.read_binary_file(leaks_output_path)
+            leaks_filename = self.leaks_file_name(process_name, process_pid)
+            leaks_output_path = self._filesystem.join(self._port.results_directory(), leaks_filename)
+            # Oddly enough, run-leaks (or the underlying leaks tool) does not seem to always output utf-8,
+            # thus we pass decode_output=False.  Without this code we've seen errors like:
+            # "UnicodeDecodeError: 'utf8' codec can't decode byte 0x88 in position 779874: unexpected code byte"
+            self._port._run_script("run-leaks", self._leaks_args(process_name, process_pid), include_configuration_arguments=False, decode_output=False)
+            leaks_output = self._filesystem.read_binary_file(leaks_output_path)
         except ScriptError as e:
             _log.warn("Failed to run leaks tool: %s" % e.message_with_output())
             return
index 3197f62..f547fd1 100644 (file)
 
 + (NSPoint)mouseLocation
 {
-    return NSMakePoint(0, 0);
-    /*
     WKPoint location = WTR::TestController::singleton().eventSenderProxy()->position();
     return [WTR::TestController::singleton().mainWebView()->platformWindow() convertBaseToScreen:NSMakePoint(location.x, location.y)];
-     */
 }
 
 @end