Bug 1528061 - wptrunner sends non-blocking message when handling fonts on Windows. r=jgraham
authorBryce Van Dyk <bvandyk@mozilla.com>
Wed, 10 Jul 2019 23:30:23 +0000
changeset 482425 cde6d92a2230097c57233c6fa215e746ea672c0e
parent 482424 e7ef34268d70cdb01144cca7a914fb9de81fd6f3
child 482426 f3804754bb797a83bf80b8b30ae8821bf37aa782
push id36282
push userdvarga@mozilla.com
push dateFri, 12 Jul 2019 09:56:21 +0000
treeherdermozilla-central@cb2d564879e3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgraham
bugs1528061
milestone70.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1528061 - wptrunner sends non-blocking message when handling fonts on Windows. r=jgraham This changes the wptrunner to use SendNotifyMessageW instead of SendMessageW when installing and removing fonts on Windows. The difference between these calls is that SendNotifyMessageW will not block on each window processing the message while SendMessageW will. This addresses an issue where the wptrunner would stall if a window was not processing the font added or removed message. Differential Revision: https://phabricator.services.mozilla.com/D37617
testing/web-platform/tests/tools/wptrunner/wptrunner/font.py
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/font.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/font.py
@@ -90,21 +90,21 @@ class FontInstaller(object):
         hwnd_broadcast = 0xFFFF
         wm_fontchange = 0x001D
 
         gdi32 = ctypes.WinDLL('gdi32')
         if gdi32.AddFontResourceW(font_path):
             from ctypes import wintypes
             wparam = 0
             lparam = 0
-            SendMessageW = ctypes.windll.user32.SendMessageW
-            SendMessageW.argtypes = [wintypes.HANDLE, wintypes.UINT,
-                                     wintypes.WPARAM, wintypes.LPARAM]
-            return bool(SendMessageW(hwnd_broadcast, wm_fontchange,
-                                     wparam, lparam))
+            SendNotifyMessageW = ctypes.windll.user32.SendNotifyMessageW
+            SendNotifyMessageW.argtypes = [wintypes.HANDLE, wintypes.UINT,
+                                           wintypes.WPARAM, wintypes.LPARAM]
+            return bool(SendNotifyMessageW(hwnd_broadcast, wm_fontchange,
+                                           wparam, lparam))
 
     def remove_linux_font(self, font_name, _):
         if self.created_dir:
             rmtree(self.font_dir)
         else:
             os.remove('%s/%s' % (self.font_dir, font_name))
         try:
             fc_cache_returncode = call('fc-cache')
@@ -124,13 +124,13 @@ class FontInstaller(object):
         hwnd_broadcast = 0xFFFF
         wm_fontchange = 0x001D
 
         gdi32 = ctypes.WinDLL('gdi32')
         if gdi32.RemoveFontResourceW(font_path):
             from ctypes import wintypes
             wparam = 0
             lparam = 0
-            SendMessageW = ctypes.windll.user32.SendMessageW
-            SendMessageW.argtypes = [wintypes.HANDLE, wintypes.UINT,
-                                     wintypes.WPARAM, wintypes.LPARAM]
-            return bool(SendMessageW(hwnd_broadcast, wm_fontchange,
-                                     wparam, lparam))
+            SendNotifyMessageW = ctypes.windll.user32.SendNotifyMessageW
+            SendNotifyMessageW.argtypes = [wintypes.HANDLE, wintypes.UINT,
+                                           wintypes.WPARAM, wintypes.LPARAM]
+            return bool(SendNotifyMessageW(hwnd_broadcast, wm_fontchange,
+                                           wparam, lparam))