tor-browser

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

commit c5cc3c8b120beeeee929c6028b1c5f705e7bbd0f
parent d756df7b53c1fdccc88c1d2cce7f2c1a83e14a32
Author: Andrea Marchesini <amarchesini@mozilla.com>
Date:   Thu,  2 Oct 2025 07:40:43 +0000

Bug 1991870 - Rimuove IPProtectionService:Stopped event, r=ip-protection-reviewers,rking

Differential Revision: https://phabricator.services.mozilla.com/D266978

Diffstat:
Mbrowser/components/ipprotection/IPProtectionService.sys.mjs | 7-------
Mbrowser/components/ipprotection/tests/browser/browser_ipprotection_toolbar.js | 10++++++++--
2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/browser/components/ipprotection/IPProtectionService.sys.mjs b/browser/components/ipprotection/IPProtectionService.sys.mjs @@ -237,13 +237,6 @@ class IPProtectionServiceSingleton extends EventTarget { this.#setState(IPProtectionStates.READY); - this.dispatchEvent( - new CustomEvent("IPProtectionService:Stopped", { - bubbles: true, - composed: true, - }) - ); - if (userAction) { this.reloadCurrentTab(); } diff --git a/browser/components/ipprotection/tests/browser/browser_ipprotection_toolbar.js b/browser/components/ipprotection/tests/browser/browser_ipprotection_toolbar.js @@ -9,6 +9,8 @@ const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { IPProtectionService: "resource:///modules/ipprotection/IPProtectionService.sys.mjs", + IPProtectionStates: + "resource:///modules/ipprotection/IPProtectionService.sys.mjs", }); /** @@ -97,7 +99,9 @@ add_task(async function toolbar_icon_status() { ); let vpnOffPromise = BrowserTestUtils.waitForEvent( lazy.IPProtectionService, - "IPProtectionService:Stopped" + "IPProtectionService:StateChanged", + false, + () => lazy.IPProtectionService.state === lazy.IPProtectionStates.READY ); // Toggle the VPN off toggle.click(); @@ -174,7 +178,9 @@ add_task(async function customize_toolbar_remove_widget() { let stoppedEventPromise = BrowserTestUtils.waitForEvent( lazy.IPProtectionService, - "IPProtectionService:Stopped" + "IPProtectionService:StateChanged", + false, + () => lazy.IPProtectionService.state === lazy.IPProtectionStates.READY ); CustomizableUI.removeWidgetFromArea(IPProtectionWidget.WIDGET_ID); // VPN should disconect when the toolbaritem is removed