tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

windows_taskcluster_config.py (5390B)


      1 # This Source Code Form is subject to the terms of the Mozilla Public
      2 # License, v. 2.0. If a copy of the MPL was not distributed with this
      3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
      4 
      5 # This is a template config file for marionette production on Windows.
      6 import os
      7 import platform
      8 import sys
      9 
     10 # OS Specifics
     11 DISABLE_SCREEN_SAVER = False
     12 ADJUST_MOUSE_AND_SCREEN = True
     13 DESKTOP_VISUALFX_THEME = {
     14    "Let Windows choose": 0,
     15    "Best appearance": 1,
     16    "Best performance": 2,
     17    "Custom": 3,
     18 }.get("Best appearance")
     19 TASKBAR_AUTOHIDE_REG_PATH = {
     20    "Windows 7": r"HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2",
     21    "Windows 10": r"HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3",
     22 }.get(f"{platform.system()} {platform.release()}")
     23 
     24 #####
     25 config = {
     26    # marionette options
     27    "marionette_address": "localhost:2828",
     28    "test_manifest": "unit-tests.toml",
     29    "virtualenv_path": "venv",
     30    "exes": {
     31        "python": sys.executable,
     32        "hg": os.path.join(os.environ["PROGRAMFILES"], "Mercurial", "hg"),
     33    },
     34    "default_actions": [
     35        "clobber",
     36        "download-and-extract",
     37        "create-virtualenv",
     38        "install",
     39        "run-tests",
     40    ],
     41    "suite_definitions": {
     42        "marionette_desktop": {
     43            "options": [
     44                "-vv",
     45                "--log-errorsummary=%(error_summary_file)s",
     46                "--log-html=%(html_report_file)s",
     47                "--binary=%(binary)s",
     48                "--address=%(address)s",
     49                "--symbols-path=%(symbols_path)s",
     50            ],
     51            "run_filename": "",
     52            "testsdir": "marionette",
     53        },
     54        "unittest_desktop": {
     55            "options": [
     56                "-vv",
     57                "--log-errorsummary=%(error_summary_file)s",
     58                "--log-html=%(html_report_file)s",
     59                "--binary=%(binary)s",
     60                "--address=%(address)s",
     61                "--symbols-path=%(symbols_path)s",
     62            ],
     63            "run_filename": "",
     64            "testsdir": "marionette",
     65        },
     66    },
     67    "run_cmd_checks_enabled": True,
     68    "preflight_run_cmd_suites": [
     69        {
     70            "name": "disable_screen_saver",
     71            "cmd": ["xset", "s", "off", "s", "reset"],
     72            "architectures": ["32bit", "64bit"],
     73            "halt_on_failure": False,
     74            "enabled": DISABLE_SCREEN_SAVER,
     75        },
     76        {
     77            "name": "run mouse & screen adjustment script",
     78            "cmd": [
     79                sys.executable,
     80                os.path.join(
     81                    os.getcwd(),
     82                    "mozharness",
     83                    "external_tools",
     84                    "mouse_and_screen_resolution.py",
     85                ),
     86                "--configuration-file",
     87                os.path.join(
     88                    os.getcwd(),
     89                    "mozharness",
     90                    "external_tools",
     91                    "machine-configuration.json",
     92                ),
     93            ],
     94            "architectures": ["32bit", "64bit"],
     95            "halt_on_failure": True,
     96            "enabled": ADJUST_MOUSE_AND_SCREEN,
     97        },
     98        {
     99            "name": "disable windows security and maintenance notifications",
    100            "cmd": [
    101                "powershell",
    102                "-command",
    103                r"\"&{$p='HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.SecurityAndMaintenance';if(!(Test-Path -Path $p)){&New-Item -Path $p -Force}&Set-ItemProperty -Path $p -Name Enabled -Value 0}\"",  # noqa
    104            ],
    105            "architectures": ["32bit", "64bit"],
    106            "halt_on_failure": True,
    107            "enabled": (platform.release() == 10),
    108        },
    109        {
    110            "name": "set windows VisualFX",
    111            "cmd": [
    112                "powershell",
    113                "-command",
    114                f"\"&{{&Set-ItemProperty -Path 'HKCU:Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\VisualEffects' -Name VisualFXSetting -Value {DESKTOP_VISUALFX_THEME}}}\"",
    115            ],
    116            "architectures": ["32bit", "64bit"],
    117            "halt_on_failure": True,
    118            "enabled": True,
    119        },
    120        {
    121            "name": "create scrollbars always show key",
    122            "cmd": [
    123                "powershell",
    124                "-command",
    125                r"New-ItemProperty -Path 'HKCU:\Control Panel\Accessibility' -Name 'DynamicScrollbars' -Value 0",
    126            ],
    127            "architectures": ["32bit", "64bit"],
    128            "halt_on_failure": False,
    129            "enabled": True,
    130        },
    131        {
    132            "name": "hide windows taskbar",
    133            "cmd": [
    134                "powershell",
    135                "-command",
    136                f"\"&{{$p='{TASKBAR_AUTOHIDE_REG_PATH}';$v=(Get-ItemProperty -Path $p).Settings;$v[8]=3;&Set-ItemProperty -Path $p -Name Settings -Value $v}}\"",
    137            ],
    138            "architectures": ["32bit", "64bit"],
    139            "halt_on_failure": True,
    140            "enabled": True,
    141        },
    142        {
    143            "name": "restart windows explorer",
    144            "cmd": [
    145                "powershell",
    146                "-command",
    147                '"&{&Stop-Process -ProcessName explorer}"',
    148            ],
    149            "architectures": ["32bit", "64bit"],
    150            "halt_on_failure": True,
    151            "enabled": True,
    152        },
    153    ],
    154 }