brizental pushed to branch tor-browser-149.0a1-16.0-2 at The Tor Project / Applications / Tor Browser Commits: be9ff675 by Beatriz Rizental at 2026-03-25T19:18:57+01:00 fixup! TB 43817: Add tests for Tor Browser Bug 43243: Change IP checker service -- ifconfig.me will block with a 403 error depending on the exit node. - - - - - ea22acd8 by Beatriz Rizental at 2026-03-25T19:18:57+01:00 fixup! TB 43817: Add tests for Tor Browser Bug 43243: Change the way to get the IP address from check.tpo. Previous approach was failing on Android. - - - - - f16f4acd by Beatriz Rizental at 2026-03-25T19:18:57+01:00 fixup! TB 43817: Add tests for Tor Browser Bug 43243: Fix navigation race condition between auto navigation to about:blank after bootstrap and any other navigation. - - - - - 2 changed files: - testing/marionette/harness/marionette_harness/runner/mixins/tor_browser.py - testing/tor/test_circuit_isolation.py Changes: ===================================== testing/marionette/harness/marionette_harness/runner/mixins/tor_browser.py ===================================== @@ -1,3 +1,4 @@ +from marionette_driver import Wait from marionette_driver.errors import ScriptTimeoutException DEFAULT_BOOTSTRAP_TIMEOUT_MS = 60 * 1000 @@ -20,7 +21,7 @@ class TorBrowserMixin: while attempt < max_retries: try: with self.marionette.using_context("chrome"): - self.marionette.execute_async_script( + did_bootstrap = self.marionette.execute_async_script( """ const { TorConnect, TorConnectStage, TorConnectTopics } = ChromeUtils.importESModule( "resource://gre/modules/TorConnect.sys.mjs" @@ -29,7 +30,7 @@ class TorBrowserMixin: // Only the first test of a suite will need to bootstrap. if (TorConnect.stage.name === TorConnectStage.Bootstrapped) { - resolve(); + resolve(false); return; } @@ -37,7 +38,7 @@ class TorBrowserMixin: const topic = TorConnectTopics.BootstrapComplete; Services.obs.addObserver(function observer() { Services.obs.removeObserver(observer, topic); - resolve(); + resolve(true); }, topic); TorConnect.beginBootstrapping(); } @@ -55,6 +56,23 @@ class TorBrowserMixin: script_timeout=DEFAULT_BOOTSTRAP_TIMEOUT_MS, ) + # The above script waits for bootstrap to be complete, + # but doesn't wait for the redirection to about:blank that + # happens after bootstrap to be complete. + # + # We need to wait for this navigation to complete, + # otherwise subsequent calls to navigate may race with it. + # + # Android doesn't do any redirection, the tor connect UI in + # there is native and the initial state of the browser + # doesn't even have an open tab to check against. + # So we skip this check for that platform. + if did_bootstrap and self.marionette.session_capabilities.get("browserName") != "fennec": + Wait(self.marionette).until( + lambda mn: mn.get_url() == "about:blank", + message="Still not in about:blank", + ) + return except ScriptTimeoutException: attempt += 1 ===================================== testing/tor/test_circuit_isolation.py ===================================== @@ -31,8 +31,11 @@ class TestCircuitIsolation(MarionetteTestCase, TorBrowserMixin): By.CLASS_NAME, "off", ) - ip = self.marionette.find_element(By.TAG_NAME, "strong") - return ip_address(ip.text.strip()) + ip = self.marionette.execute_script( + "return document.querySelector('strong').textContent" + ).strip() + + return ip_address(ip) def extract_generic(self, url): # Fetch the IP address from any generic page that only contains @@ -49,7 +52,7 @@ class TestCircuitIsolation(MarionetteTestCase, TorBrowserMixin): ips = [ self.extract_from_check_tpo(), self.extract_generic("https://am.i.mullvad.net/ip"), - self.extract_generic("https://test1.ifconfig.me/ip"), + self.extract_generic("https://v4.ident.me"), ] self.logger.info(f"Found the following IP addresses: {ips}") unique_ips = set(ips) @@ -59,9 +62,12 @@ class TestCircuitIsolation(MarionetteTestCase, TorBrowserMixin): len(unique_ips), "Some of the IP addresses we got are not unique.", ) - duplicate = self.extract_generic("https://test2.ifconfig.me/ip") - self.assertEqual( - ips[-1], - duplicate, - "Two IPs that were expected to be equal are different, we might be over isolating!", - ) + + # TODO: Renable the duplicate check once + # https://gitlab.torproject.org/tpo/tpa/team/-/issues/42547 is resolved. + # duplicate = self.extract_generic("https://test2.ifconfig.me/ip") + # self.assertEqual( + # ips[-1], + # duplicate, + # "Two IPs that were expected to be equal are different, we might be over isolating!", + # ) View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/706872a... -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/706872a... 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
participants (1)
-
brizental (@brizental)