lists.torproject.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

tbb-commits

Thread Start a new thread
Threads by month
  • ----- 2026 -----
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2021 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2020 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2019 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2018 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2017 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2016 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2015 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2014 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
tbb-commits@lists.torproject.org

March 2026

  • 1 participants
  • 116 discussions
[Git][tpo/applications/tor-browser][tor-browser-149.0a1-16.0-2] fixup! [android] Implement Android-native Connection Assist UI
by Dan Ballard (@dan) 24 Mar '26

24 Mar '26
Dan Ballard pushed to branch tor-browser-149.0a1-16.0-2 at The Tor Project / Applications / Tor Browser Commits: 220e1670 by clairehurst at 2026-03-24T15:42:28-06:00 fixup! [android] Implement Android-native Connection Assist UI - - - - - 1 changed file: - mobile/android/fenix/app/src/main/java/org/mozilla/fenix/tor/TorConnectionAssistViewModel.kt Changes: ===================================== mobile/android/fenix/app/src/main/java/org/mozilla/fenix/tor/TorConnectionAssistViewModel.kt ===================================== @@ -39,24 +39,23 @@ class TorConnectionAssistViewModel( private fun loadAndUnloadDummyPage() { viewModelScope.launch(Dispatchers.IO) { - // Load local url (it just needs to begin with "about:" to get past filter) to initialize the browser, - // Domain fronting needs Services.io.getProtocolHandler("http")... to actually work, and it - // does not till the browser/engine is initialized, and this is so far the easiest way to do that. - // Load early here so that it is ready when needed if we get to the step where DF is invoked - // Then later remove it so it doesn't show for the user - components.useCases.tabsUseCases.addTab.invoke("about:") + // Load made up local url to initialize the browser. + // Domain fronting needs Services.io.getProtocolHandler("http")... to actually work + // It does not work until the browser/engine is initialized and we found this is so far + // the easiest way to do that. + // Load early here so that it is ready when needed if we get to the step where domain + // fronting is invoked. Remove after it so it doesn't show for the user + components.useCases.tabsUseCases.addTab.invoke("about:dummyPage") // removeTabs doesn't work without a delay. Thread.sleep(500) // Remove loaded URL so it is never visible to the user components.useCases.tabsUseCases.removeTabs.invoke( components.core.store.state.tabs.filter { - it.getUrl() == "about:" || it.getUrl() == "about:blank" + it.getUrl() == "about:dummyPage" }.map { it.id }, ) - // recentlyClosedTabsStorage.value.removeAllTabs() doesn't seem to work, - // so instead we collect and iteratively remove all tabs from recent history. - // Nothing should ever show up in history so we remove everything, - // including old "about:" tabs that may have stacked up. + // Collect and iteratively remove all tabs from recent history. + // Nothing should ever show up in history so it is safe to just remove everything, components.core.recentlyClosedTabsStorage.value.getTabs() .collect { tabs: List<TabState> -> for (tab in tabs) { View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/220e167… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/220e167… You're receiving this email because of your account on gitlab.torproject.org. Manage all notifications: https://gitlab.torproject.org/-/profile/notifications | Help: https://gitlab.torproject.org/help
1 0
0 0
[Git][tpo/applications/tor-browser][tor-browser-149.0a1-16.0-2] 2 commits: fixup! [android] Modify build system
by Dan Ballard (@dan) 24 Mar '26

24 Mar '26
Dan Ballard pushed to branch tor-browser-149.0a1-16.0-2 at The Tor Project / Applications / Tor Browser Commits: 2d0e34d5 by clairehurst at 2026-03-24T14:33:48-06:00 fixup! [android] Modify build system - - - - - 6f660c9d by clairehurst at 2026-03-24T14:33:48-06:00 fixup! [android] Disable features and functionality - - - - - 4 changed files: - mobile/android/android-components/components/feature/accounts/build.gradle - mobile/android/android-components/components/feature/search/build.gradle - mobile/android/fenix/app/build.gradle - mobile/android/focus-android/app/build.gradle Changes: ===================================== mobile/android/android-components/components/feature/accounts/build.gradle ===================================== @@ -13,7 +13,7 @@ apply plugin: 'kotlin-android' android { androidResources { - ignoreAssetsPattern '!<dir>extensions' + ignoreAssetsPattern = '!<dir>extensions' } namespace = 'mozilla.components.feature.accounts' ===================================== mobile/android/android-components/components/feature/search/build.gradle ===================================== @@ -13,7 +13,7 @@ apply plugin: 'kotlin-android' android { androidResources { - ignoreAssetsPattern '!<dir>extensions:!search_telemetry_v2.json:!amazon*:!azerdict*:!baidu*:!bing*:!ceneje*:!coccoc*:!daum*:!ebay*:!ecosia*:!faclair*:!google*:!gulesider*:!leo*:!mapy*:!mercadolibre*:!odpiralni*:!pazaruvaj*:!prisjakt*:!qwant*:!rakuten*:!salidzinilv*:!seznam*:!vatera*:!wikipedia-*:!wiktionary*:!yahoo*:!yandex*' + ignoreAssetsPattern = '!<dir>extensions:!search_telemetry_v2.json:!amazon*:!azerdict*:!baidu*:!bing*:!ceneje*:!coccoc*:!daum*:!ebay*:!ecosia*:!faclair*:!google*:!gulesider*:!leo*:!mapy*:!mercadolibre*:!odpiralni*:!pazaruvaj*:!prisjakt*:!qwant*:!rakuten*:!salidzinilv*:!seznam*:!vatera*:!wikipedia-*:!wiktionary*:!yahoo*:!yandex*' } sourceSets { ===================================== mobile/android/fenix/app/build.gradle ===================================== @@ -56,17 +56,7 @@ def getBuildId() { return file("${gradle.mozconfig.topobjdir}/buildid.h").getText('utf-8').split()[2] } -def obtainTestBuildType() { - def result = "debug"; - if (project.hasProperty("testBuildType")) { - result = project.getProperties().get("testBuildType") - } - result -} - android { - testBuildType obtainTestBuildType() - project.maybeConfigForJetpackBenchmark(it) if (project.hasProperty("testBuildType")) { // Allowing to configure the test build type via command line flag (./gradlew -PtestBuildType=beta ..) @@ -325,10 +315,7 @@ android.applicationVariants.configureEach { variant -> System.setProperty("nimbusFml", gradle.mozconfig.substs.NIMBUS_FML) } - def disableTor = false - if (project.hasProperty("disableTor")) { - disableTor = project.getProperty("disableTor") - } + def disableTor = providers.gradleProperty("disableTor").getOrElse(false) project.logger.debug("----------------------------------------------") project.logger.debug("Variant name: " + variant.name) @@ -336,7 +323,7 @@ android.applicationVariants.configureEach { variant -> project.logger.debug("Build type: " + variant.buildType.name) project.logger.debug("Flavor: " + variant.flavorName) project.logger.debug("Telemetry enabled: " + !isDebugOrDCD) - project.logger.debug("nimbusFml: " + System.getProperty("nimbusFml")) + project.logger.debug("nimbusFml: " + providers.gradleProperty("nimbusFml").getOrNull()) project.logger.debug("Tor is disabled: " + disableTor) buildConfigField "boolean", "DISABLE_TOR", "$disableTor" ===================================== mobile/android/focus-android/app/build.gradle ===================================== @@ -286,7 +286,6 @@ dependencies { implementation project(':components:feature-webcompat-reporter') implementation project(':components:lib-auth') implementation project(':components:lib-crash') - implementation project(':components:lib-crash-sentry') implementation project(':components:lib-publicsuffixlist') implementation project(':components:lib-state') implementation project(":components:service-glean") @@ -337,7 +336,6 @@ dependencies { implementation libs.mozilla.glean implementation libs.play.review implementation libs.play.review.ktx - implementation libs.sentry debugImplementation libs.leakcanary View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/cf77da… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/cf77da… You're receiving this email because of your account on gitlab.torproject.org. Manage all notifications: https://gitlab.torproject.org/-/profile/notifications | Help: https://gitlab.torproject.org/help
1 0
0 0
[Git][tpo/applications/tor-browser][tor-browser-149.0a1-16.0-2] fixup! TB 40933: Add tor-launcher functionality
by clairehurst (@clairehurst) 24 Mar '26

24 Mar '26
clairehurst pushed to branch tor-browser-149.0a1-16.0-2 at The Tor Project / Applications / Tor Browser Commits: cf77da36 by clairehurst at 2026-03-24T13:25:45-06:00 fixup! TB 40933: Add tor-launcher functionality - - - - - 1 changed file: - toolkit/components/tor-launcher/TorProcessAndroid.sys.mjs Changes: ===================================== toolkit/components/tor-launcher/TorProcessAndroid.sys.mjs ===================================== @@ -99,7 +99,7 @@ export class TorProcessAndroid { type: TorOutgoingEvents.stop, handle: this.#processHandle, }); - logger.debug("Sent the start event."); + logger.debug("Sent the stop event."); this.#processHandle = null; lazy.EventDispatcher.instance.unregisterListener( this, View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/cf77da3… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/cf77da3… You're receiving this email because of your account on gitlab.torproject.org. Manage all notifications: https://gitlab.torproject.org/-/profile/notifications | Help: https://gitlab.torproject.org/help
1 0
0 0
[Git][tpo/applications/mullvad-browser][mullvad-browser-149.0a1-16.0-2] fixup! BB 44045: Disable ML features.
by henry (@henry) 24 Mar '26

24 Mar '26
henry pushed to branch mullvad-browser-149.0a1-16.0-2 at The Tor Project / Applications / Mullvad Browser Commits: ebe580ec by Henry Wilkes at 2026-03-24T18:15:45+00:00 fixup! BB 44045: Disable ML features. TB 44780: Drop AIFeature dependency for TranslationsFeature. The AIFeature.sys.mjs is not in the build. - - - - - 1 changed file: - toolkit/components/translations/TranslationsFeature.sys.mjs Changes: ===================================== toolkit/components/translations/TranslationsFeature.sys.mjs ===================================== @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -import { AIFeature } from "chrome://global/content/ml/AIFeature.sys.mjs"; +// AIFeature.sys.mjs is not available. tor-browser#44780. import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; /** @@ -45,7 +45,10 @@ XPCOMUtils.defineLazyPreferenceGetter( /** * AIFeature implementation for translations. */ -export class TranslationsFeature extends AIFeature { +// NOTE: The AIFeature class is not available. +// At the time of implementation, TranslationsFeature overwrites the entire +// AIFeature class so we can drop the `extends AIFeature`. tor-browser#44780. +export class TranslationsFeature { /** * Feature identifier for translations. * View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/ebe… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/ebe… You're receiving this email because of your account on gitlab.torproject.org. Manage all notifications: https://gitlab.torproject.org/-/profile/notifications | Help: https://gitlab.torproject.org/help
1 0
0 0
[Git][tpo/applications/tor-browser][tor-browser-149.0a1-16.0-2] fixup! BB 44045: Disable ML features.
by henry (@henry) 24 Mar '26

24 Mar '26
henry pushed to branch tor-browser-149.0a1-16.0-2 at The Tor Project / Applications / Tor Browser Commits: db4c2720 by Henry Wilkes at 2026-03-24T18:12:59+00:00 fixup! BB 44045: Disable ML features. TB 44780: Drop AIFeature dependency for TranslationsFeature. The AIFeature.sys.mjs is not in the build. - - - - - 1 changed file: - toolkit/components/translations/TranslationsFeature.sys.mjs Changes: ===================================== toolkit/components/translations/TranslationsFeature.sys.mjs ===================================== @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -import { AIFeature } from "chrome://global/content/ml/AIFeature.sys.mjs"; +// AIFeature.sys.mjs is not available. tor-browser#44780. import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs"; /** @@ -45,7 +45,10 @@ XPCOMUtils.defineLazyPreferenceGetter( /** * AIFeature implementation for translations. */ -export class TranslationsFeature extends AIFeature { +// NOTE: The AIFeature class is not available. +// At the time of implementation, TranslationsFeature overwrites the entire +// AIFeature class so we can drop the `extends AIFeature`. tor-browser#44780. +export class TranslationsFeature { /** * Feature identifier for translations. * View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/db4c272… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/db4c272… You're receiving this email because of your account on gitlab.torproject.org. Manage all notifications: https://gitlab.torproject.org/-/profile/notifications | Help: https://gitlab.torproject.org/help
1 0
0 0
[Git][tpo/applications/mullvad-browser][mullvad-browser-149.0a1-16.0-2] BB 43243 [android]: Keep processing pending inits after failure
by brizental (@brizental) 24 Mar '26

24 Mar '26
brizental pushed to branch mullvad-browser-149.0a1-16.0-2 at The Tor Project / Applications / Mullvad Browser Commits: f8742cad by Beatriz Rizental at 2026-03-24T15:04:38-03:00 BB 43243 [android]: Keep processing pending inits after failure This is in the process of being uplifted. Bug 2021618: bugzilla.mozilla.org/show_bug.cgi?id=2021618 Differential Revision: https://phabricator.services.mozilla.com/D286669 - - - - - 3 changed files: - mobile/shared/modules/geckoview/DelayedInit.sys.mjs - + mobile/shared/modules/geckoview/test/xpcshell/test_DelayedInit.js - mobile/shared/modules/geckoview/test/xpcshell/xpcshell.toml Changes: ===================================== mobile/shared/modules/geckoview/DelayedInit.sys.mjs ===================================== @@ -96,7 +96,11 @@ var Impl = { return false; } this.complete = true; - this.fn.call(); + try { + this.fn.call(); + } catch (e) { + console.error("Error running init", e); + } this.fn = null; return true; }, ===================================== mobile/shared/modules/geckoview/test/xpcshell/test_DelayedInit.js ===================================== @@ -0,0 +1,48 @@ +/* Any copyright is dedicated to the Public Domain. +http://creativecommons.org/publicdomain/zero/1.0/ */ +"use strict"; + +const { DelayedInit } = ChromeUtils.importESModule( + "resource://gre/modules/DelayedInit.sys.mjs" +); + +add_task(async function test_delayed_init_continues_queue_on_failure() { + const results = []; + const waitMs = 0; + + DelayedInit.schedule( + () => { + results.push("first"); + }, + null, + null, + waitMs + ); + + DelayedInit.schedule( + () => { + results.push("second"); + throw new Error("Deliberate error for testing"); + }, + null, + null, + waitMs + ); + + DelayedInit.schedule( + () => { + results.push("third"); + }, + null, + null, + waitMs + ); + + await new Promise(resolve => ChromeUtils.idleDispatch(resolve)); + + Assert.deepEqual( + results, + ["first", "second", "third"], + "Queue processes all inits even when one fails" + ); +}); ===================================== mobile/shared/modules/geckoview/test/xpcshell/xpcshell.toml ===================================== @@ -7,6 +7,8 @@ prefs = "browser.crashReports.onDemand=true" ["test_ChildCrashHandler.js"] +["test_DelayedInit.js"] + ["test_GeckoViewAppConstants.js"] ["test_RemoteSettingsCrashPull.js"] View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/f87… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/f87… You're receiving this email because of your account on gitlab.torproject.org. Manage all notifications: https://gitlab.torproject.org/-/profile/notifications | Help: https://gitlab.torproject.org/help
1 0
0 0
[Git][tpo/applications/mullvad-browser][mullvad-browser-149.0a1-16.0-2] 2 commits: BB 43243 [android]: Start GeckoEngineSession early when Marionette enabled
by brizental (@brizental) 24 Mar '26

24 Mar '26
brizental pushed to branch mullvad-browser-149.0a1-16.0-2 at The Tor Project / Applications / Mullvad Browser Commits: d6edcc3d by Beatriz Rizental at 2026-03-24T15:02:29-03:00 BB 43243 [android]: Start GeckoEngineSession early when Marionette enabled This is in the process of being uplifted. Bug 2021884: https://bugzilla.mozilla.org/show_bug.cgi?id=2021884 Differential Revision: https://phabricator.services.mozilla.com/D286676 - - - - - 4e336f51 by Beatriz Rizental at 2026-03-24T15:02:30-03:00 BB 43243: Modify mozharness scripts for Base Browser - - - - - 4 changed files: - mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt - testing/mozharness/configs/android/android14-x86_64.py - testing/mozharness/configs/android/android_common.py - testing/mozharness/scripts/android_emulator_unittest.py Changes: ===================================== mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt ===================================== @@ -498,6 +498,12 @@ open class FenixApplication : Application(), Provider, ThemeProvider { logElapsedTime(logger, "Starting Relay feature integration") { components.relayFeatureIntegration.start() } + + // If running Marionette tests a GeckoEngineSession needs to be + // started and that must happen on the main thread. + logElapsedTime(logger, "Maybe setup Marionette") { + maybeSetupMarionette() + } } } @@ -666,6 +672,13 @@ open class FenixApplication : Application(), Provider, ThemeProvider { FxNimbus.initialize { nimbus } } + private fun maybeSetupMarionette() { + // If Marionette is enabled, start a GeckoEngineSession immediatelly. + if (System.getenv("MOZ_MARIONETTE") == "1") { + components.core.engine.speculativeCreateSession(components.appStore.state.mode.isPrivate) + } + } + /** * Initiate Megazord sequence! Megazord Battle Mode! * ===================================== testing/mozharness/configs/android/android14-x86_64.py ===================================== @@ -11,8 +11,9 @@ config = { "emulator_avd_name": "mozemulator-android34-x86_64", "emulator_process_name": "qemu-system-x86_64", "emulator_extra_args": [ - "-gpu", - "on", + "-no-window", + "-no-audio", + "-no-boot-anim", "-skip-adb-auth", "-verbose", "-show-kernel", ===================================== testing/mozharness/configs/android/android_common.py ===================================== @@ -315,6 +315,19 @@ config = { "--deviceSerial=%(device_serial)s", ], }, + "marionette": { + "run_filename": "runtests.py", + "testsdir": "marionette/harness/marionette_harness", + "install": True, + "options": [ + "-vv", + "--address=127.0.0.1:2828", + "--app=fennec", + ], + "tests": [ + "%(abs_marionette_manifest_dir)s/unit-tests.toml", + ], + }, }, # end suite_definitions "structured_suites": [ "mochitest-media", ===================================== testing/mozharness/scripts/android_emulator_unittest.py ===================================== @@ -7,15 +7,18 @@ import copy import datetime import json import os +import socket import subprocess import sys +import tempfile +import time # load modules from parent dir here = os.path.abspath(os.path.dirname(__file__)) sys.path.insert(1, os.path.dirname(here)) from mozharness.base.log import WARNING -from mozharness.base.script import BaseScript, PreScriptAction +from mozharness.base.script import BaseScript, PostScriptAction, PreScriptAction from mozharness.mozilla.automation import TBPL_RETRY from mozharness.mozilla.mozbase import MozbaseMixin from mozharness.mozilla.testing.android import AndroidMixin @@ -26,7 +29,7 @@ from mozharness.mozilla.testing.codecoverage import ( from mozharness.mozilla.testing.testbase import TestingMixin, testing_config_options SUITE_DEFAULT_E10S = ["geckoview-junit", "mochitest", "reftest"] -SUITE_NO_E10S = ["cppunittest", "gtest", "jittest", "xpcshell"] +SUITE_NO_E10S = ["cppunittest", "gtest", "jittest", "xpcshell", "marionette"] SUITE_REPEATABLE = ["mochitest", "reftest", "xpcshell"] @@ -178,6 +181,15 @@ class AndroidEmulatorTest( "times in which case the test must contain at least one of the given tags.", }, ], + [ + ["--package-name"], + { + "action": "store", + "default": None, + "dest": "package_name", + "help": "The Android package name for the app being installed.", + }, + ], ] + copy.deepcopy(testing_config_options) + copy.deepcopy(code_coverage_config_options) @@ -228,6 +240,7 @@ class AndroidEmulatorTest( self.enable_isolated_zygote_process = c.get("enable_isolated_zygote_process") self.extra_prefs = c.get("extra_prefs") self.test_tags = c.get("test_tags") + self.package_name = c.get("package_name") or self.query_package_name() def query_abs_dirs(self): if self.abs_dirs: @@ -329,6 +342,16 @@ class AndroidEmulatorTest( "error_summary_file": error_summary_file, "xpcshell_extra": c.get("xpcshell_extra", ""), "gtest_dir": os.path.join(dirs["abs_test_install_dir"], "gtest"), + "abs_marionette_manifest_dir": os.path.join( + dirs["abs_test_install_dir"], + "marionette", + "tests", + "testing", + "marionette", + "harness", + "marionette_harness", + "tests", + ), } user_paths = self._get_mozharness_test_paths(self.test_suite) @@ -345,7 +368,7 @@ class AndroidEmulatorTest( if "%(app)" in option: # only query package name if requested - cmd.extend([option % {"app": self.query_package_name()}]) + cmd.extend([option % {"app": self.package_name}]) else: option = option % str_format_values if option: @@ -409,6 +432,7 @@ class AndroidEmulatorTest( self.config["suite_definitions"][self.test_suite].get("tests"), None, try_tests, + str_format_values=str_format_values, ) ) @@ -449,6 +473,7 @@ class AndroidEmulatorTest( }, ), ("xpcshell", {"xpcshell": "xpcshell"}), + ("marionette", {"marionette": "marionette"}), ] suites = [] for category, all_suites in all: @@ -473,6 +498,61 @@ class AndroidEmulatorTest( # in the base class, this checks for mozinstall, but we don't use it pass + def _configure_marionette_virtualenv(self, action): + dirs = self.query_abs_dirs() + requirements = os.path.join( + dirs["abs_test_install_dir"], "config", "marionette_requirements.txt" + ) + if not os.path.isfile(requirements): + self.fatal(f"Could not find marionette requirements file: {requirements}") + + self.register_virtualenv_module(requirements=[requirements]) + + def _marionette_setup(self): + adb = self.query_exe("adb") + + self.run_command([adb, "forward", "tcp:2828", "tcp:2828"]) + + with tempfile.NamedTemporaryFile(suffix=".yaml") as tmp_file: + tmp_file.write( + b"""args: +- --marionette +- --remote-allow-system-access +""" + ) + tmp_file.flush() + + remote_path = f"/data/local/tmp/{self.package_name}-geckoview-config.yaml" + self.run_command([adb, "push", tmp_file.name, remote_path]) + + self.run_command([ + adb, + "shell", + "am", + "start", + "-S", + "-W", + "-n", + f"{self.package_name}/org.mozilla.gecko.BrowserApp", + ]) + + # Wait for Marionette to be ready + for attempt in range(5): + try: + self.info( + f"Checking Marionette on 127.0.0.1:2828 (attempt {attempt + 1}/5)" + ) + socket.create_connection(("127.0.0.1", 2828), 10).close() + self.info("Marionette is reachable") + break + except OSError: + if attempt == 4: + self.fatal( + "Timed out waiting for 127.0.0.1:2828 to become reachable" + ) + self.info("Marionette not reachable yet, retrying in 10s") + time.sleep(10) + @PreScriptAction("create-virtualenv") def pre_create_virtualenv(self, action): dirs = self.query_abs_dirs() @@ -488,6 +568,9 @@ class AndroidEmulatorTest( if requirements: self.register_virtualenv_module(requirements=[requirements]) + if ("marionette", "marionette") in suites: + self._configure_marionette_virtualenv(action) + def download_and_extract(self): """ Download and extract product APK, tests.zip, and host utils. @@ -525,6 +608,9 @@ class AndroidEmulatorTest( for per_test_suite, suite in suites: self.test_suite = suite + if self.test_suite == "marionette": + self._marionette_setup() + try: cwd = self._query_tests_dir(self.test_suite) except Exception: @@ -594,6 +680,19 @@ class AndroidEmulatorTest( % (suite_category, suite, tbpl_status), ) + @PostScriptAction("run-tests") + def marionette_teardown(self, *args, **kwargs): + if ("marionette", "marionette") in self._query_suites(): + adb = self.query_exe("adb") + self.run_command([adb, "shell", "am", "force-stop", self.package_name]) + self.run_command([adb, "uninstall", self.package_name]) + self.run_command([ + adb, + "shell", + "rm", + f"/data/local/tmp/{self.package_name}-geckoview-config.yaml", + ]) + if __name__ == "__main__": test = AndroidEmulatorTest() View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/compare/43… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/compare/43… You're receiving this email because of your account on gitlab.torproject.org. Manage all notifications: https://gitlab.torproject.org/-/profile/notifications | Help: https://gitlab.torproject.org/help
1 0
0 0
[Git][tpo/applications/tor-browser][tor-browser-149.0a1-16.0-2] fixup! TB 43817: Add tests for Tor Browser
by brizental (@brizental) 24 Mar '26

24 Mar '26
brizental pushed to branch tor-browser-149.0a1-16.0-2 at The Tor Project / Applications / Tor Browser Commits: 70bab416 by Beatriz Rizental at 2026-03-24T18:49:21+01:00 fixup! TB 43817: Add tests for Tor Browser Bug 43243: Make test bootstrap UI agnostic -- share the code between Android and Desktop. - - - - - 6 changed files: - testing/marionette/harness/marionette_harness/__init__.py - testing/marionette/harness/marionette_harness/runner/__init__.py - testing/marionette/harness/marionette_harness/runner/mixins/__init__.py - + testing/marionette/harness/marionette_harness/runner/mixins/tor_browser.py - testing/tor/test_circuit_isolation.py - testing/tor/test_network_check.py Changes: ===================================== testing/marionette/harness/marionette_harness/__init__.py ===================================== @@ -28,5 +28,6 @@ from .runner import ( TestManifest, TestResult, TestResultCollection, + TorBrowserMixin, WindowManagerMixin, ) ===================================== testing/marionette/harness/marionette_harness/runner/__init__.py ===================================== @@ -13,4 +13,7 @@ from .base import ( TestResult, TestResultCollection, ) -from .mixins import WindowManagerMixin +from .mixins import ( + TorBrowserMixin, + WindowManagerMixin, +) ===================================== testing/marionette/harness/marionette_harness/runner/mixins/__init__.py ===================================== @@ -3,3 +3,4 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. from .window_manager import WindowManagerMixin +from .tor_browser import TorBrowserMixin ===================================== testing/marionette/harness/marionette_harness/runner/mixins/tor_browser.py ===================================== @@ -0,0 +1,73 @@ +from marionette_driver.errors import ScriptTimeoutException + +DEFAULT_BOOTSTRAP_TIMEOUT_MS = 60 * 1000 +DEFAULT_BOOTSTRAP_MAX_RETRIES = 3 + +class TorBrowserMixin: + def bootstrap( + self, + max_retries=DEFAULT_BOOTSTRAP_MAX_RETRIES, + ): + """Bootstrap the Tor connection. + + This doesn't fail if already bootstrapped, but will retry a few times if + a script timeout is hit. + + This function is UI-agnostic, meaning it can be used both on Desktop and Android. + """ + + attempt = 0 + while attempt < max_retries: + try: + with self.marionette.using_context("chrome"): + self.marionette.execute_async_script( + """ + const { TorConnect, TorConnectStage, TorConnectTopics } = ChromeUtils.importESModule( + "resource://gre/modules/TorConnect.sys.mjs" + ); + const [resolve] = arguments; + + // Only the first test of a suite will need to bootstrap. + if (TorConnect.stage.name === TorConnectStage.Bootstrapped) { + resolve(); + return; + } + + function waitForBootstrap() { + const topic = TorConnectTopics.BootstrapComplete; + Services.obs.addObserver(function observer() { + Services.obs.removeObserver(observer, topic); + resolve(); + }, topic); + TorConnect.beginBootstrapping(); + } + + const stageTopic = TorConnectTopics.StageChange; + function stageObserver() { + if (TorConnect.canBeginNormalBootstrap) { + Services.obs.removeObserver(stageObserver, stageTopic); + waitForBootstrap(); + } + } + Services.obs.addObserver(stageObserver, stageTopic); + stageObserver(); + """, + script_timeout=DEFAULT_BOOTSTRAP_TIMEOUT_MS, + ) + + return + except ScriptTimeoutException: + attempt += 1 + with self.marionette.using_context("chrome"): + self.marionette.execute_script( + """ + const { TorConnect } = ChromeUtils.importESModule( + "resource://gre/modules/TorConnect.sys.mjs" + ); + + TorConnect._makeStageRequest(TorConnectStage.Start, true); + """ + ) + + + raise RuntimeError("Unable to connect to Tor Network") ===================================== testing/tor/test_circuit_isolation.py ===================================== @@ -2,47 +2,13 @@ from ipaddress import ip_address from marionette_driver import By from marionette_driver.errors import NoSuchElementException -from marionette_harness import MarionetteTestCase +from marionette_harness import MarionetteTestCase, TorBrowserMixin -TOR_BOOTSTRAP_TIMEOUT = 30000 # 30s - -class TestCircuitIsolation(MarionetteTestCase): +class TestCircuitIsolation(MarionetteTestCase, TorBrowserMixin): def tearDown(self): - self.marionette.restart(in_app=False, clean=True) super().tearDown() - def bootstrap(self): - with self.marionette.using_context("chrome"): - self.marionette.execute_async_script( - """ - const { TorConnect, TorConnectTopics } = ChromeUtils.importESModule( - "resource://gre/modules/TorConnect.sys.mjs" - ); - const [resolve] = arguments; - - function waitForBootstrap() { - const topic = TorConnectTopics.BootstrapComplete; - Services.obs.addObserver(function observer() { - Services.obs.removeObserver(observer, topic); - resolve(); - }, topic); - TorConnect.beginBootstrapping(); - } - - const stageTopic = TorConnectTopics.StageChange; - function stageObserver() { - if (TorConnect.canBeginNormalBootstrap) { - Services.obs.removeObserver(stageObserver, stageTopic); - waitForBootstrap(); - } - } - Services.obs.addObserver(stageObserver, stageTopic); - stageObserver(); - """, - script_timeout=TOR_BOOTSTRAP_TIMEOUT, - ) - def extract_from_check_tpo(self): # Fetch the IP from check.torproject.org. # In addition to that, since we are loading this page, we ===================================== testing/tor/test_network_check.py ===================================== @@ -1,69 +1,11 @@ -from marionette_driver import By, Wait, errors -from marionette_driver.localization import L10n -from marionette_harness import MarionetteTestCase +from marionette_harness import MarionetteTestCase, TorBrowserMixin NETWORK_CHECK_URL = "https://check.torproject.org/" -TOR_BOOTSTRAP_TIMEOUT = 30 # 30s -STRINGS_LOCATION = "chrome://torbutton/locale/torConnect.properties" - - -class TestNetworkCheck(MarionetteTestCase): - def setUp(self): - MarionetteTestCase.setUp(self) - - self.l10n = L10n(self.marionette) - - def tearDown(self): - self.marionette.restart(in_app=False, clean=True) - super().tearDown() - - def attemptConnection(self, tries=1): - if tries > 3: - self.assertTrue(False, "Failed to connect to Tor after 3 attempts") - - connectBtn = self.marionette.find_element(By.ID, "connectButton") - Wait(self.marionette, timeout=10).until( - lambda _: connectBtn.is_displayed(), - message="Timed out waiting for tor connect button to show up.", - ) - connectBtn.click() - - try: - - def check(m): - if not m.get_url().startswith("about:torconnect"): - # We have finished connecting and have been redirected. - return True - - try: - heading = self.marionette.find_element(By.ID, "tor-connect-heading") - except errors.NoSuchElementException: - # Page is probably redirecting. - return False - - if heading.text not in [ - self.l10n.localize_property( - [STRINGS_LOCATION], "torConnect.torConnecting" - ), - self.l10n.localize_property( - [STRINGS_LOCATION], "torConnect.torConnected" - ), - ]: - raise ValueError("Tor connect page is not connecting or connected") - - return False - - Wait(self.marionette, timeout=TOR_BOOTSTRAP_TIMEOUT).until(check) - except (errors.TimeoutException, ValueError): - cancelBtn = self.marionette.find_element(By.ID, "cancelButton") - if cancelBtn.is_displayed(): - cancelBtn.click() - - self.attemptConnection(tries + 1) +class TestNetworkCheck(MarionetteTestCase, TorBrowserMixin): def test_network_check(self): - self.attemptConnection() + self.bootstrap() self.marionette.navigate(NETWORK_CHECK_URL) self.assertRegex( self.marionette.title, View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/70bab41… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/70bab41… You're receiving this email because of your account on gitlab.torproject.org. Manage all notifications: https://gitlab.torproject.org/-/profile/notifications | Help: https://gitlab.torproject.org/help
1 0
0 0
[Git][tpo/applications/mullvad-browser][mullvad-browser-149.0a1-16.0-2] 4 commits: BB 44772: Disable efficient randomization for canvases.
by Pier Angelo Vendrame (@pierov) 24 Mar '26

24 Mar '26
Pier Angelo Vendrame pushed to branch mullvad-browser-149.0a1-16.0-2 at The Tor Project / Applications / Mullvad Browser Commits: f8c9c503 by Pier Angelo Vendrame at 2026-03-24T18:49:28+01:00 BB 44772: Disable efficient randomization for canvases. Always use the regular randomization algorithm, instead. - - - - - 899e00ed by Pier Angelo Vendrame at 2026-03-24T18:49:35+01:00 fixup! BB 43525: Skip Remote Settings for search engine customization. BB 44757: Fix search engine tests for Firefox 149. - - - - - d09b8270 by Pier Angelo Vendrame at 2026-03-24T18:49:43+01:00 fixup! BB 40925: Implemented the Security Level component BB 44757: Fix search engine tests for Firefox 149. - - - - - 43a1de0d by Pier Angelo Vendrame at 2026-03-24T18:49:49+01:00 fixup! Firefox preference overrides. BB 44763: Disable WebGPU until audited. - - - - - 4 changed files: - browser/app/profile/001-base-profile.js - dom/canvas/CanvasUtils.cpp - toolkit/components/search/tests/xpcshell/test_base_browser.js - toolkit/components/search/tests/xpcshell/test_security_level.js Changes: ===================================== browser/app/profile/001-base-profile.js ===================================== @@ -492,6 +492,8 @@ pref("privacy.resistFingerprinting.skipEarlyBlankFirstPaint", true); pref("webgl.disable-fail-if-major-performance-caveat", true); // tor-browser#16404: disable until we investigate it further (#22333) pref("webgl.enable-webgl2", false); +// tor-browser#44763: disable WebGPU until audited. +pref("dom.webgpu.enabled", false); pref("browser.link.open_newwindow.restriction", 0); // Bug 9881: Open popups in new tabs (to avoid fullscreen popups) // tor-browser#42767: Disable offscreen canvas until verified it is not fingerprintable pref("gfx.offscreencanvas.enabled", false); ===================================== dom/canvas/CanvasUtils.cpp ===================================== @@ -382,14 +382,9 @@ ImageExtraction ImageExtractionResult(dom::HTMLCanvasElement* aCanvasElement, return ImageExtraction::Placeholder; } - if (ownerDoc->ShouldResistFingerprinting( - RFPTarget::EfficientCanvasRandomization) && - GetCanvasExtractDataPermission(aPrincipal) != - nsIPermissionManager::ALLOW_ACTION) { - return ImageExtraction::EfficientRandomize; - } - - if ((ownerDoc->ShouldResistFingerprinting(RFPTarget::CanvasRandomization) || + if ((ownerDoc->ShouldResistFingerprinting( + RFPTarget::EfficientCanvasRandomization) || + ownerDoc->ShouldResistFingerprinting(RFPTarget::CanvasRandomization) || ownerDoc->ShouldResistFingerprinting(RFPTarget::WebGLRandomization)) && GetCanvasExtractDataPermission(aPrincipal) != nsIPermissionManager::ALLOW_ACTION) { ===================================== toolkit/components/search/tests/xpcshell/test_base_browser.js ===================================== @@ -10,6 +10,10 @@ "use strict"; +const { SearchService } = ChromeUtils.importESModule( + "moz-src:///toolkit/components/search/SearchService.sys.mjs" +); + const expectedURLs = { ddg: "https://duckduckgo.com/?q=test", "ddg-html": "https://html.duckduckgo.com/html/?q=test", @@ -21,24 +25,23 @@ const expectedURLs = { const defaultEngine = "ddg"; add_setup(async function setup() { - await Services.search.init(); + await SearchService.init(); }); add_task(async function test_listEngines() { - const { engines } = - await Services.search.wrappedJSObject._fetchEngineSelectorEngines(); + const { engines } = await SearchService._fetchEngineSelectorEngines(); const foundIdentifiers = engines.map(e => e.identifier); Assert.deepEqual(foundIdentifiers, Object.keys(expectedURLs)); }); add_task(async function test_default() { Assert.equal( - (await Services.search.getDefault()).id, + (await SearchService.getDefault()).id, defaultEngine, `${defaultEngine} is our default search engine in normal mode.` ); Assert.equal( - (await Services.search.getDefaultPrivate()).id, + (await SearchService.getDefaultPrivate()).id, defaultEngine, `${defaultEngine} is our default search engine in PBM.` ); @@ -46,7 +49,7 @@ add_task(async function test_default() { add_task(function test_checkSearchURLs() { for (const [id, url] of Object.entries(expectedURLs)) { - const engine = Services.search.getEngineById(id); + const engine = SearchService.getEngineById(id); const foundUrl = engine.getSubmission("test").uri.spec; Assert.equal(foundUrl, url, `The URL of ${engine.name} is not altered.`); } @@ -54,7 +57,7 @@ add_task(function test_checkSearchURLs() { add_task(async function test_iconsDoesNotFail() { for (const id of Object.keys(expectedURLs)) { - const engine = Services.search.getEngineById(id); + const engine = SearchService.getEngineById(id); // No need to assert anything, as in case of error this method should throw. await engine.getIconURL(); } ===================================== toolkit/components/search/tests/xpcshell/test_security_level.js ===================================== @@ -8,14 +8,18 @@ "use strict"; +const { SearchService } = ChromeUtils.importESModule( + "moz-src:///toolkit/components/search/SearchService.sys.mjs" +); + const expectedURLs = { ddg: "https://html.duckduckgo.com/html?q=test", }; add_task(async function test_securityLevel() { - await Services.search.init(); + await SearchService.init(); for (const [id, url] of Object.entries(expectedURLs)) { - const engine = Services.search.getEngineById(id); + const engine = SearchService.getEngineById(id); const foundUrl = engine.getSubmission("test").uri.spec; Assert.equal(foundUrl, url, `${engine.name} is in HTML mode.`); } View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/compare/1d… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/compare/1d… You're receiving this email because of your account on gitlab.torproject.org. Manage all notifications: https://gitlab.torproject.org/-/profile/notifications | Help: https://gitlab.torproject.org/help
1 0
0 0
[Git][tpo/applications/tor-browser][tor-browser-149.0a1-16.0-2] 3 commits: BB 43243 [android]: Keep processing pending inits after failure
by brizental (@brizental) 24 Mar '26

24 Mar '26
brizental pushed to branch tor-browser-149.0a1-16.0-2 at The Tor Project / Applications / Tor Browser Commits: 863fc44a by Beatriz Rizental at 2026-03-24T14:25:12-03:00 BB 43243 [android]: Keep processing pending inits after failure This is in the process of being uplifted. Bug 2021618: bugzilla.mozilla.org/show_bug.cgi?id=2021618 Differential Revision: https://phabricator.services.mozilla.com/D286669 - - - - - 33b1e93e by Beatriz Rizental at 2026-03-24T14:25:12-03:00 BB 43243 [android]: Start GeckoEngineSession early when Marionette enabled This is in the process of being uplifted. Bug 2021884: https://bugzilla.mozilla.org/show_bug.cgi?id=2021884 Differential Revision: https://phabricator.services.mozilla.com/D286676 - - - - - 24ce6582 by Beatriz Rizental at 2026-03-24T14:25:13-03:00 BB 43243: Modify mozharness scripts for Base Browser - - - - - 7 changed files: - mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt - mobile/shared/modules/geckoview/DelayedInit.sys.mjs - + mobile/shared/modules/geckoview/test/xpcshell/test_DelayedInit.js - mobile/shared/modules/geckoview/test/xpcshell/xpcshell.toml - testing/mozharness/configs/android/android14-x86_64.py - testing/mozharness/configs/android/android_common.py - testing/mozharness/scripts/android_emulator_unittest.py Changes: ===================================== mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt ===================================== @@ -507,6 +507,12 @@ open class FenixApplication : Application(), Provider, ThemeProvider { logElapsedTime(logger, "Starting Relay feature integration") { components.relayFeatureIntegration.start() } + + // If running Marionette tests a GeckoEngineSession needs to be + // started and that must happen on the main thread. + logElapsedTime(logger, "Maybe setup Marionette") { + maybeSetupMarionette() + } } } @@ -675,6 +681,13 @@ open class FenixApplication : Application(), Provider, ThemeProvider { FxNimbus.initialize { nimbus } } + private fun maybeSetupMarionette() { + // If Marionette is enabled, start a GeckoEngineSession immediatelly. + if (System.getenv("MOZ_MARIONETTE") == "1") { + components.core.engine.speculativeCreateSession(components.appStore.state.mode.isPrivate) + } + } + /** * Initiate Megazord sequence! Megazord Battle Mode! * ===================================== mobile/shared/modules/geckoview/DelayedInit.sys.mjs ===================================== @@ -96,7 +96,11 @@ var Impl = { return false; } this.complete = true; - this.fn.call(); + try { + this.fn.call(); + } catch (e) { + console.error("Error running init", e); + } this.fn = null; return true; }, ===================================== mobile/shared/modules/geckoview/test/xpcshell/test_DelayedInit.js ===================================== @@ -0,0 +1,48 @@ +/* Any copyright is dedicated to the Public Domain. +http://creativecommons.org/publicdomain/zero/1.0/ */ +"use strict"; + +const { DelayedInit } = ChromeUtils.importESModule( + "resource://gre/modules/DelayedInit.sys.mjs" +); + +add_task(async function test_delayed_init_continues_queue_on_failure() { + const results = []; + const waitMs = 0; + + DelayedInit.schedule( + () => { + results.push("first"); + }, + null, + null, + waitMs + ); + + DelayedInit.schedule( + () => { + results.push("second"); + throw new Error("Deliberate error for testing"); + }, + null, + null, + waitMs + ); + + DelayedInit.schedule( + () => { + results.push("third"); + }, + null, + null, + waitMs + ); + + await new Promise(resolve => ChromeUtils.idleDispatch(resolve)); + + Assert.deepEqual( + results, + ["first", "second", "third"], + "Queue processes all inits even when one fails" + ); +}); ===================================== mobile/shared/modules/geckoview/test/xpcshell/xpcshell.toml ===================================== @@ -7,6 +7,8 @@ prefs = "browser.crashReports.onDemand=true" ["test_ChildCrashHandler.js"] +["test_DelayedInit.js"] + ["test_GeckoViewAppConstants.js"] ["test_RemoteSettingsCrashPull.js"] ===================================== testing/mozharness/configs/android/android14-x86_64.py ===================================== @@ -11,8 +11,9 @@ config = { "emulator_avd_name": "mozemulator-android34-x86_64", "emulator_process_name": "qemu-system-x86_64", "emulator_extra_args": [ - "-gpu", - "on", + "-no-window", + "-no-audio", + "-no-boot-anim", "-skip-adb-auth", "-verbose", "-show-kernel", ===================================== testing/mozharness/configs/android/android_common.py ===================================== @@ -315,6 +315,19 @@ config = { "--deviceSerial=%(device_serial)s", ], }, + "marionette": { + "run_filename": "runtests.py", + "testsdir": "marionette/harness/marionette_harness", + "install": True, + "options": [ + "-vv", + "--address=127.0.0.1:2828", + "--app=fennec", + ], + "tests": [ + "%(abs_marionette_manifest_dir)s/unit-tests.toml", + ], + }, }, # end suite_definitions "structured_suites": [ "mochitest-media", ===================================== testing/mozharness/scripts/android_emulator_unittest.py ===================================== @@ -7,15 +7,18 @@ import copy import datetime import json import os +import socket import subprocess import sys +import tempfile +import time # load modules from parent dir here = os.path.abspath(os.path.dirname(__file__)) sys.path.insert(1, os.path.dirname(here)) from mozharness.base.log import WARNING -from mozharness.base.script import BaseScript, PreScriptAction +from mozharness.base.script import BaseScript, PostScriptAction, PreScriptAction from mozharness.mozilla.automation import TBPL_RETRY from mozharness.mozilla.mozbase import MozbaseMixin from mozharness.mozilla.testing.android import AndroidMixin @@ -26,7 +29,7 @@ from mozharness.mozilla.testing.codecoverage import ( from mozharness.mozilla.testing.testbase import TestingMixin, testing_config_options SUITE_DEFAULT_E10S = ["geckoview-junit", "mochitest", "reftest"] -SUITE_NO_E10S = ["cppunittest", "gtest", "jittest", "xpcshell"] +SUITE_NO_E10S = ["cppunittest", "gtest", "jittest", "xpcshell", "marionette"] SUITE_REPEATABLE = ["mochitest", "reftest", "xpcshell"] @@ -178,6 +181,15 @@ class AndroidEmulatorTest( "times in which case the test must contain at least one of the given tags.", }, ], + [ + ["--package-name"], + { + "action": "store", + "default": None, + "dest": "package_name", + "help": "The Android package name for the app being installed.", + }, + ], ] + copy.deepcopy(testing_config_options) + copy.deepcopy(code_coverage_config_options) @@ -228,6 +240,7 @@ class AndroidEmulatorTest( self.enable_isolated_zygote_process = c.get("enable_isolated_zygote_process") self.extra_prefs = c.get("extra_prefs") self.test_tags = c.get("test_tags") + self.package_name = c.get("package_name") or self.query_package_name() def query_abs_dirs(self): if self.abs_dirs: @@ -329,6 +342,16 @@ class AndroidEmulatorTest( "error_summary_file": error_summary_file, "xpcshell_extra": c.get("xpcshell_extra", ""), "gtest_dir": os.path.join(dirs["abs_test_install_dir"], "gtest"), + "abs_marionette_manifest_dir": os.path.join( + dirs["abs_test_install_dir"], + "marionette", + "tests", + "testing", + "marionette", + "harness", + "marionette_harness", + "tests", + ), } user_paths = self._get_mozharness_test_paths(self.test_suite) @@ -345,7 +368,7 @@ class AndroidEmulatorTest( if "%(app)" in option: # only query package name if requested - cmd.extend([option % {"app": self.query_package_name()}]) + cmd.extend([option % {"app": self.package_name}]) else: option = option % str_format_values if option: @@ -409,6 +432,7 @@ class AndroidEmulatorTest( self.config["suite_definitions"][self.test_suite].get("tests"), None, try_tests, + str_format_values=str_format_values, ) ) @@ -449,6 +473,7 @@ class AndroidEmulatorTest( }, ), ("xpcshell", {"xpcshell": "xpcshell"}), + ("marionette", {"marionette": "marionette"}), ] suites = [] for category, all_suites in all: @@ -473,6 +498,61 @@ class AndroidEmulatorTest( # in the base class, this checks for mozinstall, but we don't use it pass + def _configure_marionette_virtualenv(self, action): + dirs = self.query_abs_dirs() + requirements = os.path.join( + dirs["abs_test_install_dir"], "config", "marionette_requirements.txt" + ) + if not os.path.isfile(requirements): + self.fatal(f"Could not find marionette requirements file: {requirements}") + + self.register_virtualenv_module(requirements=[requirements]) + + def _marionette_setup(self): + adb = self.query_exe("adb") + + self.run_command([adb, "forward", "tcp:2828", "tcp:2828"]) + + with tempfile.NamedTemporaryFile(suffix=".yaml") as tmp_file: + tmp_file.write( + b"""args: +- --marionette +- --remote-allow-system-access +""" + ) + tmp_file.flush() + + remote_path = f"/data/local/tmp/{self.package_name}-geckoview-config.yaml" + self.run_command([adb, "push", tmp_file.name, remote_path]) + + self.run_command([ + adb, + "shell", + "am", + "start", + "-S", + "-W", + "-n", + f"{self.package_name}/org.mozilla.gecko.BrowserApp", + ]) + + # Wait for Marionette to be ready + for attempt in range(5): + try: + self.info( + f"Checking Marionette on 127.0.0.1:2828 (attempt {attempt + 1}/5)" + ) + socket.create_connection(("127.0.0.1", 2828), 10).close() + self.info("Marionette is reachable") + break + except OSError: + if attempt == 4: + self.fatal( + "Timed out waiting for 127.0.0.1:2828 to become reachable" + ) + self.info("Marionette not reachable yet, retrying in 10s") + time.sleep(10) + @PreScriptAction("create-virtualenv") def pre_create_virtualenv(self, action): dirs = self.query_abs_dirs() @@ -488,6 +568,9 @@ class AndroidEmulatorTest( if requirements: self.register_virtualenv_module(requirements=[requirements]) + if ("marionette", "marionette") in suites: + self._configure_marionette_virtualenv(action) + def download_and_extract(self): """ Download and extract product APK, tests.zip, and host utils. @@ -525,6 +608,9 @@ class AndroidEmulatorTest( for per_test_suite, suite in suites: self.test_suite = suite + if self.test_suite == "marionette": + self._marionette_setup() + try: cwd = self._query_tests_dir(self.test_suite) except Exception: @@ -594,6 +680,19 @@ class AndroidEmulatorTest( % (suite_category, suite, tbpl_status), ) + @PostScriptAction("run-tests") + def marionette_teardown(self, *args, **kwargs): + if ("marionette", "marionette") in self._query_suites(): + adb = self.query_exe("adb") + self.run_command([adb, "shell", "am", "force-stop", self.package_name]) + self.run_command([adb, "uninstall", self.package_name]) + self.run_command([ + adb, + "shell", + "rm", + f"/data/local/tmp/{self.package_name}-geckoview-config.yaml", + ]) + if __name__ == "__main__": test = AndroidEmulatorTest() View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/dd7562… -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/dd7562… You're receiving this email because of your account on gitlab.torproject.org. Manage all notifications: https://gitlab.torproject.org/-/profile/notifications | Help: https://gitlab.torproject.org/help
1 0
0 0
  • ← Newer
  • 1
  • 2
  • 3
  • 4
  • ...
  • 12
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.