Skip to content

Commit

Permalink
Validate that third party trackers load correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanKingston committed Apr 27, 2023
1 parent 5788473 commit 4683d38
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions integration-test/storage-blocking.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { routeFromLocalhost } from './helpers/testPages'
const testPageDomain = 'privacy-test-pages.glitch.me'
const thirdPartyDomain = 'good.third-party.site'
const thirdPartyTracker = 'broken.third-party.site'
const thirdPartyAd = 'convert.ad-company.site'

async function waitForAllResults (page) {
while ((await page.$$('#tests-details > li > span > ul')).length < 2) {
Expand Down Expand Up @@ -40,6 +41,11 @@ test.describe('Storage blocking Tests', () => {
thirdparty_firstparty_headerdata: expectUnmodified('allows 1st party HTTP cookies from non-tracker frames'),
jsdata: expectUnmodified('does not block 3rd party JS cookies not on block list')
},
[thirdPartyAd]: {
top_thirdparty_headerdata: expectUnmodified('allows 3rd party HTTP cookies not on block list'),
thirdparty_firstparty_headerdata: expectUnmodified('allows 1st party HTTP cookies from non-tracker frames'),
jsdata: expectUnmodified('does not block 3rd party JS cookies not on block list')
},
[thirdPartyTracker]: {
thirdpartytracker_thirdparty_headerdata: expectUnmodified('allows 3rd party tracker HTTP cookies from tracker frames'),
top_tracker_headerdata: expectBlocked('blocks 3rd party HTTP cookies for trackers'),
Expand All @@ -55,6 +61,11 @@ test.describe('Storage blocking Tests', () => {
if (jsCookies.has(cookie.name)) {
expect(cookie.expires - nowSeconds).toBeGreaterThan(0)
expect(cookie.expires - nowSeconds).toBeLessThan(604800)
if (cookie.domain === thirdPartyTracker) {
expect(cookie.expires - nowSeconds).toBeLessThan(86400)
} else {
expect(cookie.expires - nowSeconds).toBeGreaterThan(86400)
}
}
}
})
Expand Down

0 comments on commit 4683d38

Please sign in to comment.