If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Support changing the Windows system theme (e.g. to high contrast mode) in mozscreenshots for automation



a year ago
3 months ago


(Reporter: MattN, Unassigned)



Firefox Tracking Flags

(firefox51 affected)


mozscreenshots has support for changing the system theme in the SystemTheme.jsm configuration[1] on Windows but it wasn't checked in to mozilla-central since we need to ensure we never leave the machine in a non-default theme for any reason or we will end up causing failures for other test suites run later on that machine (e.g. reftests). We also don't want to leave the display properties window open as that may interfere with future screenshots.

If we can ensure that we won't leave the machines in an undesired state, it should be as simple as adding SystemTheme.jsm to /browser/tools/mozscreenshots/mozscreenshots/extension/configurations/ (possibly updating it for Win10) and adding the .bat[2] and .vbs[3] dependencies to /browser/tools/mozscreenshots/mozscreenshots/extension/lib/. All the code could likely use some cleanup as it wasn't written for m-c standards initially.

Some ideas to ensure we revert to the original theme:
a) Use SimpleTest.registerCleanupFunction to revert the theme
** I'm not sure how reliable the theme changing code is since changing back to the original theme is going to be just as unreliable as changing themes in the first place. Changing Windows themes relies on various OS APIs/registry keys that may be fragile and poorly documented.
b) Have a way to indicated to automation that the machine/account should be reset to a fresh state.
** For example, output something in the log which triggers a re-imaging. I think we had something like this before to indicate a reboot was needed.
** Perhaps this is easier with TaskCluster (TC) but the screenshot jobs don't run on TC yet.

[1] https://github.com/mnoorenberghe/mozscreenshots/blob/master/mozscreenshots/extension/configurations/SystemTheme.jsm
[2] https://github.com/mnoorenberghe/mozscreenshots/blob/master/mozscreenshots/extension/lib/ChangeWindowsTheme.bat
[3] https://github.com/mnoorenberghe/mozscreenshots/blob/master/mozscreenshots/extension/lib/CloseDisplayProperties.vbs
Component: General → mozscreenshots
Product: Firefox → Testing
Version: Trunk → unspecified
You need to log in before you can comment on or make changes to this bug.