diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:14:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:14:29 +0000 |
commit | fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch) | |
tree | 4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /toolkit/components/antitracking | |
parent | Releasing progress-linux version 124.0.1-1~progress7.99u1. (diff) | |
download | firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip |
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/antitracking')
126 files changed, 706 insertions, 289 deletions
diff --git a/toolkit/components/antitracking/ContentBlockingAllowList.cpp b/toolkit/components/antitracking/ContentBlockingAllowList.cpp index 25806cd1e7..660906a49c 100644 --- a/toolkit/components/antitracking/ContentBlockingAllowList.cpp +++ b/toolkit/components/antitracking/ContentBlockingAllowList.cpp @@ -17,7 +17,9 @@ #include "nsICookieJarSettings.h" #include "nsIHttpChannel.h" #include "nsIHttpChannelInternal.h" +#include "nsIPermission.h" #include "nsNetUtil.h" +#include "nsString.h" using namespace mozilla; @@ -255,3 +257,70 @@ nsresult ContentBlockingAllowList::Check( returnInputArgument.release(); principal.forget(aPrincipal); } + +// ContentBlockingAllowListCache + +nsresult ContentBlockingAllowListCache::CheckForBaseDomain( + const nsACString& aBaseDomain, const OriginAttributes& aOriginAttributes, + bool& aIsAllowListed) { + MOZ_ASSERT(XRE_IsParentProcess()); + NS_ENSURE_TRUE(!aBaseDomain.IsEmpty(), NS_ERROR_INVALID_ARG); + aIsAllowListed = false; + + // Ensure we have the permission list. + nsresult rv = EnsureInit(); + NS_ENSURE_SUCCESS(rv, rv); + + if (aOriginAttributes.mPrivateBrowsingId > 0) { + aIsAllowListed = mEntriesPrivateBrowsing.Contains(aBaseDomain); + } else { + aIsAllowListed = mEntries.Contains(aBaseDomain); + } + + return NS_OK; +} + +nsresult ContentBlockingAllowListCache::EnsureInit() { + MOZ_ASSERT(XRE_IsParentProcess()); + + if (mIsInitialized) { + return NS_OK; + } + mIsInitialized = true; + + // 1. Get all permissions representing allow-list entries. + PermissionManager* permManager = PermissionManager::GetInstance(); + NS_ENSURE_TRUE(permManager, NS_ERROR_FAILURE); + + nsTArray<nsCString> types; + types.AppendElement("trackingprotection"); + types.AppendElement("trackingprotection-pb"); + + nsTArray<RefPtr<nsIPermission>> permissions; + nsresult rv = permManager->GetAllByTypes(types, permissions); + NS_ENSURE_SUCCESS(rv, rv); + + // 2. Populate mEntries and mEntriesPrivateBrowsing from permission list for + // faster lookup. + for (auto& permission : permissions) { + MOZ_ASSERT(permission); + + nsCOMPtr<nsIPrincipal> principal; + rv = permission->GetPrincipal(getter_AddRefs(principal)); + NS_ENSURE_SUCCESS(rv, rv); + MOZ_ASSERT(principal); + + nsAutoCString baseDomain; + rv = principal->GetBaseDomain(baseDomain); + NS_ENSURE_SUCCESS(rv, rv); + + // Sort base domains into sets for normal / private browsing. + if (principal->OriginAttributesRef().mPrivateBrowsingId > 0) { + mEntriesPrivateBrowsing.Insert(baseDomain); + } else { + mEntries.Insert(baseDomain); + } + } + + return NS_OK; +} diff --git a/toolkit/components/antitracking/ContentBlockingAllowList.h b/toolkit/components/antitracking/ContentBlockingAllowList.h index 2601173db7..1db29f3e35 100644 --- a/toolkit/components/antitracking/ContentBlockingAllowList.h +++ b/toolkit/components/antitracking/ContentBlockingAllowList.h @@ -9,6 +9,8 @@ #include "mozilla/dom/BrowsingContext.h" #include "nsIContentBlockingAllowList.h" +#include "nsIPermission.h" +#include "nsTHashSet.h" class nsICookieJarSettings; class nsIHttpChannel; @@ -19,7 +21,59 @@ class nsPIDOMWindowInner; namespace mozilla { class OriginAttributes; -struct ContentBlockingAllowListCache; + +/** + * @class ContentBlockingAllowListCache + * + * @brief This class represents a cache for the content blocking allow list. It + * is used for repeated lookups of the allow list for a specific base + * domain. Only use it if you need base domain lookups. In most cases + * this is not what you want. For regular allow-list checks by principal + * please use ContentBlockingAllowList. + */ +class ContentBlockingAllowListCache final { + public: + /** + * @brief Checks if a given base domain is allow-listed. This method considers + * the domain to be allow list if either the base domain or any of its + * subdomains are allow-listed. + * This is different from regular allow-list checks, + * @see{ContentBlockingAllowList::Check} where allow-listed state is only + * inherited to subdomains if the base domain is allow-listed. + * + * Example: + * If "example.com" is allow-listed, then "www.example.com" is also + * considered allow-listed. + * If foobar.example.org is allow-listed, then "example.org" is not + * considered allow-listed. + * + * @param aBaseDomain The base domain to check. + * @param aOriginAttributes The origin attributes associated with the base + * domain. + * @param aIsAllowListed [out] Set to true if the base domain is allow-listed, + * false otherwise. + * + * @return NS_OK if the check is successful, or an error code otherwise. + */ + nsresult CheckForBaseDomain(const nsACString& aBaseDomain, + const OriginAttributes& aOriginAttributes, + bool& aIsAllowListed); + + private: + bool mIsInitialized = false; + + // The cache is a hash set of base domains. If a base domain is in the set, it + // is allow-listed for that context (normal browsing, private browsing.) + nsTHashSet<nsCString> mEntries; + nsTHashSet<nsCString> mEntriesPrivateBrowsing; + + /** + * @brief Initializes the content blocking allow list cache if needed. + * + * @return NS_OK if initialization is successful, or an error code otherwise. + */ + nsresult EnsureInit(); +}; class ContentBlockingAllowList final : public nsIContentBlockingAllowList { public: diff --git a/toolkit/components/antitracking/ContentBlockingAllowList.sys.mjs b/toolkit/components/antitracking/ContentBlockingAllowList.sys.mjs index af1028083c..7efb0e7810 100644 --- a/toolkit/components/antitracking/ContentBlockingAllowList.sys.mjs +++ b/toolkit/components/antitracking/ContentBlockingAllowList.sys.mjs @@ -26,7 +26,7 @@ export const ContentBlockingAllowList = { "nsISupportsWeakReference", ]), - observe(subject, topic, data) { + observe(subject, topic) { if (topic == "last-pb-context-exited") { Services.perms.removeByType("trackingprotection-pb"); } diff --git a/toolkit/components/antitracking/PurgeTrackerService.sys.mjs b/toolkit/components/antitracking/PurgeTrackerService.sys.mjs index 08b5612287..458a35fef3 100644 --- a/toolkit/components/antitracking/PurgeTrackerService.sys.mjs +++ b/toolkit/components/antitracking/PurgeTrackerService.sys.mjs @@ -52,7 +52,7 @@ PurgeTrackerService.prototype = { // protection list, so we cache the result for faster future lookups. _trackingState: new Map(), - observe(aSubject, aTopic, aData) { + observe(aSubject, aTopic) { switch (aTopic) { case "idle-daily": // only allow one idle-daily listener to trigger until the list has been fully parsed. diff --git a/toolkit/components/antitracking/URLDecorationAnnotationsService.sys.mjs b/toolkit/components/antitracking/URLDecorationAnnotationsService.sys.mjs index ca285e972d..e445c8ec33 100644 --- a/toolkit/components/antitracking/URLDecorationAnnotationsService.sys.mjs +++ b/toolkit/components/antitracking/URLDecorationAnnotationsService.sys.mjs @@ -40,7 +40,7 @@ URLDecorationAnnotationsService.prototype = { branch.lockPref(PREF_NAME); }, - observe(aSubject, aTopic, aData) { + observe(aSubject, aTopic) { if (aTopic == "profile-after-change") { this.ensureUpdated(); } diff --git a/toolkit/components/antitracking/URLQueryStringStripper.cpp b/toolkit/components/antitracking/URLQueryStringStripper.cpp index 3b46738280..2e154b9103 100644 --- a/toolkit/components/antitracking/URLQueryStringStripper.cpp +++ b/toolkit/components/antitracking/URLQueryStringStripper.cpp @@ -98,7 +98,7 @@ URLQueryStringStripper::StripForCopyOrShare(nsIURI* aURI, URLParams params; - URLParams::Parse(query, [&](nsString&& name, nsString&& value) { + URLParams::Parse(query, true, [&](nsString&& name, nsString&& value) { nsAutoString lowerCaseName; ToLowerCase(name, lowerCaseName); // Look through the global rules. @@ -308,7 +308,7 @@ nsresult URLQueryStringStripper::StripQueryString(nsIURI* aURI, URLParams params; - URLParams::Parse(query, [&](nsString&& name, nsString&& value) { + URLParams::Parse(query, false, [&](nsString&& name, nsString&& value) { nsAutoString lowerCaseName; ToLowerCase(name, lowerCaseName); diff --git a/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingProtection.cpp b/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingProtection.cpp index e5d9ccfea9..2b0577d5c6 100644 --- a/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingProtection.cpp +++ b/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingProtection.cpp @@ -12,6 +12,7 @@ #include "ErrorList.h" #include "mozilla/AlreadyAddRefed.h" #include "mozilla/ClearOnShutdown.h" +#include "mozilla/ContentBlockingAllowList.h" #include "mozilla/Logging.h" #include "mozilla/Services.h" #include "mozilla/StaticPrefs_privacy.h" @@ -122,7 +123,7 @@ nsresult BounceTrackingProtection::RecordStatefulBounces( aBounceTrackingState->Describe().get())); // Assert: navigable’s bounce tracking record is not null. - BounceTrackingRecord* record = + const Maybe<BounceTrackingRecord>& record = aBounceTrackingState->GetBounceTrackingRecord(); NS_ENSURE_TRUE(record, NS_ERROR_FAILURE); @@ -369,6 +370,11 @@ BounceTrackingProtection::TestRunPurgeBounceTrackers( } NS_IMETHODIMP +BounceTrackingProtection::TestClearExpiredUserActivations() { + return ClearExpiredUserInteractions(); +} + +NS_IMETHODIMP BounceTrackingProtection::TestAddBounceTrackerCandidate( JS::Handle<JS::Value> aOriginAttributes, const nsACString& aHost, const PRTime aBounceTime, JSContext* aCx) { @@ -415,6 +421,22 @@ BounceTrackingProtection::TestAddUserActivation( RefPtr<BounceTrackingProtection::PurgeBounceTrackersMozPromise> BounceTrackingProtection::PurgeBounceTrackers() { + // Prevent multiple purge operations from running at the same time. + if (mPurgeInProgress) { + MOZ_LOG(gBounceTrackingProtectionLog, LogLevel::Debug, + ("%s: Skip: Purge already in progress.", __FUNCTION__)); + return PurgeBounceTrackersMozPromise::CreateAndReject( + nsresult::NS_ERROR_NOT_AVAILABLE, __func__); + } + mPurgeInProgress = true; + + // Obtain a cache of ContentBlockingAllowList permissions so we only need to + // fetch permissions once even when we do multiple base domain lookups. + ContentBlockingAllowListCache contentBlockingAllowListCache; + + // Collect promises for all clearing operations to later await on. + nsTArray<RefPtr<ClearDataMozPromise>> clearPromises; + // Run the purging algorithm for all global state objects. for (const auto& entry : mStorage->StateGlobalMapRef()) { const OriginAttributes& originAttributes = entry.GetKey(); @@ -429,13 +451,17 @@ BounceTrackingProtection::PurgeBounceTrackers() { oaSuffix.get())); } - PurgeBounceTrackersForStateGlobal(stateGlobal, originAttributes); + nsresult rv = PurgeBounceTrackersForStateGlobal( + stateGlobal, contentBlockingAllowListCache, clearPromises); + if (NS_WARN_IF(NS_FAILED(rv))) { + return PurgeBounceTrackersMozPromise::CreateAndReject(rv, __func__); + } } // Wait for all data clearing operations to complete. mClearPromises contains // one promise per host / clear task. return ClearDataMozPromise::AllSettled(GetCurrentSerialEventTarget(), - mClearPromises) + clearPromises) ->Then( GetCurrentSerialEventTarget(), __func__, [&](ClearDataMozPromise::AllSettledPromiseType::ResolveOrRejectValue&& @@ -450,7 +476,7 @@ BounceTrackingProtection::PurgeBounceTrackers() { // If any clear call failed reject. for (auto& result : aResults.ResolveValue()) { if (result.IsReject()) { - mClearPromises.Clear(); + mPurgeInProgress = false; return PurgeBounceTrackersMozPromise::CreateAndReject( NS_ERROR_FAILURE, __func__); } @@ -458,7 +484,8 @@ BounceTrackingProtection::PurgeBounceTrackers() { } // No clearing errors, resolve. - mClearPromises.Clear(); + + mPurgeInProgress = false; return PurgeBounceTrackersMozPromise::CreateAndResolve( std::move(purgedSiteHosts), __func__); }); @@ -466,34 +493,17 @@ BounceTrackingProtection::PurgeBounceTrackers() { nsresult BounceTrackingProtection::PurgeBounceTrackersForStateGlobal( BounceTrackingStateGlobal* aStateGlobal, - const OriginAttributes& aOriginAttributes) { + ContentBlockingAllowListCache& aContentBlockingAllowList, + nsTArray<RefPtr<ClearDataMozPromise>>& aClearPromises) { MOZ_ASSERT(aStateGlobal); MOZ_LOG(gBounceTrackingProtectionLog, LogLevel::Debug, - ("%s: #mUserActivation: %d, #mBounceTrackers: %d", __FUNCTION__, - aStateGlobal->UserActivationMapRef().Count(), - aStateGlobal->BounceTrackersMapRef().Count())); - - // Purge already in progress. - if (!mClearPromises.IsEmpty()) { - MOZ_LOG(gBounceTrackingProtectionLog, LogLevel::Debug, - ("%s: Skip: Purge already in progress.", __FUNCTION__)); - return NS_ERROR_NOT_AVAILABLE; - } + ("%s: %s", __FUNCTION__, aStateGlobal->Describe().get())); const PRTime now = PR_Now(); - // Convert the user activation lifetime into microseconds for calculation with - // PRTime values. The pref is a 32-bit value. Cast into 64-bit before - // multiplying so we get the correct result. - int64_t activationLifetimeUsec = - static_cast<int64_t>( - StaticPrefs:: - privacy_bounceTrackingProtection_bounceTrackingActivationLifetimeSec()) * - PR_USEC_PER_SEC; // 1. Remove hosts from the user activation map whose user activation flag has // expired. - nsresult rv = - aStateGlobal->ClearUserActivationBefore(now - activationLifetimeUsec); + nsresult rv = ClearExpiredUserInteractions(aStateGlobal); NS_ENSURE_SUCCESS(rv, rv); // 2. Go over bounce tracker candidate map and purge state. @@ -502,7 +512,6 @@ nsresult BounceTrackingProtection::PurgeBounceTrackersForStateGlobal( do_GetService("@mozilla.org/clear-data-service;1", &rv); NS_ENSURE_SUCCESS(rv, rv); - mClearPromises.Clear(); nsTArray<nsCString> purgedSiteHosts; // Collect hosts to remove from the bounce trackers map. We can not remove @@ -545,6 +554,27 @@ nsresult BounceTrackingProtection::PurgeBounceTrackersForStateGlobal( continue; } + // Gecko specific: If the host is on the content blocking allow-list, + // continue. + bool isAllowListed = false; + rv = aContentBlockingAllowList.CheckForBaseDomain( + host, aStateGlobal->OriginAttributesRef(), isAllowListed); + if (NS_WARN_IF(NS_FAILED(rv))) { + continue; + } + if (isAllowListed) { + if (MOZ_LOG_TEST(gBounceTrackingProtectionLog, LogLevel::Debug)) { + nsAutoCString originAttributeSuffix; + aStateGlobal->OriginAttributesRef().CreateSuffix(originAttributeSuffix); + MOZ_LOG(gBounceTrackingProtectionLog, LogLevel::Debug, + ("%s: Skip host on the content blocking allow-list: host: %s, " + "originAttributes: %s", + __FUNCTION__, PromiseFlatCString(host).get(), + originAttributeSuffix.get())); + } + continue; + } + // No exception above applies, clear state for the given host. RefPtr<ClearDataMozPromise::Private> clearPromise = @@ -562,7 +592,7 @@ nsresult BounceTrackingProtection::PurgeBounceTrackersForStateGlobal( clearPromise->Reject(0, __func__); } - mClearPromises.AppendElement(clearPromise); + aClearPromises.AppendElement(clearPromise); // Remove it from the bounce trackers map, it's about to be purged. If the // clear call fails still remove it. We want to avoid an ever growing list @@ -575,6 +605,43 @@ nsresult BounceTrackingProtection::PurgeBounceTrackersForStateGlobal( return aStateGlobal->RemoveBounceTrackers(bounceTrackerCandidatesToRemove); } +nsresult BounceTrackingProtection::ClearExpiredUserInteractions( + BounceTrackingStateGlobal* aStateGlobal) { + if (!aStateGlobal && mStorage->StateGlobalMapRef().IsEmpty()) { + // Nothing to clear. + return NS_OK; + } + + const PRTime now = PR_Now(); + + // Convert the user activation lifetime into microseconds for calculation with + // PRTime values. The pref is a 32-bit value. Cast into 64-bit before + // multiplying so we get the correct result. + int64_t activationLifetimeUsec = + static_cast<int64_t>( + StaticPrefs:: + privacy_bounceTrackingProtection_bounceTrackingActivationLifetimeSec()) * + PR_USEC_PER_SEC; + + // Clear user activation for the given state global. + if (aStateGlobal) { + return aStateGlobal->ClearUserActivationBefore(now - + activationLifetimeUsec); + } + + // aStateGlobal not passed, clear user activation for all state globals. + for (const auto& entry : mStorage->StateGlobalMapRef()) { + const RefPtr<BounceTrackingStateGlobal>& stateGlobal = entry.GetData(); + MOZ_ASSERT(stateGlobal); + + nsresult rv = + stateGlobal->ClearUserActivationBefore(now - activationLifetimeUsec); + NS_ENSURE_SUCCESS(rv, rv); + } + + return NS_OK; +} + // ClearDataCallback NS_IMPL_ISUPPORTS(BounceTrackingProtection::ClearDataCallback, diff --git a/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingProtection.h b/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingProtection.h index 98c61504c0..e99cf895be 100644 --- a/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingProtection.h +++ b/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingProtection.h @@ -17,6 +17,7 @@ namespace mozilla { class BounceTrackingState; class BounceTrackingStateGlobal; class BounceTrackingProtectionStorage; +class ContentBlockingAllowListCache; class OriginAttributes; extern LazyLogModule gBounceTrackingProtectionLog; @@ -33,10 +34,17 @@ class BounceTrackingProtection final : public nsIBounceTrackingProtection { // navigation start for bounce tracking, or if the client bounce detection // timer expires after process response received for bounce tracking without // observing a client redirect. - nsresult RecordStatefulBounces(BounceTrackingState* aBounceTrackingState); + [[nodiscard]] nsresult RecordStatefulBounces( + BounceTrackingState* aBounceTrackingState); // Stores a user activation flag with a timestamp for the given principal. - nsresult RecordUserActivation(nsIPrincipal* aPrincipal); + [[nodiscard]] nsresult RecordUserActivation(nsIPrincipal* aPrincipal); + + // Clears expired user interaction flags for the given state global. If + // aStateGlobal == nullptr, clears expired user interaction flags for all + // state globals. + [[nodiscard]] nsresult ClearExpiredUserInteractions( + BounceTrackingStateGlobal* aStateGlobal = nullptr); private: BounceTrackingProtection(); @@ -53,13 +61,19 @@ class BounceTrackingProtection final : public nsIBounceTrackingProtection { MozPromise<nsTArray<nsCString>, nsresult, true>; RefPtr<PurgeBounceTrackersMozPromise> PurgeBounceTrackers(); - nsresult PurgeBounceTrackersForStateGlobal( - BounceTrackingStateGlobal* aStateGlobal, - const OriginAttributes& aOriginAttributes); - // Pending clear operations are stored as ClearDataMozPromise, one per host. using ClearDataMozPromise = MozPromise<nsCString, uint32_t, true>; - nsTArray<RefPtr<ClearDataMozPromise>> mClearPromises; + + // Clear state for classified bounce trackers for a specific state global. + // aClearPromises is populated with promises for each host that is cleared. + [[nodiscard]] nsresult PurgeBounceTrackersForStateGlobal( + BounceTrackingStateGlobal* aStateGlobal, + ContentBlockingAllowListCache& aContentBlockingAllowList, + nsTArray<RefPtr<ClearDataMozPromise>>& aClearPromises); + + // Whether a purge operation is currently in progress. This avoids running + // multiple purge operations at the same time. + bool mPurgeInProgress = false; // Wraps nsIClearDataCallback in MozPromise. class ClearDataCallback final : public nsIClearDataCallback { diff --git a/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingRecord.cpp b/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingRecord.cpp index 14ee178ae2..d4b33f9edb 100644 --- a/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingRecord.cpp +++ b/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingRecord.cpp @@ -12,13 +12,11 @@ namespace mozilla { extern LazyLogModule gBounceTrackingProtectionLog; -NS_IMPL_CYCLE_COLLECTION(BounceTrackingRecord); - void BounceTrackingRecord::SetInitialHost(const nsACString& aHost) { mInitialHost = aHost; } -const nsACString& BounceTrackingRecord::GetInitialHost() { +const nsACString& BounceTrackingRecord::GetInitialHost() const { return mInitialHost; } @@ -26,7 +24,9 @@ void BounceTrackingRecord::SetFinalHost(const nsACString& aHost) { mFinalHost = aHost; } -const nsACString& BounceTrackingRecord::GetFinalHost() { return mFinalHost; } +const nsACString& BounceTrackingRecord::GetFinalHost() const { + return mFinalHost; +} void BounceTrackingRecord::AddBounceHost(const nsACString& aHost) { mBounceHosts.Insert(aHost); @@ -57,11 +57,12 @@ void BounceTrackingRecord::AddStorageAccessHost(const nsACString& aHost) { mStorageAccessHosts.Insert(aHost); } -const nsTHashSet<nsCString>& BounceTrackingRecord::GetBounceHosts() { +const nsTHashSet<nsCString>& BounceTrackingRecord::GetBounceHosts() const { return mBounceHosts; } -const nsTHashSet<nsCString>& BounceTrackingRecord::GetStorageAccessHosts() { +const nsTHashSet<nsCString>& BounceTrackingRecord::GetStorageAccessHosts() + const { return mStorageAccessHosts; } diff --git a/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingRecord.h b/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingRecord.h index d3e980d00b..73985a00a4 100644 --- a/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingRecord.h +++ b/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingRecord.h @@ -7,9 +7,7 @@ #ifndef mozilla_BounceTrackingRecord_h #define mozilla_BounceTrackingRecord_h -#include "nsISupports.h" #include "nsStringFwd.h" -#include "nsCycleCollectionParticipant.h" #include "nsTHashSet.h" namespace mozilla { @@ -22,31 +20,26 @@ class CanonicalBrowsingContext; // navigation. class BounceTrackingRecord final { public: - NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(BounceTrackingRecord); - NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(BounceTrackingRecord); - void SetInitialHost(const nsACString& aHost); - const nsACString& GetInitialHost(); + const nsACString& GetInitialHost() const; void SetFinalHost(const nsACString& aHost); - const nsACString& GetFinalHost(); + const nsACString& GetFinalHost() const; void AddBounceHost(const nsACString& aHost); void AddStorageAccessHost(const nsACString& aHost); - const nsTHashSet<nsCString>& GetBounceHosts(); + const nsTHashSet<nsCString>& GetBounceHosts() const; - const nsTHashSet<nsCString>& GetStorageAccessHosts(); + const nsTHashSet<nsCString>& GetStorageAccessHosts() const; // Create a string that describes this record. Used for logging. nsCString Describe(); private: - ~BounceTrackingRecord() = default; - // A site's host. The initiator site of the current extended navigation. nsAutoCString mInitialHost; diff --git a/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingState.cpp b/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingState.cpp index c5abb8b8d7..b4af3daa07 100644 --- a/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingState.cpp +++ b/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingState.cpp @@ -143,10 +143,11 @@ nsresult BounceTrackingState::Init( } void BounceTrackingState::ResetBounceTrackingRecord() { - mBounceTrackingRecord = nullptr; + mBounceTrackingRecord = Nothing(); } -BounceTrackingRecord* BounceTrackingState::GetBounceTrackingRecord() { +const Maybe<BounceTrackingRecord>& +BounceTrackingState::GetBounceTrackingRecord() { return mBounceTrackingRecord; } @@ -452,7 +453,7 @@ nsresult BounceTrackingState::OnStartNavigation( // tracking record to a new bounce tracking record with initial host set to // initialHost. if (!mBounceTrackingRecord) { - mBounceTrackingRecord = new BounceTrackingRecord(); + mBounceTrackingRecord = Some(BounceTrackingRecord()); mBounceTrackingRecord->SetInitialHost(siteHost); MOZ_LOG(gBounceTrackingProtectionLog, LogLevel::Debug, @@ -477,7 +478,7 @@ nsresult BounceTrackingState::OnStartNavigation( NS_ENSURE_SUCCESS(rv, rv); MOZ_ASSERT(!mBounceTrackingRecord); - mBounceTrackingRecord = new BounceTrackingRecord(); + mBounceTrackingRecord = Some(BounceTrackingRecord()); mBounceTrackingRecord->SetInitialHost(siteHost); return NS_OK; @@ -539,8 +540,12 @@ nsresult BounceTrackingState::OnResponseReceived( ("%s: Calling RecordStatefulBounces after timeout.", __FUNCTION__)); BounceTrackingState* bounceTrackingState = thisWeak; - bounceTrackingState->mBounceTrackingProtection->RecordStatefulBounces( - bounceTrackingState); + DebugOnly<nsresult> rv = + bounceTrackingState->mBounceTrackingProtection + ->RecordStatefulBounces(bounceTrackingState); + NS_WARNING_ASSERTION( + NS_SUCCEEDED(rv), + "Running RecordStatefulBounces after a timeout failed."); bounceTrackingState->mClientBounceDetectionTimeout = nullptr; }, diff --git a/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingState.h b/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingState.h index 70deee5abe..17d324bda9 100644 --- a/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingState.h +++ b/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingState.h @@ -7,6 +7,7 @@ #ifndef mozilla_BounceTrackingState_h #define mozilla_BounceTrackingState_h +#include "BounceTrackingRecord.h" #include "mozilla/WeakPtr.h" #include "mozilla/OriginAttributes.h" #include "nsIPrincipal.h" @@ -22,7 +23,6 @@ class nsIPrincipal; namespace mozilla { class BounceTrackingProtection; -class BounceTrackingRecord; namespace dom { class CanonicalBrowsingContext; @@ -55,7 +55,7 @@ class BounceTrackingState : public nsIWebProgressListener, static void ResetAllForOriginAttributesPattern( const OriginAttributesPattern& aPattern); - BounceTrackingRecord* GetBounceTrackingRecord(); + const Maybe<BounceTrackingRecord>& GetBounceTrackingRecord(); void ResetBounceTrackingRecord(); @@ -113,7 +113,7 @@ class BounceTrackingState : public nsIWebProgressListener, // Record to keep track of extended navigation data. Reset on extended // navigation end. - RefPtr<BounceTrackingRecord> mBounceTrackingRecord; + Maybe<BounceTrackingRecord> mBounceTrackingRecord; // Timer to wait to wait for a client redirect after a navigation ends. RefPtr<nsITimer> mClientBounceDetectionTimeout; diff --git a/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingStateGlobal.cpp b/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingStateGlobal.cpp index 3481753431..b94c887c90 100644 --- a/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingStateGlobal.cpp +++ b/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingStateGlobal.cpp @@ -106,6 +106,11 @@ nsresult BounceTrackingStateGlobal::ClearByTimeRange( NS_ENSURE_ARG_MIN(aFrom, 0); NS_ENSURE_TRUE(!aTo || aTo.value() > aFrom, NS_ERROR_INVALID_ARG); + MOZ_LOG(gBounceTrackingProtectionLog, LogLevel::Debug, + ("%s: Clearing user activations by time range from %" PRIu64 + " to %" PRIu64 " %s", + __FUNCTION__, aFrom, aTo.valueOr(0), Describe().get())); + // Clear in memory user activation data. if (aEntryType.isNothing() || aEntryType.value() == @@ -113,10 +118,10 @@ nsresult BounceTrackingStateGlobal::ClearByTimeRange( for (auto iter = mUserActivation.Iter(); !iter.Done(); iter.Next()) { if (iter.Data() >= aFrom && (aTo.isNothing() || iter.Data() <= aTo.value())) { - iter.Remove(); MOZ_LOG(gBounceTrackingProtectionLog, LogLevel::Debug, ("%s: Remove user activation for %s", __FUNCTION__, PromiseFlatCString(iter.Key()).get())); + iter.Remove(); } } } @@ -128,10 +133,10 @@ nsresult BounceTrackingStateGlobal::ClearByTimeRange( for (auto iter = mBounceTrackers.Iter(); !iter.Done(); iter.Next()) { if (iter.Data() >= aFrom && (aTo.isNothing() || iter.Data() <= aTo.value())) { - iter.Remove(); MOZ_LOG(gBounceTrackingProtectionLog, LogLevel::Debug, ("%s: Remove bouncer tracker for %s", __FUNCTION__, PromiseFlatCString(iter.Key()).get())); + iter.Remove(); } } } @@ -187,4 +192,27 @@ nsresult BounceTrackingStateGlobal::RemoveBounceTrackers( return NS_OK; } +// static +nsCString BounceTrackingStateGlobal::DescribeMap( + const nsTHashMap<nsCStringHashKey, PRTime>& aMap) { + nsAutoCString mapStr; + + for (auto iter = aMap.ConstIter(); !iter.Done(); iter.Next()) { + mapStr.Append(nsPrintfCString("{ %s: %" PRIu64 " }, ", + PromiseFlatCString(iter.Key()).get(), + iter.Data())); + } + + return std::move(mapStr); +} + +nsCString BounceTrackingStateGlobal::Describe() { + nsAutoCString originAttributeSuffix; + mOriginAttributes.CreateSuffix(originAttributeSuffix); + return nsPrintfCString( + "{ mOriginAttributes: %s, mUserActivation: %s, mBounceTrackers: %s }", + originAttributeSuffix.get(), DescribeMap(mUserActivation).get(), + DescribeMap(mBounceTrackers).get()); +} + } // namespace mozilla diff --git a/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingStateGlobal.h b/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingStateGlobal.h index 6680ceae6f..c8ed72c11f 100644 --- a/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingStateGlobal.h +++ b/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingStateGlobal.h @@ -37,6 +37,10 @@ class BounceTrackingStateGlobal final { bool ShouldPersistToDisk() const { return !IsPrivateBrowsing(); } + const OriginAttributes& OriginAttributesRef() const { + return mOriginAttributes; + }; + bool HasUserActivation(const nsACString& aSiteHost) const; // Store a user interaction flag for the given host. This will remove the @@ -79,6 +83,9 @@ class BounceTrackingStateGlobal final { return mBounceTrackers; } + // Create a string that describes this object. Used for logging. + nsCString Describe(); + private: ~BounceTrackingStateGlobal() = default; @@ -103,6 +110,10 @@ class BounceTrackingStateGlobal final { // on the given site host performed an action that could indicate stateful // bounce tracking took place. nsTHashMap<nsCStringHashKey, PRTime> mBounceTrackers{}; + + // Helper to create a string representation of a siteHost -> timestamp map. + static nsCString DescribeMap( + const nsTHashMap<nsCStringHashKey, PRTime>& aMap); }; } // namespace mozilla diff --git a/toolkit/components/antitracking/bouncetrackingprotection/nsIBounceTrackingProtection.idl b/toolkit/components/antitracking/bouncetrackingprotection/nsIBounceTrackingProtection.idl index 9ade9cb0ea..1163492333 100644 --- a/toolkit/components/antitracking/bouncetrackingprotection/nsIBounceTrackingProtection.idl +++ b/toolkit/components/antitracking/bouncetrackingprotection/nsIBounceTrackingProtection.idl @@ -28,6 +28,10 @@ interface nsIBounceTrackingProtection : nsISupports { [implicit_jscontext] Promise testRunPurgeBounceTrackers(); + // Clear expired user activation flags. Expiry is set via pref + // "privacy.bounceTrackingProtection.bounceTrackingActivationLifetimeSec". + void testClearExpiredUserActivations(); + // Getters and setters for user activation and bounce tracker state. // These are used for testing purposes only. // State is keyed by OriginAttributes. diff --git a/toolkit/components/antitracking/bouncetrackingprotection/test/browser/browser_bouncetracking_purge.js b/toolkit/components/antitracking/bouncetrackingprotection/test/browser/browser_bouncetracking_purge.js index a8e98b80f0..eedd374197 100644 --- a/toolkit/components/antitracking/bouncetrackingprotection/test/browser/browser_bouncetracking_purge.js +++ b/toolkit/components/antitracking/bouncetrackingprotection/test/browser/browser_bouncetracking_purge.js @@ -119,3 +119,69 @@ add_task(async function test_purging_skip_open_tab_extra_window() { bounceTrackingProtection.clearAll(); }); + +add_task(async function test_purging_skip_content_blocking_allow_list() { + initBounceTrackerState(); + + await BrowserTestUtils.withNewTab("https://example.com", async browser => { + window.ContentBlockingAllowList.add(browser); + }); + + Assert.deepEqual( + await bounceTrackingProtection.testRunPurgeBounceTrackers(), + ["example.net"], + "Should only purge example.net. example.org is within the grace period, example.com is allow-listed." + ); + + info( + "Remove the allow-list entry for example.com and test that it gets purged now." + ); + + await BrowserTestUtils.withNewTab("https://example.com", async browser => { + window.ContentBlockingAllowList.remove(browser); + }); + Assert.deepEqual( + await bounceTrackingProtection.testRunPurgeBounceTrackers(), + ["example.com"], + "example.com should have been purged now that it is no longer allow-listed." + ); + + bounceTrackingProtection.clearAll(); +}); + +add_task( + async function test_purging_skip_content_blocking_allow_list_subdomain() { + initBounceTrackerState(); + + await BrowserTestUtils.withNewTab( + "https://test1.example.com", + async browser => { + window.ContentBlockingAllowList.add(browser); + } + ); + + Assert.deepEqual( + await bounceTrackingProtection.testRunPurgeBounceTrackers(), + ["example.net"], + "Should only purge example.net. example.org is within the grace period, example.com is allow-listed via test1.example.com." + ); + + info( + "Remove the allow-list entry for test1.example.com and test that it gets purged now." + ); + + await BrowserTestUtils.withNewTab( + "https://test1.example.com", + async browser => { + window.ContentBlockingAllowList.remove(browser); + } + ); + Assert.deepEqual( + await bounceTrackingProtection.testRunPurgeBounceTrackers(), + ["example.com"], + "example.com should have been purged now that test1.example.com it is no longer allow-listed." + ); + + bounceTrackingProtection.clearAll(); + } +); diff --git a/toolkit/components/antitracking/bouncetrackingprotection/test/xpcshell/test_bouncetracking_clearExpiredUserActivation.js b/toolkit/components/antitracking/bouncetrackingprotection/test/xpcshell/test_bouncetracking_clearExpiredUserActivation.js new file mode 100644 index 0000000000..28a1350b3e --- /dev/null +++ b/toolkit/components/antitracking/bouncetrackingprotection/test/xpcshell/test_bouncetracking_clearExpiredUserActivation.js @@ -0,0 +1,85 @@ +/* Any copyright is dedicated to the Public Domain. +http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/** + * Test that expired user activations are cleared by the the helper method + * testClearExpiredUserActivations. + */ +add_task(async function test() { + // Need a profile to data clearing calls. + do_get_profile(); + + let btp = Cc["@mozilla.org/bounce-tracking-protection;1"].getService( + Ci.nsIBounceTrackingProtection + ); + + // Reset global bounce tracking state. + btp.clearAll(); + + // Assert initial test state. + Assert.deepEqual( + btp.testGetBounceTrackerCandidateHosts({}), + [], + "No tracker candidates initially." + ); + Assert.deepEqual( + btp.testGetUserActivationHosts({}), + [], + "No user activation hosts initially." + ); + + // Get the bounce tracking activation lifetime. The pref is in seconds, we + // need to convert it to microseconds, as the user activation timestamps are + // in microseconds (PRTime). + let bounceTrackingActivationLifetimeUSec = + 1000 * + 1000 * + Services.prefs.getIntPref( + "privacy.bounceTrackingProtection.bounceTrackingActivationLifetimeSec" + ); + + // Add some test data for user activation. + btp.testAddUserActivation({}, "not-expired1.com", Date.now() * 1000); + btp.testAddUserActivation( + {}, + "not-expired2.com", + Date.now() * 1000 - bounceTrackingActivationLifetimeUSec / 2 + ); + btp.testAddUserActivation( + { privateBrowsingId: 1 }, + "pbm-not-expired.com", + Date.now() * 1000 + ); + btp.testAddUserActivation( + {}, + "expired1.com", + Date.now() * 1000 - bounceTrackingActivationLifetimeUSec * 2 + ); + btp.testAddUserActivation( + {}, + "expired2.com", + Date.now() * 1000 - (bounceTrackingActivationLifetimeUSec + 1000 * 1000) + ); + btp.testAddUserActivation({ privateBrowsingId: 1 }, "pbm-expired.com", 1); + + // Clear expired user activations. + btp.testClearExpiredUserActivations(); + + // Assert that expired user activations have been cleared. + Assert.deepEqual( + btp.testGetUserActivationHosts({}).sort(), + ["not-expired1.com", "not-expired2.com"], + "Expired user activation flags have been cleared for normal browsing." + ); + + Assert.deepEqual( + btp.testGetUserActivationHosts({ privateBrowsingId: 1 }).sort(), + ["pbm-not-expired.com"], + "Expired user activation flags have been cleared for private browsing." + ); + + // Reset global bounce tracking state. + btp.clearAll(); +}); diff --git a/toolkit/components/antitracking/bouncetrackingprotection/test/xpcshell/xpcshell.toml b/toolkit/components/antitracking/bouncetrackingprotection/test/xpcshell/xpcshell.toml index 16e270b85c..c3aeee502f 100644 --- a/toolkit/components/antitracking/bouncetrackingprotection/test/xpcshell/xpcshell.toml +++ b/toolkit/components/antitracking/bouncetrackingprotection/test/xpcshell/xpcshell.toml @@ -5,4 +5,6 @@ prefs = [ "privacy.bounceTrackingProtection.bounceTrackingPurgeTimerPeriodSec=0", ] +["test_bouncetracking_clearExpiredUserActivation.js"] + ["test_bouncetracking_purge.js"] diff --git a/toolkit/components/antitracking/test/browser/3rdPartySVG.html b/toolkit/components/antitracking/test/browser/3rdPartySVG.html index df791f355f..9ce6fc8ba1 100644 --- a/toolkit/components/antitracking/test/browser/3rdPartySVG.html +++ b/toolkit/components/antitracking/test/browser/3rdPartySVG.html @@ -11,7 +11,7 @@ <h1>3rd party content with an SVG image background</h1> <script> -onload = function(e) { +onload = function() { parent.postMessage({ type: "finish" }, "*"); }; diff --git a/toolkit/components/antitracking/test/browser/3rdPartyWorker.html b/toolkit/components/antitracking/test/browser/3rdPartyWorker.html index e79a992660..9544bfed2b 100644 --- a/toolkit/components/antitracking/test/browser/3rdPartyWorker.html +++ b/toolkit/components/antitracking/test/browser/3rdPartyWorker.html @@ -20,7 +20,7 @@ function is(a, b, msg) { } function workerCode() { - onmessage = e => { + onmessage = () => { try { indexedDB.open("test", "1"); postMessage(true); diff --git a/toolkit/components/antitracking/test/browser/antitracking_head.js b/toolkit/components/antitracking/test/browser/antitracking_head.js index 52871b60c2..fedad72e9b 100644 --- a/toolkit/components/antitracking/test/browser/antitracking_head.js +++ b/toolkit/components/antitracking/test/browser/antitracking_head.js @@ -356,7 +356,7 @@ this.AntiTracking = { let cnt = 0; return new Promise(resolve => { - Services.obs.addObserver(function observer(subject, topic, data) { + Services.obs.addObserver(function observer(subject, topic) { if (topic != targetTopic) { return; } @@ -1174,8 +1174,7 @@ this.AntiTracking = { let windowClosed = new content.Promise(resolve => { Services.ww.registerNotification(function notification( aSubject, - aTopic, - aData + aTopic ) { if (aTopic == "domwindowclosed") { Services.ww.unregisterNotification(notification); @@ -1279,8 +1278,7 @@ this.AntiTracking = { let windowClosed = new content.Promise(resolve => { Services.ww.registerNotification(function notification( aSubject, - aTopic, - aData + aTopic ) { if (aTopic == "domwindowclosed") { Services.ww.unregisterNotification(notification); @@ -1366,12 +1364,12 @@ this.AntiTracking = { function Listener() {} Listener.prototype = { - onStartRequest(request) {}, + onStartRequest() {}, onDataAvailable(request, stream, off, cnt) { // Consume the data to prevent hitting the assertion. NetUtil.readInputStreamToString(stream, cnt); }, - onStopRequest(request, st) { + onStopRequest(request) { let status = request.QueryInterface(Ci.nsIHttpChannel).responseStatus; if (status == 200) { resolve(); diff --git a/toolkit/components/antitracking/test/browser/blobPartitionPage.html b/toolkit/components/antitracking/test/browser/blobPartitionPage.html index d0dd156bc5..d066bb3603 100644 --- a/toolkit/components/antitracking/test/browser/blobPartitionPage.html +++ b/toolkit/components/antitracking/test/browser/blobPartitionPage.html @@ -17,7 +17,7 @@ .then(text => { parent.postMessage(text, "*"); }) - .catch(error => { + .catch(() => { parent.postMessage("error", "*"); }); }; diff --git a/toolkit/components/antitracking/test/browser/browser-blocking.toml b/toolkit/components/antitracking/test/browser/browser-blocking.toml index 4a0aa8f44d..573b8b4d15 100644 --- a/toolkit/components/antitracking/test/browser/browser-blocking.toml +++ b/toolkit/components/antitracking/test/browser/browser-blocking.toml @@ -1,5 +1,9 @@ [DEFAULT] -skip-if = ["os == 'linux' && (asan || tsan)"] # bug 1662229 - task exception +skip-if = [ + "os == 'linux' && os_version == '18.04' && asan", # bug 1662229 - task exception + "os == 'linux' && os_version == '18.04' && tsan", # bug 1662229 - task exception + "debug", # bug 1884982 - takes 20+ minutes to run on debug +] prefs = [ # Disable the Storage Access API prompts for all of the tests in this directory "dom.storage_access.prompt.testing=true", diff --git a/toolkit/components/antitracking/test/browser/browser_aboutblank.js b/toolkit/components/antitracking/test/browser/browser_aboutblank.js index f80a948771..0fc86cc3d2 100644 --- a/toolkit/components/antitracking/test/browser/browser_aboutblank.js +++ b/toolkit/components/antitracking/test/browser/browser_aboutblank.js @@ -23,7 +23,7 @@ add_task(async function test_aboutblankInIframe() { ); let browser = tab.linkedBrowser; - await SpecialPowers.spawn(browser, [], async function (obj) { + await SpecialPowers.spawn(browser, [], async function () { let ifr = content.document.createElement("iframe"); let loading = new content.Promise(resolve => { ifr.onload = resolve; @@ -32,7 +32,7 @@ add_task(async function test_aboutblankInIframe() { content.document.body.appendChild(ifr); await loading; - await SpecialPowers.spawn(ifr, [], async function (obj) { + await SpecialPowers.spawn(ifr, [], async function () { ok( content.navigator.cookieEnabled, "Cookie should be enabled in about blank" diff --git a/toolkit/components/antitracking/test/browser/browser_addonHostPermissionIgnoredInTP.js b/toolkit/components/antitracking/test/browser/browser_addonHostPermissionIgnoredInTP.js index 44664e239a..08613ca415 100644 --- a/toolkit/components/antitracking/test/browser/browser_addonHostPermissionIgnoredInTP.js +++ b/toolkit/components/antitracking/test/browser/browser_addonHostPermissionIgnoredInTP.js @@ -28,7 +28,7 @@ add_task(async function () { let browser = tab.linkedBrowser; info("Verify the number of script nodes found"); - await ContentTask.spawn(browser, [], async function (obj) { + await ContentTask.spawn(browser, [], async function () { // Need to wait a bit for cross-process postMessage... await ContentTaskUtils.waitForCondition( () => content.document.documentElement.getAttribute("count") !== null, diff --git a/toolkit/components/antitracking/test/browser/browser_allowListNotifications.js b/toolkit/components/antitracking/test/browser/browser_allowListNotifications.js index 999c6f93a0..4bc2e3b1ae 100644 --- a/toolkit/components/antitracking/test/browser/browser_allowListNotifications.js +++ b/toolkit/components/antitracking/test/browser/browser_allowListNotifications.js @@ -134,7 +134,7 @@ add_task(async function () { add_task(async function () { info("Cleaning up."); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_allowListNotifications_alwaysPartition.js b/toolkit/components/antitracking/test/browser/browser_allowListNotifications_alwaysPartition.js index 0fd677e27f..62e7aa04e1 100644 --- a/toolkit/components/antitracking/test/browser/browser_allowListNotifications_alwaysPartition.js +++ b/toolkit/components/antitracking/test/browser/browser_allowListNotifications_alwaysPartition.js @@ -135,7 +135,7 @@ add_task(async function () { add_task(async function () { info("Cleaning up."); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_allowListSeparationInPrivateAndNormalWindows.js b/toolkit/components/antitracking/test/browser/browser_allowListSeparationInPrivateAndNormalWindows.js index 38eb9fc090..64eb39795a 100644 --- a/toolkit/components/antitracking/test/browser/browser_allowListSeparationInPrivateAndNormalWindows.js +++ b/toolkit/components/antitracking/test/browser/browser_allowListSeparationInPrivateAndNormalWindows.js @@ -39,7 +39,7 @@ AntiTracking.runTest( // Cleanup callback async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_allowPermissionForTracker.js b/toolkit/components/antitracking/test/browser/browser_allowPermissionForTracker.js index e628199ead..bec8da9ba5 100644 --- a/toolkit/components/antitracking/test/browser/browser_allowPermissionForTracker.js +++ b/toolkit/components/antitracking/test/browser/browser_allowPermissionForTracker.js @@ -32,6 +32,8 @@ AntiTracking._createTask({ allowList: false, callback: async _ => { document.cookie = "name=value"; + // Assert isn't available in the webpage. + // eslint-disable-next-line mozilla/no-comparison-or-assignment-inside-ok ok(document.cookie != "", "Nothing is blocked"); // requestStorageAccess should resolve @@ -57,7 +59,7 @@ AntiTracking._createTask({ add_task(async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_backgroundImageAssertion.js b/toolkit/components/antitracking/test/browser/browser_backgroundImageAssertion.js index 16eec0da9e..27fbdfe971 100644 --- a/toolkit/components/antitracking/test/browser/browser_backgroundImageAssertion.js +++ b/toolkit/components/antitracking/test/browser/browser_backgroundImageAssertion.js @@ -62,7 +62,7 @@ add_task(async function () { add_task(async function () { info("Cleaning up."); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_blockingCookies.js b/toolkit/components/antitracking/test/browser/browser_blockingCookies.js index dc22ad77b9..bedbccea83 100644 --- a/toolkit/components/antitracking/test/browser/browser_blockingCookies.js +++ b/toolkit/components/antitracking/test/browser/browser_blockingCookies.js @@ -66,7 +66,7 @@ AntiTracking.runTestInNormalAndPrivateMode( // Cleanup callback async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -172,7 +172,7 @@ AntiTracking.runTestInNormalAndPrivateMode( // Cleanup callback async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_blockingDOMCache.js b/toolkit/components/antitracking/test/browser/browser_blockingDOMCache.js index a8353cc8f1..9bc418ac8f 100644 --- a/toolkit/components/antitracking/test/browser/browser_blockingDOMCache.js +++ b/toolkit/components/antitracking/test/browser/browser_blockingDOMCache.js @@ -24,7 +24,7 @@ AntiTracking.runTest( }, async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_blockingDOMCacheAlwaysPartition.js b/toolkit/components/antitracking/test/browser/browser_blockingDOMCacheAlwaysPartition.js index 4cb90af8ad..dc50cb387e 100644 --- a/toolkit/components/antitracking/test/browser/browser_blockingDOMCacheAlwaysPartition.js +++ b/toolkit/components/antitracking/test/browser/browser_blockingDOMCacheAlwaysPartition.js @@ -42,7 +42,7 @@ AntiTracking.runTest( }, async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_blockingDOMCacheAlwaysPartitionSAA.js b/toolkit/components/antitracking/test/browser/browser_blockingDOMCacheAlwaysPartitionSAA.js index bef53f2936..09321a3e67 100644 --- a/toolkit/components/antitracking/test/browser/browser_blockingDOMCacheAlwaysPartitionSAA.js +++ b/toolkit/components/antitracking/test/browser/browser_blockingDOMCacheAlwaysPartitionSAA.js @@ -66,7 +66,7 @@ AntiTracking.runTest( }, async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_blockingDOMCacheSAA.js b/toolkit/components/antitracking/test/browser/browser_blockingDOMCacheSAA.js index 06526972dd..c689110ee3 100644 --- a/toolkit/components/antitracking/test/browser/browser_blockingDOMCacheSAA.js +++ b/toolkit/components/antitracking/test/browser/browser_blockingDOMCacheSAA.js @@ -68,7 +68,7 @@ AntiTracking.runTest( }, async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_blockingIndexedDb.js b/toolkit/components/antitracking/test/browser/browser_blockingIndexedDb.js index 7fde2365bb..5879eac590 100644 --- a/toolkit/components/antitracking/test/browser/browser_blockingIndexedDb.js +++ b/toolkit/components/antitracking/test/browser/browser_blockingIndexedDb.js @@ -20,7 +20,7 @@ AntiTracking.runTestInNormalAndPrivateMode( // Cleanup callback async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -91,7 +91,7 @@ AntiTracking.runTestInNormalAndPrivateMode( // Cleanup callback async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_blockingIndexedDbInWorkers.js b/toolkit/components/antitracking/test/browser/browser_blockingIndexedDbInWorkers.js index 55db3cc05b..7efb26d5d1 100644 --- a/toolkit/components/antitracking/test/browser/browser_blockingIndexedDbInWorkers.js +++ b/toolkit/components/antitracking/test/browser/browser_blockingIndexedDbInWorkers.js @@ -28,7 +28,7 @@ AntiTracking.runTestInNormalAndPrivateMode( } }; - worker.onerror = function (e) { + worker.onerror = function () { reject(); }; }); @@ -57,14 +57,14 @@ AntiTracking.runTestInNormalAndPrivateMode( } }; - worker.onerror = function (e) { + worker.onerror = function () { reject(); }; }); }, async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_blockingIndexedDbInWorkers2.js b/toolkit/components/antitracking/test/browser/browser_blockingIndexedDbInWorkers2.js index 02ce8dc588..10e6b8c248 100644 --- a/toolkit/components/antitracking/test/browser/browser_blockingIndexedDbInWorkers2.js +++ b/toolkit/components/antitracking/test/browser/browser_blockingIndexedDbInWorkers2.js @@ -37,7 +37,7 @@ AntiTracking.runTestInNormalAndPrivateMode( } }; - worker.onerror = function (e) { + worker.onerror = function () { reject(); }; }); @@ -80,7 +80,7 @@ AntiTracking.runTestInNormalAndPrivateMode( } }; - worker.onerror = function (e) { + worker.onerror = function () { reject(); }; }); @@ -112,7 +112,7 @@ AntiTracking.runTestInNormalAndPrivateMode( } }; - worker.onerror = function (e) { + worker.onerror = function () { reject(); }; }); @@ -134,14 +134,14 @@ AntiTracking.runTestInNormalAndPrivateMode( } }; - worker.onerror = function (e) { + worker.onerror = function () { reject(); }; }); }, async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_blockingLocalStorage.js b/toolkit/components/antitracking/test/browser/browser_blockingLocalStorage.js index 1362fc7519..c52b676642 100644 --- a/toolkit/components/antitracking/test/browser/browser_blockingLocalStorage.js +++ b/toolkit/components/antitracking/test/browser/browser_blockingLocalStorage.js @@ -17,7 +17,7 @@ AntiTracking.runTestInNormalAndPrivateMode( }, async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -83,7 +83,7 @@ AntiTracking.runTestInNormalAndPrivateMode( }, async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_blockingMessaging.js b/toolkit/components/antitracking/test/browser/browser_blockingMessaging.js index 34af2b76ce..054616460f 100644 --- a/toolkit/components/antitracking/test/browser/browser_blockingMessaging.js +++ b/toolkit/components/antitracking/test/browser/browser_blockingMessaging.js @@ -21,7 +21,7 @@ AntiTracking.runTestInNormalAndPrivateMode( }, async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -58,7 +58,7 @@ AntiTracking.runTestInNormalAndPrivateMode( } }; - worker.onerror = function (e) { + worker.onerror = function () { reject(); }; }); @@ -87,14 +87,14 @@ AntiTracking.runTestInNormalAndPrivateMode( } }; - worker.onerror = function (e) { + worker.onerror = function () { reject(); }; }); }, async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -159,7 +159,7 @@ AntiTracking.runTestInNormalAndPrivateMode( }, async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -206,7 +206,7 @@ AntiTracking.runTestInNormalAndPrivateMode( } }; - worker.onerror = function (e) { + worker.onerror = function () { reject(); }; }); @@ -250,7 +250,7 @@ AntiTracking.runTestInNormalAndPrivateMode( } }; - worker.onerror = function (e) { + worker.onerror = function () { reject(); }; }); @@ -282,7 +282,7 @@ AntiTracking.runTestInNormalAndPrivateMode( } }; - worker.onerror = function (e) { + worker.onerror = function () { reject(); }; }); @@ -304,14 +304,14 @@ AntiTracking.runTestInNormalAndPrivateMode( } }; - worker.onerror = function (e) { + worker.onerror = function () { reject(); }; }); }, async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_blockingNoOpener.js b/toolkit/components/antitracking/test/browser/browser_blockingNoOpener.js index ba75454e18..05bf0c8a26 100644 --- a/toolkit/components/antitracking/test/browser/browser_blockingNoOpener.js +++ b/toolkit/components/antitracking/test/browser/browser_blockingNoOpener.js @@ -30,7 +30,7 @@ AntiTracking.runTestInNormalAndPrivateMode( }, async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_blockingServiceWorkers.js b/toolkit/components/antitracking/test/browser/browser_blockingServiceWorkers.js index c61f85d69f..e730f7df6f 100644 --- a/toolkit/components/antitracking/test/browser/browser_blockingServiceWorkers.js +++ b/toolkit/components/antitracking/test/browser/browser_blockingServiceWorkers.js @@ -16,7 +16,7 @@ AntiTracking.runTest( null, async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_blockingServiceWorkersStorageAccessAPI.js b/toolkit/components/antitracking/test/browser/browser_blockingServiceWorkersStorageAccessAPI.js index a7676bf939..f9d98b4c95 100644 --- a/toolkit/components/antitracking/test/browser/browser_blockingServiceWorkersStorageAccessAPI.js +++ b/toolkit/components/antitracking/test/browser/browser_blockingServiceWorkersStorageAccessAPI.js @@ -117,7 +117,7 @@ AntiTracking.runTest( }, async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_blockingSessionStorage.js b/toolkit/components/antitracking/test/browser/browser_blockingSessionStorage.js index 25a926ed3f..1410b57f93 100644 --- a/toolkit/components/antitracking/test/browser/browser_blockingSessionStorage.js +++ b/toolkit/components/antitracking/test/browser/browser_blockingSessionStorage.js @@ -36,7 +36,7 @@ AntiTracking.runTestInNormalAndPrivateMode( }, async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -115,7 +115,7 @@ AntiTracking.runTestInNormalAndPrivateMode( }, async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_blockingSharedWorkers.js b/toolkit/components/antitracking/test/browser/browser_blockingSharedWorkers.js index 0daffc4565..d88146e8ce 100644 --- a/toolkit/components/antitracking/test/browser/browser_blockingSharedWorkers.js +++ b/toolkit/components/antitracking/test/browser/browser_blockingSharedWorkers.js @@ -17,7 +17,7 @@ AntiTracking.runTestInNormalAndPrivateMode( }, async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -83,7 +83,7 @@ AntiTracking.runTestInNormalAndPrivateMode( }, async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_contentBlockingAllowListPrincipal.js b/toolkit/components/antitracking/test/browser/browser_contentBlockingAllowListPrincipal.js index a9e2ac6fce..a94968b228 100644 --- a/toolkit/components/antitracking/test/browser/browser_contentBlockingAllowListPrincipal.js +++ b/toolkit/components/antitracking/test/browser/browser_contentBlockingAllowListPrincipal.js @@ -90,7 +90,7 @@ function createFrame(browser, src, id, sandboxAttr) { ); } -add_task(async setup => { +add_task(async () => { // Disable heuristics. We don't need them and if enabled the resulting // telemetry can race with the telemetry in the next test. // See Bug 1686836, Bug 1686894. @@ -108,7 +108,7 @@ add_task(async setup => { * Test that we get the correct allow list principal which matches the content * principal for an https site. */ -add_task(async test_contentPrincipalHTTPS => { +add_task(async () => { await runTestInNormalAndPrivateMode("https://example.com", browser => { checkAllowListPrincipal(browser, "content"); }); @@ -118,7 +118,7 @@ add_task(async test_contentPrincipalHTTPS => { * Tests that the scheme of the allowlist principal is HTTPS, even though the * site is loaded via HTTP. */ -add_task(async test_contentPrincipalHTTP => { +add_task(async () => { await runTestInNormalAndPrivateMode( "http://example.net", (browser, isPrivateBrowsing) => { @@ -136,7 +136,7 @@ add_task(async test_contentPrincipalHTTP => { * Tests that the allow list principal is a system principal for the preferences * about site. */ -add_task(async test_systemPrincipal => { +add_task(async () => { await runTestInNormalAndPrivateMode("about:preferences", browser => { checkAllowListPrincipal(browser, "system"); }); @@ -146,7 +146,7 @@ add_task(async test_systemPrincipal => { * Tests that we get a valid content principal for top level sandboxed pages, * and not the document principal which is a null principal. */ -add_task(async test_TopLevelSandbox => { +add_task(async () => { await runTestInNormalAndPrivateMode( TEST_SANDBOX_URL, (browser, isPrivateBrowsing) => { @@ -168,7 +168,7 @@ add_task(async test_TopLevelSandbox => { * Tests that we get a valid content principal for a new tab opened via * window.open. */ -add_task(async test_windowOpen => { +add_task(async () => { await runTestInNormalAndPrivateMode("https://example.com", async browser => { checkAllowListPrincipal(browser, "content"); @@ -195,7 +195,7 @@ add_task(async test_windowOpen => { * Tests that we get a valid content principal for a new tab opened via * window.open from a sandboxed iframe. */ -add_task(async test_windowOpenFromSandboxedFrame => { +add_task(async () => { await runTestInNormalAndPrivateMode( "https://example.com", async (browser, isPrivateBrowsing) => { diff --git a/toolkit/components/antitracking/test/browser/browser_contentBlockingTelemetry.js b/toolkit/components/antitracking/test/browser/browser_contentBlockingTelemetry.js index 1e006541c8..8e74c454f0 100644 --- a/toolkit/components/antitracking/test/browser/browser_contentBlockingTelemetry.js +++ b/toolkit/components/antitracking/test/browser/browser_contentBlockingTelemetry.js @@ -336,8 +336,7 @@ add_task(async function testTelemetryForUserInteractionHeuristic() { let windowClosed = new content.Promise(resolve => { Services.ww.registerNotification(function notification( aSubject, - aTopic, - aData + aTopic ) { // We need to check the document URI here as well for the same // reason above. diff --git a/toolkit/components/antitracking/test/browser/browser_cookieBetweenTabs.js b/toolkit/components/antitracking/test/browser/browser_cookieBetweenTabs.js index 635f145d46..f6a9f7521d 100644 --- a/toolkit/components/antitracking/test/browser/browser_cookieBetweenTabs.js +++ b/toolkit/components/antitracking/test/browser/browser_cookieBetweenTabs.js @@ -52,7 +52,7 @@ add_task(async function () { BrowserTestUtils.removeTab(tab2); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_denyPermissionForTracker.js b/toolkit/components/antitracking/test/browser/browser_denyPermissionForTracker.js index cd19fa4466..0c13bdf0fb 100644 --- a/toolkit/components/antitracking/test/browser/browser_denyPermissionForTracker.js +++ b/toolkit/components/antitracking/test/browser/browser_denyPermissionForTracker.js @@ -57,7 +57,7 @@ AntiTracking._createTask({ add_task(async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_doublyNestedTracker.js b/toolkit/components/antitracking/test/browser/browser_doublyNestedTracker.js index c15e3abd5f..4f38b29a7d 100644 --- a/toolkit/components/antitracking/test/browser/browser_doublyNestedTracker.js +++ b/toolkit/components/antitracking/test/browser/browser_doublyNestedTracker.js @@ -123,7 +123,7 @@ add_task(async function () { info("Cleaning up."); SpecialPowers.clearUserPref("network.cookie.sameSite.laxByDefault"); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_existingCookiesForSubresources.js b/toolkit/components/antitracking/test/browser/browser_existingCookiesForSubresources.js index 35e9dfb169..76b5602f7c 100644 --- a/toolkit/components/antitracking/test/browser/browser_existingCookiesForSubresources.js +++ b/toolkit/components/antitracking/test/browser/browser_existingCookiesForSubresources.js @@ -228,7 +228,7 @@ add_task(async function () { add_task(async function () { info("Cleaning up."); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_firstPartyCookieRejectionHonoursAllowList.js b/toolkit/components/antitracking/test/browser/browser_firstPartyCookieRejectionHonoursAllowList.js index d3d06d2950..6aaed74331 100644 --- a/toolkit/components/antitracking/test/browser/browser_firstPartyCookieRejectionHonoursAllowList.js +++ b/toolkit/components/antitracking/test/browser/browser_firstPartyCookieRejectionHonoursAllowList.js @@ -27,7 +27,7 @@ add_task(async function () { // The previous function reloads the browser, so wait for it to load again! await BrowserTestUtils.browserLoaded(browser); - await SpecialPowers.spawn(browser, [], async function (obj) { + await SpecialPowers.spawn(browser, [], async function () { await new content.Promise(async resolve => { let document = content.document; let window = document.defaultView; @@ -70,7 +70,7 @@ add_task(async function () { add_task(async function () { info("Cleaning up."); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_hasStorageAccess.js b/toolkit/components/antitracking/test/browser/browser_hasStorageAccess.js index a2733f0a53..3d62306b7d 100644 --- a/toolkit/components/antitracking/test/browser/browser_hasStorageAccess.js +++ b/toolkit/components/antitracking/test/browser/browser_hasStorageAccess.js @@ -209,7 +209,7 @@ var testCases = [ add_task(async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_hasStorageAccess_alwaysPartition.js b/toolkit/components/antitracking/test/browser/browser_hasStorageAccess_alwaysPartition.js index ea52ff2fad..aca766f673 100644 --- a/toolkit/components/antitracking/test/browser/browser_hasStorageAccess_alwaysPartition.js +++ b/toolkit/components/antitracking/test/browser/browser_hasStorageAccess_alwaysPartition.js @@ -218,7 +218,7 @@ var testCases = [ add_task(async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_localStorageEvents.js b/toolkit/components/antitracking/test/browser/browser_localStorageEvents.js index b46cc60b91..b7abad2d94 100644 --- a/toolkit/components/antitracking/test/browser/browser_localStorageEvents.js +++ b/toolkit/components/antitracking/test/browser/browser_localStorageEvents.js @@ -92,7 +92,7 @@ add_task(async function testLocalStorageEventPropagation() { info("Cleaning up."); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -179,7 +179,7 @@ add_task(async function testBlockedLocalStorageEventPropagation() { info("Cleaning up."); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_onModifyRequestNotificationForTrackingResources.js b/toolkit/components/antitracking/test/browser/browser_onModifyRequestNotificationForTrackingResources.js index 0674b87136..a05f1219ba 100644 --- a/toolkit/components/antitracking/test/browser/browser_onModifyRequestNotificationForTrackingResources.js +++ b/toolkit/components/antitracking/test/browser/browser_onModifyRequestNotificationForTrackingResources.js @@ -10,8 +10,8 @@ let gExpectedResourcesSeen = 0; async function onModifyRequest() { - return new Promise((resolve, reject) => { - Services.obs.addObserver(function observer(subject, topic, data) { + return new Promise(resolve => { + Services.obs.addObserver(function observer(subject) { let httpChannel = subject.QueryInterface(Ci.nsIHttpChannel); let spec = httpChannel.URI.spec; info("Observed channel for " + spec); diff --git a/toolkit/components/antitracking/test/browser/browser_partitionedConsoleMessage.js b/toolkit/components/antitracking/test/browser/browser_partitionedConsoleMessage.js index ce74076825..bb8cdce3da 100644 --- a/toolkit/components/antitracking/test/browser/browser_partitionedConsoleMessage.js +++ b/toolkit/components/antitracking/test/browser/browser_partitionedConsoleMessage.js @@ -73,7 +73,7 @@ add_task(async function runTest() { info("Clean up"); BrowserTestUtils.removeTab(tab); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_partitionedCookies.js b/toolkit/components/antitracking/test/browser/browser_partitionedCookies.js index d2d1e87dd4..d2e88795b1 100644 --- a/toolkit/components/antitracking/test/browser/browser_partitionedCookies.js +++ b/toolkit/components/antitracking/test/browser/browser_partitionedCookies.js @@ -1,7 +1,9 @@ PartitionedStorageHelper.runTestInNormalAndPrivateMode( "HTTP Cookies", async (win3rdParty, win1stParty, allowed) => { - await win3rdParty.fetch("cookies.sjs?3rd").then(r => r.text()); + await win3rdParty + .fetch("cookies.sjs?3rd;Partitioned;Secure") + .then(r => r.text()); await win3rdParty .fetch("cookies.sjs") .then(r => r.text()) @@ -39,7 +41,7 @@ PartitionedStorageHelper.runTestInNormalAndPrivateMode( async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -49,7 +51,7 @@ PartitionedStorageHelper.runTestInNormalAndPrivateMode( PartitionedStorageHelper.runTestInNormalAndPrivateMode( "DOM Cookies", async (win3rdParty, win1stParty, allowed) => { - win3rdParty.document.cookie = "foo=3rd"; + win3rdParty.document.cookie = "foo=3rd;Partitioned;Secure"; is(win3rdParty.document.cookie, "foo=3rd", "3rd party cookie set"); win1stParty.document.cookie = "foo=first"; @@ -72,7 +74,7 @@ PartitionedStorageHelper.runTestInNormalAndPrivateMode( async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -90,14 +92,14 @@ PartitionedStorageHelper.runPartitioningTestInNormalAndPrivateMode( // addDataCallback async (win, value) => { - win.document.cookie = value; + win.document.cookie = value + ";Partitioned;Secure"; return true; }, // cleanup async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -121,14 +123,16 @@ PartitionedStorageHelper.runPartitioningTestInNormalAndPrivateMode( // addDataCallback async (win, value) => { - await win.fetch("cookies.sjs?" + value).then(r => r.text()); + await win + .fetch("cookies.sjs?" + value + ";Partitioned;Secure") + .then(r => r.text()); return true; }, // cleanup async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_partitionedDOMCache.js b/toolkit/components/antitracking/test/browser/browser_partitionedDOMCache.js index 8f901e2977..920f0a1849 100644 --- a/toolkit/components/antitracking/test/browser/browser_partitionedDOMCache.js +++ b/toolkit/components/antitracking/test/browser/browser_partitionedDOMCache.js @@ -25,7 +25,7 @@ PartitionedStorageHelper.runTest( async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -38,7 +38,7 @@ PartitionedStorageHelper.runTest( PartitionedStorageHelper.runTest( "DOMCache", - async (win3rdParty, win1stParty, allowed) => { + async (win3rdParty, win1stParty) => { await win1stParty.caches.open("wow").then( async cache => { ok(true, "DOM Cache should be available"); @@ -62,7 +62,7 @@ PartitionedStorageHelper.runTest( async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -76,9 +76,9 @@ PartitionedStorageHelper.runTest( // Test that DOM cache is also available in PBM. PartitionedStorageHelper.runTest( "DOMCache", - async (win3rdParty, win1stParty, allowed) => { + async (win3rdParty, win1stParty) => { await win1stParty.caches.open("wow").then( - async cache => { + async () => { ok(true, "DOM Cache should be available in PBM"); }, _ => { @@ -87,7 +87,7 @@ PartitionedStorageHelper.runTest( ); await win3rdParty.caches.open("wow").then( - async cache => { + async () => { ok(true, "DOM Cache should be available in PBM"); }, _ => { @@ -98,7 +98,7 @@ PartitionedStorageHelper.runTest( async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_partitionedIndexedDB.js b/toolkit/components/antitracking/test/browser/browser_partitionedIndexedDB.js index 70dd0b03db..683f90e835 100644 --- a/toolkit/components/antitracking/test/browser/browser_partitionedIndexedDB.js +++ b/toolkit/components/antitracking/test/browser/browser_partitionedIndexedDB.js @@ -1,6 +1,6 @@ PartitionedStorageHelper.runTest( "IndexedDB", - async (win3rdParty, win1stParty, allowed) => { + async (win3rdParty, win1stParty) => { await new Promise(resolve => { let a = win1stParty.indexedDB.open("test", 1); ok(!!a, "IDB should not be blocked in 1st party contexts"); @@ -34,7 +34,7 @@ PartitionedStorageHelper.runTest( async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -87,7 +87,7 @@ PartitionedStorageHelper.runPartitioningTest( // cleanup async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_partitionedLocalStorage.js b/toolkit/components/antitracking/test/browser/browser_partitionedLocalStorage.js index fe45970132..583f4bacdc 100644 --- a/toolkit/components/antitracking/test/browser/browser_partitionedLocalStorage.js +++ b/toolkit/components/antitracking/test/browser/browser_partitionedLocalStorage.js @@ -74,7 +74,7 @@ AntiTracking.runTestInNormalAndPrivateMode( }, async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -107,7 +107,7 @@ PartitionedStorageHelper.runPartitioningTestInNormalAndPrivateMode( // cleanup async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_partitionedLocalStorage_events.js b/toolkit/components/antitracking/test/browser/browser_partitionedLocalStorage_events.js index 14ca62d062..afbcc79022 100644 --- a/toolkit/components/antitracking/test/browser/browser_partitionedLocalStorage_events.js +++ b/toolkit/components/antitracking/test/browser/browser_partitionedLocalStorage_events.js @@ -999,7 +999,7 @@ function runAllTests(prefValue) { // Cleanup data. add_task(async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_partitionedLockManager.js b/toolkit/components/antitracking/test/browser/browser_partitionedLockManager.js index 21c3c9637d..342a68bf31 100644 --- a/toolkit/components/antitracking/test/browser/browser_partitionedLockManager.js +++ b/toolkit/components/antitracking/test/browser/browser_partitionedLockManager.js @@ -2,7 +2,7 @@ PartitionedStorageHelper.runTest( "LockManager works in both first and third party contexts", - async (win3rdParty, win1stParty, allowed) => { + async (win3rdParty, win1stParty) => { let locks = []; ok(win1stParty.isSecureContext, "1st party is in a secure context"); ok(win3rdParty.isSecureContext, "3rd party is in a secure context"); @@ -20,7 +20,7 @@ PartitionedStorageHelper.runTest( }, async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_partitionedMessaging.js b/toolkit/components/antitracking/test/browser/browser_partitionedMessaging.js index 683b1cc874..d08c1f8b7a 100644 --- a/toolkit/components/antitracking/test/browser/browser_partitionedMessaging.js +++ b/toolkit/components/antitracking/test/browser/browser_partitionedMessaging.js @@ -1,6 +1,6 @@ PartitionedStorageHelper.runTestInNormalAndPrivateMode( "BroadcastChannel", - async (win3rdParty, win1stParty, allowed) => { + async (win3rdParty, win1stParty) => { let a = new win3rdParty.BroadcastChannel("hello"); ok(!!a, "BroadcastChannel should be created by 3rd party iframe"); @@ -12,7 +12,7 @@ PartitionedStorageHelper.runTestInNormalAndPrivateMode( }, async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_partitionedServiceWorkers.js b/toolkit/components/antitracking/test/browser/browser_partitionedServiceWorkers.js index 5fca844dfe..bb9baa460f 100644 --- a/toolkit/components/antitracking/test/browser/browser_partitionedServiceWorkers.js +++ b/toolkit/components/antitracking/test/browser/browser_partitionedServiceWorkers.js @@ -25,7 +25,7 @@ PartitionedStorageHelper.runTest( async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -42,7 +42,7 @@ PartitionedStorageHelper.runTest( PartitionedStorageHelper.runTest( "ServiceWorkers - enable partitioning", - async (win3rdParty, win1stParty, allowed) => { + async (win3rdParty, win1stParty) => { // Partitioned serviceWorkers are enabled in third-party context. await win3rdParty.navigator.serviceWorker.register("empty.js").then( _ => { @@ -71,7 +71,7 @@ PartitionedStorageHelper.runTest( async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -88,7 +88,7 @@ PartitionedStorageHelper.runTest( PartitionedStorageHelper.runTest( "ServiceWorkers - MatchAll", - async (win3rdParty, win1stParty, allowed) => { + async (win3rdParty, win1stParty) => { if (!win1stParty.sw) { win1stParty.sw = await registerServiceWorker(win1stParty, "matchAll.js"); } @@ -113,7 +113,7 @@ PartitionedStorageHelper.runTest( async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -130,7 +130,7 @@ PartitionedStorageHelper.runTest( PartitionedStorageHelper.runTest( "ServiceWorkers - Partition ScriptContext", - async (win3rdParty, win1stParty, allowed) => { + async (win3rdParty, win1stParty) => { // Register service worker for the first-party window. if (!win1stParty.sw) { win1stParty.sw = await registerServiceWorker( @@ -197,7 +197,7 @@ PartitionedStorageHelper.runTest( async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -214,7 +214,7 @@ PartitionedStorageHelper.runTest( PartitionedStorageHelper.runTest( "ServiceWorkers - Partition DOM Cache", - async (win3rdParty, win1stParty, allowed) => { + async (win3rdParty, win1stParty) => { // Register service worker for the first-party window. if (!win1stParty.sw) { win1stParty.sw = await registerServiceWorker( @@ -299,7 +299,7 @@ PartitionedStorageHelper.runTest( async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -316,7 +316,7 @@ PartitionedStorageHelper.runTest( PartitionedStorageHelper.runTest( "ServiceWorkers - Partition IndexedDB", - async (win3rdParty, win1stParty, allowed) => { + async (win3rdParty, win1stParty) => { // Register service worker for the first-party window. if (!win1stParty.sw) { win1stParty.sw = await registerServiceWorker( @@ -383,7 +383,7 @@ PartitionedStorageHelper.runTest( async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -400,7 +400,7 @@ PartitionedStorageHelper.runTest( PartitionedStorageHelper.runTest( "ServiceWorkers - Partition Intercept", - async (win3rdParty, win1stParty, allowed) => { + async (win3rdParty, win1stParty) => { // Register service worker for the first-party window. if (!win1stParty.sw) { win1stParty.sw = await registerServiceWorker( @@ -470,7 +470,7 @@ PartitionedStorageHelper.runTest( async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -547,7 +547,7 @@ PartitionedStorageHelper.runTest( async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -594,7 +594,7 @@ PartitionedStorageHelper.runTest( // Post a message to the dedicated worker and wait until the message circles // back. await new Promise(resolve => { - thirdPartyWorker.port.onmessage = msg => { + thirdPartyWorker.port.onmessage = () => { resolve(); }; thirdPartyWorker.onerror = _ => { @@ -609,7 +609,7 @@ PartitionedStorageHelper.runTest( async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -626,7 +626,7 @@ PartitionedStorageHelper.runTest( PartitionedStorageHelper.runTest( "ServiceWorkers - Private Browsing with partitioning disabled", - async (win3rdParty, win1stParty, allowed) => { + async (win3rdParty, win1stParty) => { // Partitioned serviceWorkers are disabled in third-party context. ok( !win3rdParty.navigator.serviceWorker, @@ -640,7 +640,7 @@ PartitionedStorageHelper.runTest( async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -661,7 +661,7 @@ PartitionedStorageHelper.runTest( PartitionedStorageHelper.runTest( "ServiceWorkers - Private Browsing with partitioning enabled", - async (win3rdParty, win1stParty, allowed) => { + async (win3rdParty, win1stParty) => { // Partitioned serviceWorkers are disabled in third-party context. ok( !win3rdParty.navigator.serviceWorker, @@ -675,7 +675,7 @@ PartitionedStorageHelper.runTest( async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_partitionedSharedWorkers.js b/toolkit/components/antitracking/test/browser/browser_partitionedSharedWorkers.js index 97c58c5217..10f69a51df 100644 --- a/toolkit/components/antitracking/test/browser/browser_partitionedSharedWorkers.js +++ b/toolkit/components/antitracking/test/browser/browser_partitionedSharedWorkers.js @@ -1,6 +1,6 @@ PartitionedStorageHelper.runTestInNormalAndPrivateMode( "SharedWorkers", - async (win3rdParty, win1stParty, allowed) => { + async (win3rdParty, win1stParty) => { // This test fails if run with an HTTPS 3rd-party URL because the shared worker // which would start from the window opened from 3rdPartyStorage.html will become // secure context and per step 11.4.3 of @@ -40,7 +40,7 @@ PartitionedStorageHelper.runTestInNormalAndPrivateMode( async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_permissionInNormalWindows.js b/toolkit/components/antitracking/test/browser/browser_permissionInNormalWindows.js index 69c5902a91..c8b4ac5dcb 100644 --- a/toolkit/components/antitracking/test/browser/browser_permissionInNormalWindows.js +++ b/toolkit/components/antitracking/test/browser/browser_permissionInNormalWindows.js @@ -1,3 +1,6 @@ +// We're using custom message passing so don't have access to Assert.foo +// everywhere. Disable the linter: +/* eslint-disable mozilla/no-comparison-or-assignment-inside-ok */ AntiTracking.runTest( "Test whether we receive any persistent permissions in normal windows", // Blocking callback @@ -94,7 +97,7 @@ AntiTracking.runTest( // Cleanup callback async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_permissionInNormalWindows_alwaysPartition.js b/toolkit/components/antitracking/test/browser/browser_permissionInNormalWindows_alwaysPartition.js index 99c40bb0de..e2eaa6831a 100644 --- a/toolkit/components/antitracking/test/browser/browser_permissionInNormalWindows_alwaysPartition.js +++ b/toolkit/components/antitracking/test/browser/browser_permissionInNormalWindows_alwaysPartition.js @@ -1,3 +1,7 @@ +// We're using custom message passing so don't have access to Assert.foo +// everywhere. Disable the linter: +/* eslint-disable mozilla/no-comparison-or-assignment-inside-ok */ + AntiTracking.runTest( "Test whether we receive any persistent permissions in normal windows", // Blocking callback @@ -94,7 +98,7 @@ AntiTracking.runTest( // Cleanup callback async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_permissionInPrivateWindows.js b/toolkit/components/antitracking/test/browser/browser_permissionInPrivateWindows.js index 84f8d82420..3786634cc2 100644 --- a/toolkit/components/antitracking/test/browser/browser_permissionInPrivateWindows.js +++ b/toolkit/components/antitracking/test/browser/browser_permissionInPrivateWindows.js @@ -35,7 +35,7 @@ AntiTracking.runTest( // Cleanup callback async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_permissionInPrivateWindows_alwaysPartition.js b/toolkit/components/antitracking/test/browser/browser_permissionInPrivateWindows_alwaysPartition.js index 6ebcfae5a2..352dbae11d 100644 --- a/toolkit/components/antitracking/test/browser/browser_permissionInPrivateWindows_alwaysPartition.js +++ b/toolkit/components/antitracking/test/browser/browser_permissionInPrivateWindows_alwaysPartition.js @@ -35,7 +35,7 @@ AntiTracking.runTest( // Cleanup callback async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_permissionPropagation.js b/toolkit/components/antitracking/test/browser/browser_permissionPropagation.js index 73dc9e7145..fb869087cd 100644 --- a/toolkit/components/antitracking/test/browser/browser_permissionPropagation.js +++ b/toolkit/components/antitracking/test/browser/browser_permissionPropagation.js @@ -229,7 +229,7 @@ add_task(async function testPermissionGrantedOn3rdParty() { let browser4 = gBrowser.getBrowserForTab(tab4); info("Grant storage permission to the first iframe in the first tab"); - await SpecialPowers.spawn(browser1, [page, msg], async function (page, msg) { + await SpecialPowers.spawn(browser1, [page, msg], async function () { await new content.Promise(resolve => { content.addEventListener("message", function msg(event) { if (event.data.type == "finish") { @@ -289,7 +289,7 @@ add_task(async function testPermissionGrantedOn3rdParty() { add_task(async function () { info("Cleaning up."); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -419,7 +419,7 @@ add_task(async function testPermissionGrantedOnFirstParty() { add_task(async function () { info("Cleaning up."); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_referrerDefaultPolicy.js b/toolkit/components/antitracking/test/browser/browser_referrerDefaultPolicy.js index e9030b98e4..7e5bba37bb 100644 --- a/toolkit/components/antitracking/test/browser/browser_referrerDefaultPolicy.js +++ b/toolkit/components/antitracking/test/browser/browser_referrerDefaultPolicy.js @@ -627,7 +627,7 @@ add_task(async function () { add_task(async function () { info("Cleaning up."); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_script.js b/toolkit/components/antitracking/test/browser/browser_script.js index ef6c7f67c6..952e26c1d4 100644 --- a/toolkit/components/antitracking/test/browser/browser_script.js +++ b/toolkit/components/antitracking/test/browser/browser_script.js @@ -217,7 +217,7 @@ add_task(async function () { add_task(async function () { info("Cleaning up."); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_siteSpecificWorkArounds.js b/toolkit/components/antitracking/test/browser/browser_siteSpecificWorkArounds.js index b35fbea8c7..89eeeb089e 100644 --- a/toolkit/components/antitracking/test/browser/browser_siteSpecificWorkArounds.js +++ b/toolkit/components/antitracking/test/browser/browser_siteSpecificWorkArounds.js @@ -30,7 +30,7 @@ AntiTracking.runTest( }, async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -74,7 +74,7 @@ AntiTracking.runTest( }, async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -108,7 +108,7 @@ AntiTracking.runTest( }, async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -137,7 +137,7 @@ AntiTracking.runTest( }, async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_socialtracking_save_image.js b/toolkit/components/antitracking/test/browser/browser_socialtracking_save_image.js index e7389b1456..1c74adc0a3 100644 --- a/toolkit/components/antitracking/test/browser/browser_socialtracking_save_image.js +++ b/toolkit/components/antitracking/test/browser/browser_socialtracking_save_image.js @@ -13,7 +13,7 @@ const TEST_IMAGE_URL = "http://social-tracking.example.org/browser/toolkit/components/antitracking/test/browser/raptor.jpg"; let MockFilePicker = SpecialPowers.MockFilePicker; -MockFilePicker.init(window); +MockFilePicker.init(window.browsingContext); const tempDir = createTemporarySaveDirectory(); MockFilePicker.displayDirectory = tempDir; diff --git a/toolkit/components/antitracking/test/browser/browser_staticPartition_cache.js b/toolkit/components/antitracking/test/browser/browser_staticPartition_cache.js index 4d3a72d7a7..9afe3180fb 100644 --- a/toolkit/components/antitracking/test/browser/browser_staticPartition_cache.js +++ b/toolkit/components/antitracking/test/browser/browser_staticPartition_cache.js @@ -21,7 +21,7 @@ async function checkCache(suffixes, originAttributes) { const data = await new Promise(resolve => { let cacheEntries = []; let cacheVisitor = { - onCacheStorageInfo(num, consumption) {}, + onCacheStorageInfo() {}, onCacheEntryInfo(uri, idEnhance) { cacheEntries.push({ uri, idEnhance }); }, diff --git a/toolkit/components/antitracking/test/browser/browser_staticPartition_network.js b/toolkit/components/antitracking/test/browser/browser_staticPartition_network.js index a28f7d5adc..53e410bb03 100644 --- a/toolkit/components/antitracking/test/browser/browser_staticPartition_network.js +++ b/toolkit/components/antitracking/test/browser/browser_staticPartition_network.js @@ -109,7 +109,7 @@ add_task(async function () { add_task(async function () { info("Cleaning up."); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_staticPartition_saveAs.js b/toolkit/components/antitracking/test/browser/browser_staticPartition_saveAs.js index 22db484e16..daf3234858 100644 --- a/toolkit/components/antitracking/test/browser/browser_staticPartition_saveAs.js +++ b/toolkit/components/antitracking/test/browser/browser_staticPartition_saveAs.js @@ -16,7 +16,7 @@ const TEST_VIDEO_URL = TEST_DOMAIN + TEST_PATH + "file_saveAsVideo.sjs"; const TEST_PAGEINFO_URL = TEST_DOMAIN + TEST_PATH + "file_saveAsPageInfo.html"; let MockFilePicker = SpecialPowers.MockFilePicker; -MockFilePicker.init(window); +MockFilePicker.init(window.browsingContext); const tempDir = createTemporarySaveDirectory(); MockFilePicker.displayDirectory = tempDir; @@ -102,6 +102,7 @@ add_task(async function testContextMenuSaveImage() { set: [ ["privacy.partition.network_state", networkIsolation], ["privacy.dynamic_firstparty.use_site", partitionPerSite], + ["dom.block_download_insecure", false], ], }); @@ -197,6 +198,7 @@ add_task(async function testContextMenuSaveVideo() { set: [ ["privacy.partition.network_state", networkIsolation], ["privacy.dynamic_firstparty.use_site", partitionPerSite], + ["dom.block_download_insecure", false], ], }); @@ -370,7 +372,7 @@ add_task(async function testSavePageInOfflineMode() { // Clean up the cache count on the server side. await fetch(`${TEST_IMAGE_URL}?result`); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_staticPartition_tls_session.js b/toolkit/components/antitracking/test/browser/browser_staticPartition_tls_session.js index e131f71169..b15c9d42e0 100644 --- a/toolkit/components/antitracking/test/browser/browser_staticPartition_tls_session.js +++ b/toolkit/components/antitracking/test/browser/browser_staticPartition_tls_session.js @@ -29,7 +29,7 @@ async function waitForLoad(url) { return new Promise(resolve => { const TOPIC = "http-on-examine-response"; - function observer(subject, topic, data) { + function observer(subject, topic) { if (topic != TOPIC) { return; } diff --git a/toolkit/components/antitracking/test/browser/browser_storageAccessDoorHanger.js b/toolkit/components/antitracking/test/browser/browser_storageAccessDoorHanger.js index c922234ed2..715064aa43 100644 --- a/toolkit/components/antitracking/test/browser/browser_storageAccessDoorHanger.js +++ b/toolkit/components/antitracking/test/browser/browser_storageAccessDoorHanger.js @@ -305,7 +305,7 @@ async function cleanUp() { info("Cleaning up."); SpecialPowers.clearUserPref("network.cookie.sameSite.laxByDefault"); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_storageAccessPrivilegeAPI.js b/toolkit/components/antitracking/test/browser/browser_storageAccessPrivilegeAPI.js index 9594fdf270..df3602710a 100644 --- a/toolkit/components/antitracking/test/browser/browser_storageAccessPrivilegeAPI.js +++ b/toolkit/components/antitracking/test/browser/browser_storageAccessPrivilegeAPI.js @@ -62,7 +62,7 @@ function runScriptInSubFrame(browser, id, script) { } function waitStoragePermission(trackingOrigin) { - return TestUtils.topicObserved("perm-changed", (aSubject, aData) => { + return TestUtils.topicObserved("perm-changed", aSubject => { let permission = aSubject.QueryInterface(Ci.nsIPermission); let uri = Services.io.newURI(TEST_DOMAIN); return ( diff --git a/toolkit/components/antitracking/test/browser/browser_storageAccessPromiseRejectHandlerUserInteraction.js b/toolkit/components/antitracking/test/browser/browser_storageAccessPromiseRejectHandlerUserInteraction.js index 835c02e262..f95d760be2 100644 --- a/toolkit/components/antitracking/test/browser/browser_storageAccessPromiseRejectHandlerUserInteraction.js +++ b/toolkit/components/antitracking/test/browser/browser_storageAccessPromiseRejectHandlerUserInteraction.js @@ -17,7 +17,7 @@ AntiTracking.runTest( // cleanup function async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_storageAccessPromiseRejectHandlerUserInteraction_alwaysPartition.js b/toolkit/components/antitracking/test/browser/browser_storageAccessPromiseRejectHandlerUserInteraction_alwaysPartition.js index 21bf8b7639..d1006d2328 100644 --- a/toolkit/components/antitracking/test/browser/browser_storageAccessPromiseRejectHandlerUserInteraction_alwaysPartition.js +++ b/toolkit/components/antitracking/test/browser/browser_storageAccessPromiseRejectHandlerUserInteraction_alwaysPartition.js @@ -17,7 +17,7 @@ AntiTracking.runTest( // cleanup function async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_storageAccessPromiseResolveHandlerUserInteraction.js b/toolkit/components/antitracking/test/browser/browser_storageAccessPromiseResolveHandlerUserInteraction.js index 6db7c4c241..3f44dd9868 100644 --- a/toolkit/components/antitracking/test/browser/browser_storageAccessPromiseResolveHandlerUserInteraction.js +++ b/toolkit/components/antitracking/test/browser/browser_storageAccessPromiseResolveHandlerUserInteraction.js @@ -26,7 +26,7 @@ AntiTracking.runTest( // cleanup function async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_storageAccessRemovalNavigateSubframe.js b/toolkit/components/antitracking/test/browser/browser_storageAccessRemovalNavigateSubframe.js index f658dde790..c3f8b68ab1 100644 --- a/toolkit/components/antitracking/test/browser/browser_storageAccessRemovalNavigateSubframe.js +++ b/toolkit/components/antitracking/test/browser/browser_storageAccessRemovalNavigateSubframe.js @@ -19,7 +19,7 @@ AntiTracking.runTest( // cleanup function async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_storageAccessRemovalNavigateSubframe_alwaysPartition.js b/toolkit/components/antitracking/test/browser/browser_storageAccessRemovalNavigateSubframe_alwaysPartition.js index b4355f2a24..1157865cd4 100644 --- a/toolkit/components/antitracking/test/browser/browser_storageAccessRemovalNavigateSubframe_alwaysPartition.js +++ b/toolkit/components/antitracking/test/browser/browser_storageAccessRemovalNavigateSubframe_alwaysPartition.js @@ -19,7 +19,7 @@ AntiTracking.runTest( // cleanup function async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_storageAccessRemovalNavigateTopframe.js b/toolkit/components/antitracking/test/browser/browser_storageAccessRemovalNavigateTopframe.js index fe79a8d935..06faf41f26 100644 --- a/toolkit/components/antitracking/test/browser/browser_storageAccessRemovalNavigateTopframe.js +++ b/toolkit/components/antitracking/test/browser/browser_storageAccessRemovalNavigateTopframe.js @@ -19,7 +19,7 @@ AntiTracking.runTest( // cleanup function async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_storageAccessRemovalNavigateTopframe_alwaysPartition.js b/toolkit/components/antitracking/test/browser/browser_storageAccessRemovalNavigateTopframe_alwaysPartition.js index 63a0480e83..1cde2c8df3 100644 --- a/toolkit/components/antitracking/test/browser/browser_storageAccessRemovalNavigateTopframe_alwaysPartition.js +++ b/toolkit/components/antitracking/test/browser/browser_storageAccessRemovalNavigateTopframe_alwaysPartition.js @@ -19,7 +19,7 @@ AntiTracking.runTest( // cleanup function async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_storageAccessSandboxed.js b/toolkit/components/antitracking/test/browser/browser_storageAccessSandboxed.js index 85c0d60955..b2aa623d96 100644 --- a/toolkit/components/antitracking/test/browser/browser_storageAccessSandboxed.js +++ b/toolkit/components/antitracking/test/browser/browser_storageAccessSandboxed.js @@ -22,7 +22,7 @@ AntiTracking.runTest( Services.io.newURI(TEST_3RD_PARTY_DOMAIN).host, true, Ci.nsIClearDataService.CLEAR_PERMISSIONS, - value => resolve() + () => resolve() ); }); }, @@ -206,7 +206,7 @@ AntiTracking.runTest( // cleanup function async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -239,7 +239,7 @@ AntiTracking.runTest( Services.io.newURI(TEST_3RD_PARTY_DOMAIN).host, true, Ci.nsIClearDataService.CLEAR_PERMISSIONS, - value => resolve() + () => resolve() ); }); }, diff --git a/toolkit/components/antitracking/test/browser/browser_storageAccessSandboxed_alwaysPartition.js b/toolkit/components/antitracking/test/browser/browser_storageAccessSandboxed_alwaysPartition.js index 1b7f2cdf37..97c4851128 100644 --- a/toolkit/components/antitracking/test/browser/browser_storageAccessSandboxed_alwaysPartition.js +++ b/toolkit/components/antitracking/test/browser/browser_storageAccessSandboxed_alwaysPartition.js @@ -22,7 +22,7 @@ AntiTracking.runTest( Services.io.newURI(TEST_3RD_PARTY_DOMAIN).host, true, Ci.nsIClearDataService.CLEAR_PERMISSIONS, - value => resolve() + () => resolve() ); }); }, @@ -205,7 +205,7 @@ AntiTracking.runTest( // cleanup function async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -238,7 +238,7 @@ AntiTracking.runTest( Services.io.newURI(TEST_3RD_PARTY_DOMAIN).host, true, Ci.nsIClearDataService.CLEAR_PERMISSIONS, - value => resolve() + () => resolve() ); }); }, diff --git a/toolkit/components/antitracking/test/browser/browser_storageAccessThirdPartyChecks.js b/toolkit/components/antitracking/test/browser/browser_storageAccessThirdPartyChecks.js index 8fd60eb2dc..4793ed9325 100644 --- a/toolkit/components/antitracking/test/browser/browser_storageAccessThirdPartyChecks.js +++ b/toolkit/components/antitracking/test/browser/browser_storageAccessThirdPartyChecks.js @@ -54,7 +54,7 @@ AntiTracking._createTask({ add_task(async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -85,7 +85,7 @@ AntiTracking._createTask({ add_task(async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -116,7 +116,7 @@ AntiTracking._createTask({ add_task(async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_storageAccessThirdPartyChecks_alwaysPartition.js b/toolkit/components/antitracking/test/browser/browser_storageAccessThirdPartyChecks_alwaysPartition.js index bf66b515c4..f31c7893d0 100644 --- a/toolkit/components/antitracking/test/browser/browser_storageAccessThirdPartyChecks_alwaysPartition.js +++ b/toolkit/components/antitracking/test/browser/browser_storageAccessThirdPartyChecks_alwaysPartition.js @@ -59,7 +59,7 @@ AntiTracking._createTask({ add_task(async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -87,7 +87,7 @@ AntiTracking._createTask({ add_task(async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -115,7 +115,7 @@ AntiTracking._createTask({ add_task(async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_storageAccessWithDynamicFpi.js b/toolkit/components/antitracking/test/browser/browser_storageAccessWithDynamicFpi.js index b5e950cc5f..440d6bb0b0 100644 --- a/toolkit/components/antitracking/test/browser/browser_storageAccessWithDynamicFpi.js +++ b/toolkit/components/antitracking/test/browser/browser_storageAccessWithDynamicFpi.js @@ -32,7 +32,7 @@ const EXCEPTION_LIST_PREF_NAME = "privacy.restrict3rdpartystorage.skip_list"; async function cleanup() { Services.prefs.clearUserPref(EXCEPTION_LIST_PREF_NAME); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_storageAccessWithHeuristics.js b/toolkit/components/antitracking/test/browser/browser_storageAccessWithHeuristics.js index 5b68975d03..134fe045e8 100644 --- a/toolkit/components/antitracking/test/browser/browser_storageAccessWithHeuristics.js +++ b/toolkit/components/antitracking/test/browser/browser_storageAccessWithHeuristics.js @@ -131,7 +131,7 @@ async function runTestWindowOpenHeuristic(disableHeuristics) { info("Cleaning up."); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -216,7 +216,7 @@ add_task(async function testDoublyNestedWindowOpenHeuristic() { add_task(async function () { info("Cleaning up."); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -296,8 +296,7 @@ async function runTestUserInteractionHeuristic(disableHeuristics) { let windowClosed = new content.Promise(resolve => { Services.ww.registerNotification(function notification( aSubject, - aTopic, - aData + aTopic ) { // We need to check the document URI for Fission. It's because the // 'domwindowclosed' would be triggered twice, one for the @@ -418,8 +417,7 @@ async function runTestUserInteractionHeuristic(disableHeuristics) { let windowClosed = new content.Promise(resolve => { Services.ww.registerNotification(function notification( aSubject, - aTopic, - aData + aTopic ) { // We need to check the document URI here as well for the same // reason above. @@ -479,7 +477,7 @@ async function runTestUserInteractionHeuristic(disableHeuristics) { info("Cleaning up."); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -564,8 +562,7 @@ add_task(async function testDoublyNestedUserInteractionHeuristic() { let windowClosed = new content.Promise(resolve => { Services.ww.registerNotification(function notification( aSubject, - aTopic, - aData + aTopic ) { if (aTopic == "domwindowclosed") { Services.ww.unregisterNotification(notification); @@ -674,8 +671,7 @@ add_task(async function testDoublyNestedUserInteractionHeuristic() { let windowClosed = new content.Promise(resolve => { Services.ww.registerNotification(function notification( aSubject, - aTopic, - aData + aTopic ) { if (aTopic == "domwindowclosed") { Services.ww.unregisterNotification(notification); @@ -732,7 +728,7 @@ add_task(async function () { info("Cleaning up."); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); @@ -893,7 +889,7 @@ async function runTestFirstPartyWindowOpenHeuristic(disableHeuristics) { info("Cleaning up."); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_Arguments.js b/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_Arguments.js index a88fc8bcb3..3356ef00dd 100644 --- a/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_Arguments.js +++ b/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_Arguments.js @@ -110,7 +110,7 @@ add_task(async function testArgumentInCompleteStorageAccessRequest() { add_task(async () => { Services.perms.removeAll(); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_CookieBehavior.js b/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_CookieBehavior.js index ea44a34f24..17b1673422 100644 --- a/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_CookieBehavior.js +++ b/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_CookieBehavior.js @@ -405,7 +405,7 @@ add_task( add_task(async () => { Services.perms.removeAll(); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_CookiePermission.js b/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_CookiePermission.js index 64ead20020..3debdc4580 100644 --- a/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_CookiePermission.js +++ b/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_CookiePermission.js @@ -167,7 +167,7 @@ add_task( add_task(async () => { Services.perms.removeAll(); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_CrossOriginSameSite.js b/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_CrossOriginSameSite.js index ca3e47d8e7..933b42a106 100644 --- a/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_CrossOriginSameSite.js +++ b/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_CrossOriginSameSite.js @@ -155,7 +155,7 @@ add_task(async function testIntermediatePreferenceWriteCrossOrigin() { add_task(async () => { Services.perms.removeAll(); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_Doorhanger.js b/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_Doorhanger.js index e8d6ce9bb1..b8eec5f466 100644 --- a/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_Doorhanger.js +++ b/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_Doorhanger.js @@ -6,7 +6,7 @@ Services.scriptloader.loadSubScript( async function cleanUp() { Services.perms.removeAll(); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_Embed.js b/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_Embed.js index 86f584763c..fc93d41666 100644 --- a/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_Embed.js +++ b/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_Embed.js @@ -148,7 +148,7 @@ add_task(async function cSAR_crossSiteIframe() { add_task(async () => { Services.perms.removeAll(); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_Enable.js b/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_Enable.js index 6ee61cc378..e01c52388e 100644 --- a/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_Enable.js +++ b/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_Enable.js @@ -79,7 +79,7 @@ add_task(async function testExplicitlyEnabled() { add_task(async () => { Services.perms.removeAll(); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_RequireIntermediatePermission.js b/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_RequireIntermediatePermission.js index a5cc6f10b5..94a2522f7e 100644 --- a/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_RequireIntermediatePermission.js +++ b/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_RequireIntermediatePermission.js @@ -54,7 +54,7 @@ add_task(async function testIntermediatePermissionRequired() { add_task(async () => { Services.perms.removeAll(); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_StorageAccessPermission.js b/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_StorageAccessPermission.js index 0b4f3e7273..ae24234d1f 100644 --- a/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_StorageAccessPermission.js +++ b/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_StorageAccessPermission.js @@ -87,7 +87,7 @@ add_task( add_task(async () => { Services.perms.removeAll(); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_UserActivation.js b/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_UserActivation.js index 49dd73fbf7..2e1f246f2e 100644 --- a/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_UserActivation.js +++ b/toolkit/components/antitracking/test/browser/browser_storageAccess_TopLevel_UserActivation.js @@ -56,7 +56,7 @@ add_task(async function testUserActivations() { add_task(async () => { Services.perms.removeAll(); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_subResources.js b/toolkit/components/antitracking/test/browser/browser_subResources.js index 4841527d19..1b85aabb24 100644 --- a/toolkit/components/antitracking/test/browser/browser_subResources.js +++ b/toolkit/components/antitracking/test/browser/browser_subResources.js @@ -270,7 +270,7 @@ add_task(async function () { info("Cleaning up."); SpecialPowers.clearUserPref("network.cookie.sameSite.laxByDefault"); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_subResourcesPartitioned.js b/toolkit/components/antitracking/test/browser/browser_subResourcesPartitioned.js index b2de150075..ad76be6e54 100644 --- a/toolkit/components/antitracking/test/browser/browser_subResourcesPartitioned.js +++ b/toolkit/components/antitracking/test/browser/browser_subResourcesPartitioned.js @@ -301,7 +301,7 @@ add_task(async function () { add_task(async function () { info("Cleaning up."); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_subResourcesPartitioned_alwaysPartition.js b/toolkit/components/antitracking/test/browser/browser_subResourcesPartitioned_alwaysPartition.js index 53a90854b3..9e1a573418 100644 --- a/toolkit/components/antitracking/test/browser/browser_subResourcesPartitioned_alwaysPartition.js +++ b/toolkit/components/antitracking/test/browser/browser_subResourcesPartitioned_alwaysPartition.js @@ -306,7 +306,7 @@ add_task(async function () { add_task(async function () { info("Cleaning up."); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_thirdPartyStorageRejectionForCORS.js b/toolkit/components/antitracking/test/browser/browser_thirdPartyStorageRejectionForCORS.js index f609c2d5b0..47f102d054 100644 --- a/toolkit/components/antitracking/test/browser/browser_thirdPartyStorageRejectionForCORS.js +++ b/toolkit/components/antitracking/test/browser/browser_thirdPartyStorageRejectionForCORS.js @@ -48,7 +48,7 @@ AntiTracking._createTask({ add_task(async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_urlDecorationStripping.js b/toolkit/components/antitracking/test/browser/browser_urlDecorationStripping.js index 642b5d2cbd..f00ddcd4de 100644 --- a/toolkit/components/antitracking/test/browser/browser_urlDecorationStripping.js +++ b/toolkit/components/antitracking/test/browser/browser_urlDecorationStripping.js @@ -246,7 +246,7 @@ AntiTracking._createTask({ add_task(async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_urlDecorationStripping_alwaysPartition.js b/toolkit/components/antitracking/test/browser/browser_urlDecorationStripping_alwaysPartition.js index 2fbac9811b..d66a84d1ad 100644 --- a/toolkit/components/antitracking/test/browser/browser_urlDecorationStripping_alwaysPartition.js +++ b/toolkit/components/antitracking/test/browser/browser_urlDecorationStripping_alwaysPartition.js @@ -248,7 +248,7 @@ AntiTracking._createTask({ add_task(async _ => { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_urlQueryStringStripping.js b/toolkit/components/antitracking/test/browser/browser_urlQueryStringStripping.js index 6395110f41..567158dadc 100644 --- a/toolkit/components/antitracking/test/browser/browser_urlQueryStringStripping.js +++ b/toolkit/components/antitracking/test/browser/browser_urlQueryStringStripping.js @@ -43,7 +43,7 @@ const TEST_CASES = [ let listService; function observeChannel(uri, expected) { - return TestUtils.topicObserved("http-on-modify-request", (subject, data) => { + return TestUtils.topicObserved("http-on-modify-request", subject => { let channel = subject.QueryInterface(Ci.nsIHttpChannel); let channelURI = channel.URI; diff --git a/toolkit/components/antitracking/test/browser/browser_urlQueryStringStripping_allowList.js b/toolkit/components/antitracking/test/browser/browser_urlQueryStringStripping_allowList.js index 6dee6cede0..839d6980d1 100644 --- a/toolkit/components/antitracking/test/browser/browser_urlQueryStringStripping_allowList.js +++ b/toolkit/components/antitracking/test/browser/browser_urlQueryStringStripping_allowList.js @@ -15,7 +15,7 @@ const TEST_REDIRECT_URI = TEST_DOMAIN + TEST_PATH + "redirect.sjs"; const TEST_QUERY_STRING = "paramToStrip=1"; function observeChannel(uri, expected) { - return TestUtils.topicObserved("http-on-before-connect", (subject, data) => { + return TestUtils.topicObserved("http-on-before-connect", subject => { let channel = subject.QueryInterface(Ci.nsIHttpChannel); let channelURI = channel.URI; diff --git a/toolkit/components/antitracking/test/browser/browser_userInteraction.js b/toolkit/components/antitracking/test/browser/browser_userInteraction.js index d343a56731..c024f4d9f7 100644 --- a/toolkit/components/antitracking/test/browser/browser_userInteraction.js +++ b/toolkit/components/antitracking/test/browser/browser_userInteraction.js @@ -40,7 +40,7 @@ add_task(async function () { "Before user-interaction we don't have a permission" ); - let promise = TestUtils.topicObserved("perm-changed", (aSubject, aData) => { + let promise = TestUtils.topicObserved("perm-changed", aSubject => { let permission = aSubject.QueryInterface(Ci.nsIPermission); return ( permission.type == "storageAccessAPI" && @@ -59,7 +59,7 @@ add_task(async function () { // Let's see if the document is able to update the permission correctly. for (var i = 0; i < 3; ++i) { // Another perm-changed event should be triggered by the timer. - promise = TestUtils.topicObserved("perm-changed", (aSubject, aData) => { + promise = TestUtils.topicObserved("perm-changed", aSubject => { let permission = aSubject.QueryInterface(Ci.nsIPermission); return ( permission.type == "storageAccessAPI" && @@ -84,7 +84,7 @@ add_task(async function () { promise = new Promise(resolve => { let id; - function observer(subject, topic, data) { + function observer() { ok(false, "Notification received!"); Services.obs.removeObserver(observer, "perm-changed"); clearTimeout(id); @@ -117,7 +117,7 @@ add_task(async function () { add_task(async function () { info("Cleaning up."); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/browser_workerPropagation.js b/toolkit/components/antitracking/test/browser/browser_workerPropagation.js index 54ec0c1bf6..4f92a0450b 100644 --- a/toolkit/components/antitracking/test/browser/browser_workerPropagation.js +++ b/toolkit/components/antitracking/test/browser/browser_workerPropagation.js @@ -80,7 +80,7 @@ add_task(async function () { add_task(async function () { info("Cleaning up."); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/file_saveAsPageInfo.html b/toolkit/components/antitracking/test/browser/file_saveAsPageInfo.html index aa3de2a555..8f22e911e7 100644 --- a/toolkit/components/antitracking/test/browser/file_saveAsPageInfo.html +++ b/toolkit/components/antitracking/test/browser/file_saveAsPageInfo.html @@ -1,6 +1,6 @@ <html> <body> - <img src="http://example.net/browser/toolkit/components/antitracking/test/browser/raptor.jpg" id="image1"> - <video src="http://example.net/browser/toolkit/components/antitracking/test/browser/file_video.ogv" id="video1"> </video> + <img src="https://example.net/browser/toolkit/components/antitracking/test/browser/raptor.jpg" id="image1"> + <video src="https://example.net/browser/toolkit/components/antitracking/test/browser/file_video.ogv" id="video1"> </video> </body> </html> diff --git a/toolkit/components/antitracking/test/browser/head.js b/toolkit/components/antitracking/test/browser/head.js index d7721b7cac..415da8177f 100644 --- a/toolkit/components/antitracking/test/browser/head.js +++ b/toolkit/components/antitracking/test/browser/head.js @@ -14,6 +14,7 @@ const TEST_DOMAIN_5 = "http://test/"; const TEST_DOMAIN_6 = "http://mochi.test:8888/"; const TEST_DOMAIN_7 = "http://example.com/"; const TEST_DOMAIN_8 = "http://www.example.com/"; +const TEST_DOMAIN_9 = "https://example.org:443/"; const TEST_3RD_PARTY_DOMAIN = "https://tracking.example.org/"; const TEST_3RD_PARTY_DOMAIN_HTTP = "http://tracking.example.org/"; const TEST_3RD_PARTY_DOMAIN_TP = "https://tracking.example.com/"; @@ -40,6 +41,7 @@ const TEST_TOP_PAGE_5 = TEST_DOMAIN_5 + TEST_PATH + "page.html"; const TEST_TOP_PAGE_6 = TEST_DOMAIN_6 + TEST_PATH + "page.html"; const TEST_TOP_PAGE_7 = TEST_DOMAIN_7 + TEST_PATH + "page.html"; const TEST_TOP_PAGE_8 = TEST_DOMAIN_8 + TEST_PATH + "page.html"; +const TEST_TOP_PAGE_9 = TEST_DOMAIN_9 + TEST_PATH + "page.html"; const TEST_EMBEDDER_PAGE = TEST_DOMAIN + TEST_PATH + "embedder.html"; const TEST_POPUP_PAGE = TEST_DOMAIN + TEST_PATH + "popup.html"; const TEST_IFRAME_PAGE = TEST_DOMAIN + TEST_PATH + "iframe.html"; diff --git a/toolkit/components/antitracking/test/browser/imageCacheWorker.js b/toolkit/components/antitracking/test/browser/imageCacheWorker.js index d11221112c..6b2b57d908 100644 --- a/toolkit/components/antitracking/test/browser/imageCacheWorker.js +++ b/toolkit/components/antitracking/test/browser/imageCacheWorker.js @@ -71,7 +71,7 @@ add_task(async _ => { }); await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/localStorage.html b/toolkit/components/antitracking/test/browser/localStorage.html index e08c25f2c4..6ba733a31d 100644 --- a/toolkit/components/antitracking/test/browser/localStorage.html +++ b/toolkit/components/antitracking/test/browser/localStorage.html @@ -50,7 +50,7 @@ if (parent) { } }; - window.addEventListener("storage", e => { + window.addEventListener("storage", () => { let fromOpener = localStorage.foo.startsWith("opener"); let status; diff --git a/toolkit/components/antitracking/test/browser/partitionedstorage_head.js b/toolkit/components/antitracking/test/browser/partitionedstorage_head.js index d37b8177c4..15ba20fd68 100644 --- a/toolkit/components/antitracking/test/browser/partitionedstorage_head.js +++ b/toolkit/components/antitracking/test/browser/partitionedstorage_head.js @@ -141,6 +141,7 @@ this.PartitionedStorageHelper = { await SpecialPowers.pushPrefEnv({ set: [ ["dom.storage_access.enabled", true], + ["network.cookie.cookieBehavior.optInPartitioning", true], [ "privacy.partition.always_partition_third_party_non_cookie_storage", true, @@ -164,14 +165,14 @@ this.PartitionedStorageHelper = { } info("Creating the first tab"); - let tab1 = BrowserTestUtils.addTab(win.gBrowser, TEST_TOP_PAGE); + let tab1 = BrowserTestUtils.addTab(win.gBrowser, TEST_TOP_PAGE_HTTPS); win.gBrowser.selectedTab = tab1; let browser1 = win.gBrowser.getBrowserForTab(tab1); await BrowserTestUtils.browserLoaded(browser1); info("Creating the second tab"); - let tab2 = BrowserTestUtils.addTab(win.gBrowser, TEST_TOP_PAGE_6); + let tab2 = BrowserTestUtils.addTab(win.gBrowser, TEST_TOP_PAGE_9); win.gBrowser.selectedTab = tab2; let browser2 = win.gBrowser.getBrowserForTab(tab2); @@ -180,7 +181,7 @@ this.PartitionedStorageHelper = { info("Creating the third tab"); let tab3 = BrowserTestUtils.addTab( win.gBrowser, - TEST_4TH_PARTY_PARTITIONED_PAGE + TEST_4TH_PARTY_PARTITIONED_PAGE_HTTPS ); win.gBrowser.selectedTab = tab3; @@ -189,7 +190,7 @@ this.PartitionedStorageHelper = { // Use the same URL as first tab to check partitioned data info("Creating the forth tab"); - let tab4 = BrowserTestUtils.addTab(win.gBrowser, TEST_TOP_PAGE); + let tab4 = BrowserTestUtils.addTab(win.gBrowser, TEST_TOP_PAGE_HTTPS); win.gBrowser.selectedTab = tab4; let browser4 = win.gBrowser.getBrowserForTab(tab4); @@ -207,7 +208,8 @@ this.PartitionedStorageHelper = { browser, [ { - page: TEST_4TH_PARTY_PARTITIONED_PAGE + "?variant=" + variant, + page: + TEST_4TH_PARTY_PARTITIONED_PAGE_HTTPS + "?variant=" + variant, getDataCallback: getDataCallback.toString(), result, }, @@ -289,7 +291,8 @@ this.PartitionedStorageHelper = { browser, [ { - page: TEST_4TH_PARTY_PARTITIONED_PAGE + "?variant=" + variant, + page: + TEST_4TH_PARTY_PARTITIONED_PAGE_HTTPS + "?variant=" + variant, addDataCallback: addDataCallback.toString(), value, }, @@ -382,7 +385,7 @@ this.PartitionedStorageHelper = { async function setStorageAccessForThirdParty(browser) { info(`Setting permission for ${browser.currentURI.spec}`); - let type = "3rdPartyStorage^http://not-tracking.example.com"; + let type = "3rdPartyStorage^https://not-tracking.example.com"; let permission = Services.perms.ALLOW_ACTION; let expireType = Services.perms.EXPIRE_SESSION; Services.perms.addFromPrincipal( diff --git a/toolkit/components/antitracking/test/browser/storage_access_head.js b/toolkit/components/antitracking/test/browser/storage_access_head.js index ea4f67b4fe..e43f680042 100644 --- a/toolkit/components/antitracking/test/browser/storage_access_head.js +++ b/toolkit/components/antitracking/test/browser/storage_access_head.js @@ -246,7 +246,7 @@ async function requestStorageAccessAndExpectFailure() { async function cleanUpData() { await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve() ); }); diff --git a/toolkit/components/antitracking/test/browser/tracker.js b/toolkit/components/antitracking/test/browser/tracker.js index 85e943f7c4..eeed80a71b 100644 --- a/toolkit/components/antitracking/test/browser/tracker.js +++ b/toolkit/components/antitracking/test/browser/tracker.js @@ -1,4 +1,4 @@ -window.addEventListener("message", e => { +window.addEventListener("message", () => { let bc = new BroadcastChannel("a"); bc.postMessage("ready!"); }); diff --git a/toolkit/components/antitracking/test/browser/workerIframe.html b/toolkit/components/antitracking/test/browser/workerIframe.html index 37aa5d7c0d..c31d9ff854 100644 --- a/toolkit/components/antitracking/test/browser/workerIframe.html +++ b/toolkit/components/antitracking/test/browser/workerIframe.html @@ -21,7 +21,7 @@ function is(a, b, msg) { async function runTest() { function workerCode() { - onmessage = e => { + onmessage = () => { try { indexedDB.open("test", "1"); postMessage(true); diff --git a/toolkit/components/antitracking/test/xpcshell/test_staticPartition_authhttp.js b/toolkit/components/antitracking/test/xpcshell/test_staticPartition_authhttp.js index 0492f5ff2a..ddc942f8d8 100644 --- a/toolkit/components/antitracking/test/xpcshell/test_staticPartition_authhttp.js +++ b/toolkit/components/antitracking/test/xpcshell/test_staticPartition_authhttp.js @@ -38,7 +38,7 @@ Requestor.prototype = { return true; }, - asyncPromptAuth(chan, cb, ctx, lvl, info) { + asyncPromptAuth() { throw Components.Exception("", Cr.NS_ERROR_NOT_IMPLEMENTED); }, }; diff --git a/toolkit/components/antitracking/test/xpcshell/test_staticPartition_prefetch.js b/toolkit/components/antitracking/test/xpcshell/test_staticPartition_prefetch.js index f7ec4cc8e3..c9253d33ea 100644 --- a/toolkit/components/antitracking/test/xpcshell/test_staticPartition_prefetch.js +++ b/toolkit/components/antitracking/test/xpcshell/test_staticPartition_prefetch.js @@ -34,7 +34,7 @@ async function checkCache(originAttributes) { const data = await new Promise(resolve => { let cacheEntries = []; let cacheVisitor = { - onCacheStorageInfo(num, consumption) {}, + onCacheStorageInfo() {}, onCacheEntryInfo(uri, idEnhance) { cacheEntries.push({ uri, idEnhance }); }, diff --git a/toolkit/components/antitracking/test/xpcshell/test_staticPartition_preload.js b/toolkit/components/antitracking/test/xpcshell/test_staticPartition_preload.js index 20158f2f7a..0bab966308 100644 --- a/toolkit/components/antitracking/test/xpcshell/test_staticPartition_preload.js +++ b/toolkit/components/antitracking/test/xpcshell/test_staticPartition_preload.js @@ -28,7 +28,7 @@ async function checkCache(originAttributes) { const data = await new Promise(resolve => { let cacheEntries = []; let cacheVisitor = { - onCacheStorageInfo(num, consumption) {}, + onCacheStorageInfo() {}, onCacheEntryInfo(uri, idEnhance) { cacheEntries.push({ uri, idEnhance }); }, diff --git a/toolkit/components/antitracking/test/xpcshell/xpcshell.toml b/toolkit/components/antitracking/test/xpcshell/xpcshell.toml index 86f524ab89..97fbf8fad1 100644 --- a/toolkit/components/antitracking/test/xpcshell/xpcshell.toml +++ b/toolkit/components/antitracking/test/xpcshell/xpcshell.toml @@ -26,10 +26,11 @@ skip-if = ["socketprocess_networking"] # Bug 1759035 ["test_staticPartition_font.js"] support-files = ["data/font.woff"] skip-if = [ - "os == 'linux' && !debug", # Bug 1760086 + "os == 'linux' && os_version == '18.04' && !debug", # Bug 1760086 "apple_silicon", # bug 1729551 - "os == 'mac' && bits == 64 && !debug", # Bug 1652119 - "os == 'win' && bits == 64 && !debug", # Bug 1652119 + "apple_catalina && !debug", # Bug 1652119 + "win10_2009 && bits == 64 && !debug", # Bug 1652119 + "win11_2009 && bits == 64 && !debug", # Bug 1652119 "socketprocess_networking", # Bug 1759035 ] run-sequentially = "very high failure rate in parallel" |