From c94b4ef98f47153649e7ef019d78f80d73cf66c5 Mon Sep 17 00:00:00 2001 From: Rob Thijssen Date: Thu, 9 Nov 2017 13:20:33 +0200 Subject: [PATCH] Bug 1343049 - prevent windows theme change. r=MattN MozReview-Commit-ID: 7Udh31qLW8E --- .../unittests/win_taskcluster_unittest.py | 37 +++++++++++++++++-- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/testing/mozharness/configs/unittests/win_taskcluster_unittest.py b/testing/mozharness/configs/unittests/win_taskcluster_unittest.py index eb21ab91e6653..186508a74a2ea 100644 --- a/testing/mozharness/configs/unittests/win_taskcluster_unittest.py +++ b/testing/mozharness/configs/unittests/win_taskcluster_unittest.py @@ -1,4 +1,5 @@ import os +import platform import sys # OS Specifics @@ -9,6 +10,16 @@ EXE_SUFFIX = '.exe' DISABLE_SCREEN_SAVER = False ADJUST_MOUSE_AND_SCREEN = True +DESKTOP_VISUALFX_THEME = { + 'Let Windows choose': 0, + 'Best appearance': 1, + 'Best performance': 2, + 'Custom': 3 +}.get('Best appearance') +TASKBAR_AUTOHIDE_REG_PATH = { + 'Windows 7': 'HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2', + 'Windows 10': 'HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3' +}.get('{} {}'.format(platform.system(), platform.release())) ##### config = { "exes": { @@ -263,14 +274,34 @@ 'enabled': ADJUST_MOUSE_AND_SCREEN }, { - 'name': 'hide win 10 taskbar', + 'name': 'set windows VisualFX', 'cmd': [ 'powershell', '-command', - '"&{$p=\'HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3\';$v=(Get-ItemProperty -Path $p).Settings;$v[8]=3;&Set-ItemProperty -Path $p -Name Settings -Value $v;&Stop-Process -ProcessName explorer}"' + '"&{{&Set-ItemProperty -Path \'HKCU:Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\' -Name VisualFXSetting -Value {}}}"'.format(DESKTOP_VISUALFX_THEME) ], 'architectures': ['32bit', '64bit'], 'halt_on_failure': True, - 'enabled': os.environ.get('ProgramFiles(x86)', False) + 'enabled': True + }, + { + 'name': 'hide windows taskbar', + 'cmd': [ + 'powershell', '-command', + '"&{{$p=\'{}\';$v=(Get-ItemProperty -Path $p).Settings;$v[8]=3;&Set-ItemProperty -Path $p -Name Settings -Value $v}}"'.format(TASKBAR_AUTOHIDE_REG_PATH) + ], + 'architectures': ['32bit', '64bit'], + 'halt_on_failure': True, + 'enabled': True + }, + { + 'name': 'restart windows explorer', + 'cmd': [ + 'powershell', '-command', + '"&{&Stop-Process -ProcessName explorer}"' + ], + 'architectures': ['32bit', '64bit'], + 'halt_on_failure': True, + 'enabled': True }, ], "vcs_output_timeout": 1000,