Skip to content

Commit

Permalink
Merge pull request #139 from mozilla/sl/cross-site-cookies-blocked
Browse files Browse the repository at this point in the history
Cross Site Cookies
  • Loading branch information
sarinali authored Jul 29, 2024
2 parents d67c424 + 4870b42 commit 423e066
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 12 deletions.
6 changes: 0 additions & 6 deletions modules/data/about_prefs.components.json
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,6 @@
"groups": []
},

"cryptominers-checkbox": {
"selectorData": "contentBlockingCryptominersCheckbox",
"strategy": "id",
"groups": []
},

"known-fingerprints-checkbox": {
"selectorData": "contentBlockingFingerprintersCheckbox",
"strategy": "id",
Expand Down
18 changes: 12 additions & 6 deletions modules/data/tracker_panel.components.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,18 @@
]
},

"tracking-subview": {
"selectorData": "protections-popup-trackersView",
"strategy": "id",
"groups": []
},

"no-trackers-message": {
"selectorData": "protections-popup-no-trackers-found-description",
"strategy": "id",
"groups": []
},

"tracking-subview": {
"selectorData": "protections-popup-trackersView",
"strategy": "id",
"groups": []
},

"social-media-tracker-content": {
"selectorData": "protections-popup-category-socialblock",
"strategy": "id",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import pytest
from selenium.webdriver import Firefox

from modules.browser_object import Navigation, TrackerPanel
from modules.page_object import GenericPage

FIRST_TRACKER_WEBSITE = "https://senglehardt.com/test/trackingprotection/test_pages/tracking_protection.html"
ALLOWED_COOKIES = set(
[
"https://ads-track-digest256.dummytracker.org",
"https://social-track-digest256.dummytracker.org",
"https://analytics-track-digest256.dummytracker.org",
]
)


@pytest.fixture()
def add_prefs():
return [
("privacy.trackingprotection.pbmode.enabled", False),
("privacy.trackingprotection.cryptomining.enabled", False),
("privacy.trackingprotection.fingerprinting.enabled", False),
("privacy.fingerprintingProtection.pbmode", False),
]


def test_cross_site_tracking_cookies_blocked(driver: Firefox):
"""
C446402: Ensures the cross tracking cookies are displayed in the tracker panel
"""
# instantiate objects
nav = Navigation(driver)
tracker_panel = TrackerPanel(driver)
tracker_website = GenericPage(driver, url=FIRST_TRACKER_WEBSITE).open()
tracker_panel.wait_for_trackers(nav, tracker_website)

driver.set_context(driver.CONTEXT_CHROME)
nav.open_tracker_panel()

# fetch the items in the cross site trackers and verify
cross_site_trackers = tracker_panel.open_and_return_cross_site_trackers()
for item in cross_site_trackers:
assert item.get_attribute("value") in ALLOWED_COOKIES

0 comments on commit 423e066

Please sign in to comment.