diff --git a/testing/mozharness/configs/raptor/android_hw_config.py b/testing/mozharness/configs/raptor/android_hw_config.py index 81118b497b6c..ff5a0e90d199 100644 --- a/testing/mozharness/configs/raptor/android_hw_config.py +++ b/testing/mozharness/configs/raptor/android_hw_config.py @@ -13,6 +13,7 @@ config = { "populate-webroot", "create-virtualenv", "install-chrome-android", + "install-chromium-android", "install-chromium-distribution", "install", "run-tests", diff --git a/testing/mozharness/configs/raptor/android_hw_external_browser_config.py b/testing/mozharness/configs/raptor/android_hw_external_browser_config.py index 36f3ced4d83a..b35d4e3b8217 100644 --- a/testing/mozharness/configs/raptor/android_hw_external_browser_config.py +++ b/testing/mozharness/configs/raptor/android_hw_external_browser_config.py @@ -13,6 +13,7 @@ config = { "populate-webroot", "create-virtualenv", "install-chrome-android", + "install-chromium-android", "install-chromium-distribution", "run-tests", ], diff --git a/testing/mozharness/mozharness/mozilla/testing/raptor.py b/testing/mozharness/mozharness/mozilla/testing/raptor.py index 0497ca5af5fa..be2329376130 100644 --- a/testing/mozharness/mozharness/mozilla/testing/raptor.py +++ b/testing/mozharness/mozharness/mozilla/testing/raptor.py @@ -644,6 +644,7 @@ class Raptor( "populate-webroot", "create-virtualenv", "install-chrome-android", + "install-chromium-android", "install-chromium-distribution", "install-safari-technology-preview", "install", @@ -805,7 +806,7 @@ class Raptor( def install_chrome_android(self): """Install Google Chrome for Android in production from tooltool""" - if self.app not in ("chrome-m", "cstm-car-m"): + if self.app != "chrome-m": self.info("Google Chrome for Android not required") return if self.config.get("run_local"): @@ -814,10 +815,30 @@ class Raptor( "from tooltool when running locally" ) return + self.info("Fetching and installing Google Chrome for Android") self.device.shell_output("cmd package install-existing com.android.chrome") self.info("Google Chrome for Android successfully installed") + def install_chromium_android(self): + """Install custom Chromium-as-Release for Android from toolchain fetch""" + if self.app != "cstm-car-m": + self.info("Chromium-as-Release for Android not required") + return + if self.config.get("run_local"): + self.info( + "Chromium-as-Release for Android will not be installed " + "when running locally" + ) + return + + self.info("Installing Custom Chromium-as-Release for Android") + cstm_car_m_apk = pathlib.Path( + os.environ["MOZ_FETCHES_DIR"], "chromium", "apks", "ChromePublic.apk" + ) + self.device.install_app(str(cstm_car_m_apk)) + self.info("Custom Chromium-as-Release for Android successfully installed") + def download_chrome_android(self): # Fetch the APK tmpdir = tempfile.mkdtemp() @@ -862,16 +883,14 @@ class Raptor( def install_chromium_distribution(self): """Install Google Chromium distribution in production""" linux, mac, win = "linux", "mac", "win" - chrome, chromium_release, chromium_release_android = ( + chrome, chromium_release = ( "chrome", "custom-car", - "cstm-car-m", ) available_chromium_dists = [ chrome, chromium_release, - chromium_release_android, ] binary_location = { chromium_release: { @@ -879,9 +898,6 @@ class Raptor( win: ["chromium", "Default", "chrome.exe"], mac: ["chromium", "Chromium.app", "Contents", "MacOS", "chromium"], }, - chromium_release_android: { - linux: ["chromium", "apks", "ChromePublic.apk"], - }, } if self.app not in available_chromium_dists: @@ -989,6 +1005,9 @@ class Raptor( elif self.app == "safari-tp" and not self.run_local: binary_path = "/Applications/Safari Technology Preview.app/Contents/MacOS/Safari Technology Preview" kw_options["binary"] = binary_path + # Custom Chromium-as-Release for Android + elif self.app == "cstm-car-m": + kw_options["binary"] = "org.chromium.chrome" # Running on Chromium elif not self.run_local: # When running locally we already set the Chromium binary above, in init. diff --git a/testing/raptor/raptor/browsertime/android.py b/testing/raptor/raptor/browsertime/android.py index e7bd2e227d40..46675da1cf99 100644 --- a/testing/raptor/raptor/browsertime/android.py +++ b/testing/raptor/raptor/browsertime/android.py @@ -98,6 +98,8 @@ class BrowsertimeAndroid(PerftestAndroid, Browsertime): "chrome", ] ) + if self.config["app"] == "cstm-car-m": + args_list.extend(["--chrome.android.package", "org.chromium.chrome"]) else: activity = self.config["activity"] if self.config["app"] == "fenix": diff --git a/testing/raptor/raptor/perftest.py b/testing/raptor/raptor/perftest.py index ec2fa3625eff..548b6d57b378 100644 --- a/testing/raptor/raptor/perftest.py +++ b/testing/raptor/raptor/perftest.py @@ -695,7 +695,11 @@ class PerftestAndroid(Perftest): device = ADBDeviceFactory(verbose=True) # Chrome uses a specific binary that we don't set as a command line option - binary = "com.android.chrome" + binary = ( + "com.android.chrome" + if self.config["app"] == "chrome-m" + else "org.chromium.chrome" + ) if self.config["app"] not in CHROME_ANDROID_APPS: binary = self.config["binary"]