Loading components/browser/engine-gecko-beta/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngineSession.kt +2 −15 Original line number Diff line number Diff line Loading @@ -196,10 +196,7 @@ class GeckoEngineSession( val shouldBlockContent = policy.contains(TrackingProtectionPolicy.TrackingCategory.SCRIPTS_AND_SUB_RESOURCES) geckoSession.settings.useTrackingProtection = shouldBlockContent if (!enabled) { disableTrackingProtectionOnGecko() } geckoSession.settings.useTrackingProtection = shouldBlockContent && enabled notifyAtLeastOneObserver { onTrackerBlockingEnabledChange(enabled) } } Loading @@ -207,7 +204,7 @@ class GeckoEngineSession( * See [EngineSession.disableTrackingProtection] */ override fun disableTrackingProtection() { disableTrackingProtectionOnGecko() geckoSession.settings.useTrackingProtection = false notifyObservers { onTrackerBlockingEnabledChange(false) } } Loading @@ -226,16 +223,6 @@ class GeckoEngineSession( } } // To fully disable tracking protection we need to change the different tracking protection // variables to none. private fun disableTrackingProtectionOnGecko() { geckoSession.settings.useTrackingProtection = false runtime.settings.contentBlocking.setAntiTracking(ContentBlocking.AntiTracking.NONE) runtime.settings.contentBlocking.cookieBehavior = ContentBlocking.CookieBehavior.ACCEPT_ALL runtime.settings.contentBlocking.setStrictSocialTrackingProtection(false) runtime.settings.contentBlocking.setEnhancedTrackingProtectionLevel(ContentBlocking.EtpLevel.NONE) } /** * See [EngineSession.settings] */ Loading components/browser/engine-gecko-beta/src/test/java/mozilla/components/browser/engine/gecko/GeckoEngineSessionTest.kt +0 −22 Original line number Diff line number Diff line Loading @@ -1050,10 +1050,6 @@ class GeckoEngineSessionTest { engineSession.disableTrackingProtection() assertTrue(trackerBlockingDisabledObserved) assertFalse(engineSession.geckoSession.settings.useTrackingProtection) verify(runtime.settings.contentBlocking).setAntiTracking(ContentBlocking.AntiTracking.NONE) verify(runtime.settings.contentBlocking).setCookieBehavior(GeckoCookieBehavior.ACCEPT_ALL) verify(runtime.settings.contentBlocking).setStrictSocialTrackingProtection(false) verify(runtime.settings.contentBlocking).setEnhancedTrackingProtectionLevel(ContentBlocking.EtpLevel.NONE) } @Test Loading Loading @@ -1533,24 +1529,6 @@ class GeckoEngineSessionTest { verify(geckoSession.settings).useTrackingProtection = false } @Test fun `WHEN disabling tracking protection THEN CookieBehavior and AntiTracking category must be set to ACCEPT_ALL and NONE`() { whenever(runtime.settings.contentBlocking).thenReturn(mock()) val defaultSettings = DefaultSettings(trackingProtectionPolicy = TrackingProtectionPolicy.recommended()) val session = GeckoEngineSession( runtime, geckoSessionProvider = geckoSessionProvider, privateMode = false, defaultSettings = defaultSettings ) session.disableTrackingProtection() verify(geckoSession.settings, times(2)).useTrackingProtection = false verify(runtime.settings.contentBlocking).setAntiTracking(ContentBlocking.AntiTracking.NONE) verify(runtime.settings.contentBlocking).setCookieBehavior(ContentBlocking.CookieBehavior.ACCEPT_ALL) } @Test fun contentDelegate() { val engineSession = GeckoEngineSession(mock(), Loading components/browser/engine-gecko-nightly/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngineSession.kt +2 −15 Original line number Diff line number Diff line Loading @@ -197,10 +197,7 @@ class GeckoEngineSession( val shouldBlockContent = policy.contains(TrackingProtectionPolicy.TrackingCategory.SCRIPTS_AND_SUB_RESOURCES) geckoSession.settings.useTrackingProtection = shouldBlockContent if (!enabled) { disableTrackingProtectionOnGecko() } geckoSession.settings.useTrackingProtection = shouldBlockContent && enabled notifyAtLeastOneObserver { onTrackerBlockingEnabledChange(enabled) } } Loading @@ -208,7 +205,7 @@ class GeckoEngineSession( * See [EngineSession.disableTrackingProtection] */ override fun disableTrackingProtection() { disableTrackingProtectionOnGecko() geckoSession.settings.useTrackingProtection = false notifyObservers { onTrackerBlockingEnabledChange(false) } } Loading @@ -227,16 +224,6 @@ class GeckoEngineSession( } } // To fully disable tracking protection we need to change the different tracking protection // variables to none. private fun disableTrackingProtectionOnGecko() { geckoSession.settings.useTrackingProtection = false runtime.settings.contentBlocking.setAntiTracking(ContentBlocking.AntiTracking.NONE) runtime.settings.contentBlocking.cookieBehavior = ContentBlocking.CookieBehavior.ACCEPT_ALL runtime.settings.contentBlocking.setStrictSocialTrackingProtection(false) runtime.settings.contentBlocking.setEnhancedTrackingProtectionLevel(ContentBlocking.EtpLevel.NONE) } /** * See [EngineSession.settings] */ Loading components/browser/engine-gecko-nightly/src/test/java/mozilla/components/browser/engine/gecko/GeckoEngineSessionTest.kt +0 −22 Original line number Diff line number Diff line Loading @@ -1081,10 +1081,6 @@ class GeckoEngineSessionTest { engineSession.disableTrackingProtection() assertTrue(trackerBlockingDisabledObserved) assertFalse(engineSession.geckoSession.settings.useTrackingProtection) verify(runtime.settings.contentBlocking).setAntiTracking(ContentBlocking.AntiTracking.NONE) verify(runtime.settings.contentBlocking).setCookieBehavior(GeckoCookieBehavior.ACCEPT_ALL) verify(runtime.settings.contentBlocking).setStrictSocialTrackingProtection(false) verify(runtime.settings.contentBlocking).setEnhancedTrackingProtectionLevel(ContentBlocking.EtpLevel.NONE) } @Test Loading Loading @@ -1564,24 +1560,6 @@ class GeckoEngineSessionTest { verify(geckoSession.settings).useTrackingProtection = false } @Test fun `WHEN disabling tracking protection THEN CookieBehavior and AntiTracking category must be set to ACCEPT_ALL and NONE`() { whenever(runtime.settings.contentBlocking).thenReturn(mock()) val defaultSettings = DefaultSettings(trackingProtectionPolicy = TrackingProtectionPolicy.recommended()) val session = GeckoEngineSession( runtime, geckoSessionProvider = geckoSessionProvider, privateMode = false, defaultSettings = defaultSettings ) session.disableTrackingProtection() verify(geckoSession.settings, times(2)).useTrackingProtection = false verify(runtime.settings.contentBlocking).setAntiTracking(ContentBlocking.AntiTracking.NONE) verify(runtime.settings.contentBlocking).setCookieBehavior(ContentBlocking.CookieBehavior.ACCEPT_ALL) } @Test fun contentDelegate() { val engineSession = GeckoEngineSession(mock(), Loading components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngineSession.kt +2 −15 Original line number Diff line number Diff line Loading @@ -194,10 +194,7 @@ class GeckoEngineSession( val shouldBlockContent = policy.contains(TrackingProtectionPolicy.TrackingCategory.SCRIPTS_AND_SUB_RESOURCES) geckoSession.settings.useTrackingProtection = shouldBlockContent if (!enabled) { disableTrackingProtectionOnGecko() } geckoSession.settings.useTrackingProtection = shouldBlockContent && enabled notifyAtLeastOneObserver { onTrackerBlockingEnabledChange(enabled) } } Loading @@ -205,7 +202,7 @@ class GeckoEngineSession( * See [EngineSession.disableTrackingProtection] */ override fun disableTrackingProtection() { disableTrackingProtectionOnGecko() geckoSession.settings.useTrackingProtection = false notifyObservers { onTrackerBlockingEnabledChange(false) } } Loading @@ -224,16 +221,6 @@ class GeckoEngineSession( } } // To fully disable tracking protection we need to change the different tracking protection // variables to none. private fun disableTrackingProtectionOnGecko() { geckoSession.settings.useTrackingProtection = false runtime.settings.contentBlocking.setAntiTracking(ContentBlocking.AntiTracking.NONE) runtime.settings.contentBlocking.cookieBehavior = ContentBlocking.CookieBehavior.ACCEPT_ALL runtime.settings.contentBlocking.setStrictSocialTrackingProtection(false) runtime.settings.contentBlocking.setEnhancedTrackingProtectionLevel(ContentBlocking.EtpLevel.NONE) } /** * See [EngineSession.settings] */ Loading Loading
components/browser/engine-gecko-beta/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngineSession.kt +2 −15 Original line number Diff line number Diff line Loading @@ -196,10 +196,7 @@ class GeckoEngineSession( val shouldBlockContent = policy.contains(TrackingProtectionPolicy.TrackingCategory.SCRIPTS_AND_SUB_RESOURCES) geckoSession.settings.useTrackingProtection = shouldBlockContent if (!enabled) { disableTrackingProtectionOnGecko() } geckoSession.settings.useTrackingProtection = shouldBlockContent && enabled notifyAtLeastOneObserver { onTrackerBlockingEnabledChange(enabled) } } Loading @@ -207,7 +204,7 @@ class GeckoEngineSession( * See [EngineSession.disableTrackingProtection] */ override fun disableTrackingProtection() { disableTrackingProtectionOnGecko() geckoSession.settings.useTrackingProtection = false notifyObservers { onTrackerBlockingEnabledChange(false) } } Loading @@ -226,16 +223,6 @@ class GeckoEngineSession( } } // To fully disable tracking protection we need to change the different tracking protection // variables to none. private fun disableTrackingProtectionOnGecko() { geckoSession.settings.useTrackingProtection = false runtime.settings.contentBlocking.setAntiTracking(ContentBlocking.AntiTracking.NONE) runtime.settings.contentBlocking.cookieBehavior = ContentBlocking.CookieBehavior.ACCEPT_ALL runtime.settings.contentBlocking.setStrictSocialTrackingProtection(false) runtime.settings.contentBlocking.setEnhancedTrackingProtectionLevel(ContentBlocking.EtpLevel.NONE) } /** * See [EngineSession.settings] */ Loading
components/browser/engine-gecko-beta/src/test/java/mozilla/components/browser/engine/gecko/GeckoEngineSessionTest.kt +0 −22 Original line number Diff line number Diff line Loading @@ -1050,10 +1050,6 @@ class GeckoEngineSessionTest { engineSession.disableTrackingProtection() assertTrue(trackerBlockingDisabledObserved) assertFalse(engineSession.geckoSession.settings.useTrackingProtection) verify(runtime.settings.contentBlocking).setAntiTracking(ContentBlocking.AntiTracking.NONE) verify(runtime.settings.contentBlocking).setCookieBehavior(GeckoCookieBehavior.ACCEPT_ALL) verify(runtime.settings.contentBlocking).setStrictSocialTrackingProtection(false) verify(runtime.settings.contentBlocking).setEnhancedTrackingProtectionLevel(ContentBlocking.EtpLevel.NONE) } @Test Loading Loading @@ -1533,24 +1529,6 @@ class GeckoEngineSessionTest { verify(geckoSession.settings).useTrackingProtection = false } @Test fun `WHEN disabling tracking protection THEN CookieBehavior and AntiTracking category must be set to ACCEPT_ALL and NONE`() { whenever(runtime.settings.contentBlocking).thenReturn(mock()) val defaultSettings = DefaultSettings(trackingProtectionPolicy = TrackingProtectionPolicy.recommended()) val session = GeckoEngineSession( runtime, geckoSessionProvider = geckoSessionProvider, privateMode = false, defaultSettings = defaultSettings ) session.disableTrackingProtection() verify(geckoSession.settings, times(2)).useTrackingProtection = false verify(runtime.settings.contentBlocking).setAntiTracking(ContentBlocking.AntiTracking.NONE) verify(runtime.settings.contentBlocking).setCookieBehavior(ContentBlocking.CookieBehavior.ACCEPT_ALL) } @Test fun contentDelegate() { val engineSession = GeckoEngineSession(mock(), Loading
components/browser/engine-gecko-nightly/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngineSession.kt +2 −15 Original line number Diff line number Diff line Loading @@ -197,10 +197,7 @@ class GeckoEngineSession( val shouldBlockContent = policy.contains(TrackingProtectionPolicy.TrackingCategory.SCRIPTS_AND_SUB_RESOURCES) geckoSession.settings.useTrackingProtection = shouldBlockContent if (!enabled) { disableTrackingProtectionOnGecko() } geckoSession.settings.useTrackingProtection = shouldBlockContent && enabled notifyAtLeastOneObserver { onTrackerBlockingEnabledChange(enabled) } } Loading @@ -208,7 +205,7 @@ class GeckoEngineSession( * See [EngineSession.disableTrackingProtection] */ override fun disableTrackingProtection() { disableTrackingProtectionOnGecko() geckoSession.settings.useTrackingProtection = false notifyObservers { onTrackerBlockingEnabledChange(false) } } Loading @@ -227,16 +224,6 @@ class GeckoEngineSession( } } // To fully disable tracking protection we need to change the different tracking protection // variables to none. private fun disableTrackingProtectionOnGecko() { geckoSession.settings.useTrackingProtection = false runtime.settings.contentBlocking.setAntiTracking(ContentBlocking.AntiTracking.NONE) runtime.settings.contentBlocking.cookieBehavior = ContentBlocking.CookieBehavior.ACCEPT_ALL runtime.settings.contentBlocking.setStrictSocialTrackingProtection(false) runtime.settings.contentBlocking.setEnhancedTrackingProtectionLevel(ContentBlocking.EtpLevel.NONE) } /** * See [EngineSession.settings] */ Loading
components/browser/engine-gecko-nightly/src/test/java/mozilla/components/browser/engine/gecko/GeckoEngineSessionTest.kt +0 −22 Original line number Diff line number Diff line Loading @@ -1081,10 +1081,6 @@ class GeckoEngineSessionTest { engineSession.disableTrackingProtection() assertTrue(trackerBlockingDisabledObserved) assertFalse(engineSession.geckoSession.settings.useTrackingProtection) verify(runtime.settings.contentBlocking).setAntiTracking(ContentBlocking.AntiTracking.NONE) verify(runtime.settings.contentBlocking).setCookieBehavior(GeckoCookieBehavior.ACCEPT_ALL) verify(runtime.settings.contentBlocking).setStrictSocialTrackingProtection(false) verify(runtime.settings.contentBlocking).setEnhancedTrackingProtectionLevel(ContentBlocking.EtpLevel.NONE) } @Test Loading Loading @@ -1564,24 +1560,6 @@ class GeckoEngineSessionTest { verify(geckoSession.settings).useTrackingProtection = false } @Test fun `WHEN disabling tracking protection THEN CookieBehavior and AntiTracking category must be set to ACCEPT_ALL and NONE`() { whenever(runtime.settings.contentBlocking).thenReturn(mock()) val defaultSettings = DefaultSettings(trackingProtectionPolicy = TrackingProtectionPolicy.recommended()) val session = GeckoEngineSession( runtime, geckoSessionProvider = geckoSessionProvider, privateMode = false, defaultSettings = defaultSettings ) session.disableTrackingProtection() verify(geckoSession.settings, times(2)).useTrackingProtection = false verify(runtime.settings.contentBlocking).setAntiTracking(ContentBlocking.AntiTracking.NONE) verify(runtime.settings.contentBlocking).setCookieBehavior(ContentBlocking.CookieBehavior.ACCEPT_ALL) } @Test fun contentDelegate() { val engineSession = GeckoEngineSession(mock(), Loading
components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngineSession.kt +2 −15 Original line number Diff line number Diff line Loading @@ -194,10 +194,7 @@ class GeckoEngineSession( val shouldBlockContent = policy.contains(TrackingProtectionPolicy.TrackingCategory.SCRIPTS_AND_SUB_RESOURCES) geckoSession.settings.useTrackingProtection = shouldBlockContent if (!enabled) { disableTrackingProtectionOnGecko() } geckoSession.settings.useTrackingProtection = shouldBlockContent && enabled notifyAtLeastOneObserver { onTrackerBlockingEnabledChange(enabled) } } Loading @@ -205,7 +202,7 @@ class GeckoEngineSession( * See [EngineSession.disableTrackingProtection] */ override fun disableTrackingProtection() { disableTrackingProtectionOnGecko() geckoSession.settings.useTrackingProtection = false notifyObservers { onTrackerBlockingEnabledChange(false) } } Loading @@ -224,16 +221,6 @@ class GeckoEngineSession( } } // To fully disable tracking protection we need to change the different tracking protection // variables to none. private fun disableTrackingProtectionOnGecko() { geckoSession.settings.useTrackingProtection = false runtime.settings.contentBlocking.setAntiTracking(ContentBlocking.AntiTracking.NONE) runtime.settings.contentBlocking.cookieBehavior = ContentBlocking.CookieBehavior.ACCEPT_ALL runtime.settings.contentBlocking.setStrictSocialTrackingProtection(false) runtime.settings.contentBlocking.setEnhancedTrackingProtectionLevel(ContentBlocking.EtpLevel.NONE) } /** * See [EngineSession.settings] */ Loading