Dan Ballard pushed to branch tor-browser-153.5.0esr-16.0-1 at The Tor Project / Applications / Tor Browser
Commits:
-
19c61226
by Beatriz Rizental at 2026-10-09T13:47:22+02:00
-
4e1e8bb6
by Beatriz Rizental at 2026-10-09T13:47:22+02:00
-
72e858f6
by Makoto Kato at 2026-10-09T13:47:22+02:00
4 changed files:
- mobile/android/fenix/app/build.gradle
- + mobile/android/fenix/app/src/test/java/org/mozilla/fenix/torbrowser/SanityTest.kt
- mobile/android/geckoview/src/androidTest/AndroidManifest.xml
- testing/gtest/remotegtests.py
Changes:
| ... | ... | @@ -720,6 +720,39 @@ protobuf { |
| 720 | 720 | }
|
| 721 | 721 | }
|
| 722 | 722 | |
| 723 | +// Unit tests are disabled by default because most of them don't work in Tor Browser.
|
|
| 724 | +// Add source path patterns here (e.g. 'org/mozilla/fenix/home/**') to re-enable them
|
|
| 725 | +// as they get fixed. Only the listed tests (plus the shared helpers) are compiled and run.
|
|
| 726 | +// When the list is empty, unit tests are neither compiled nor run.
|
|
| 727 | +def enabledUnitTests = [
|
|
| 728 | + 'org/mozilla/fenix/torbrowser/**',
|
|
| 729 | +]
|
|
| 730 | +def unitTestHelpers = [
|
|
| 731 | + 'org/mozilla/fenix/helpers/**',
|
|
| 732 | +]
|
|
| 733 | + |
|
| 734 | +tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
|
|
| 735 | + if (name.contains("UnitTest")) {
|
|
| 736 | + if (enabledUnitTests) {
|
|
| 737 | + // The task already has default include patterns, so we can only narrow it down with excludes.
|
|
| 738 | + def allowed = new org.gradle.api.tasks.util.PatternSet()
|
|
| 739 | + .include((enabledUnitTests + unitTestHelpers).collect { "**/$it" })
|
|
| 740 | + .asSpec
|
|
| 741 | + exclude { !it.directory && !allowed.isSatisfiedBy(it) }
|
|
| 742 | + } else {
|
|
| 743 | + enabled = false
|
|
| 744 | + }
|
|
| 745 | + }
|
|
| 746 | +}
|
|
| 747 | + |
|
| 748 | +tasks.withType(Test).configureEach {
|
|
| 749 | + if (enabledUnitTests) {
|
|
| 750 | + include enabledUnitTests
|
|
| 751 | + } else {
|
|
| 752 | + enabled = false
|
|
| 753 | + }
|
|
| 754 | +}
|
|
| 755 | + |
|
| 723 | 756 | if (project.hasProperty("coverage")) {
|
| 724 | 757 | tasks.withType(Test).configureEach {
|
| 725 | 758 | jacoco.includeNoLocationClasses = true
|
| 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 | +package org.mozilla.fenix.torbrowser
|
|
| 6 | + |
|
| 7 | +import org.junit.Assert.assertEquals
|
|
| 8 | +import org.junit.Test
|
|
| 9 | + |
|
| 10 | +class SanityTest {
|
|
| 11 | + @Test
|
|
| 12 | + fun `one plus one is two`() {
|
|
| 13 | + assertEquals(2, 1 + 1)
|
|
| 14 | + }
|
|
| 15 | +} |
| ... | ... | @@ -4,6 +4,7 @@ |
| 4 | 4 | <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
|
| 5 | 5 | <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
|
| 6 | 6 | <uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"/>
|
| 7 | + <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
|
| 7 | 8 | <uses-permission android:name="android.permission.CAMERA"/>
|
| 8 | 9 | <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
|
| 9 | 10 | <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
|
| ... | ... | @@ -81,6 +81,8 @@ class RemoteGTests: |
| 81 | 81 | Launch the test app, run gtest, collect test results and wait for completion.
|
| 82 | 82 | Return False if a crash or other failure is detected, else True.
|
| 83 | 83 | """
|
| 84 | + # mach gtest will call run_gtest() directly
|
|
| 85 | + setup_logging()
|
|
| 84 | 86 | update_mozinfo()
|
| 85 | 87 | self.device = mozdevice.ADBDeviceFactory(
|
| 86 | 88 | adb=adb_path,
|
| ... | ... | @@ -485,11 +487,16 @@ def update_mozinfo(): |
| 485 | 487 | mozinfo.find_and_update_from_json(*dirs)
|
| 486 | 488 | |
| 487 | 489 | |
| 488 | -def main():
|
|
| 490 | +def setup_logging(options=None):
|
|
| 489 | 491 | global log
|
| 492 | + if log is None:
|
|
| 493 | + log = commandline.setup_logging("gtest", options, {"raw": sys.stdout})
|
|
| 494 | + |
|
| 495 | + |
|
| 496 | +def main():
|
|
| 490 | 497 | parser = remoteGtestOptions()
|
| 491 | 498 | options = parser.parse_args()
|
| 492 | - log = commandline.setup_logging("gtest", options, {"raw": sys.stdout})
|
|
| 499 | + setup_logging(options)
|
|
| 493 | 500 | args = options.args
|
| 494 | 501 | if not options.libxul_path:
|
| 495 | 502 | parser.error("--libxul is required")
|