Add tests for StorageAccessGrantedReason
Categories
(Core :: Privacy: Anti-Tracking, task, P3)
Tracking
()
People
(Reporter: xeonchen, Unassigned)
References
Details
Attachments
(1 file)
|
3.96 KB,
patch
|
ehsan.akhgari
:
feedback+
|
Details | Diff | Splinter Review |
In bug 1539641, the storage access granted reason has been logged into ContentBlockingLog, we should add some tests for it.
| Reporter | ||
Comment 1•6 years ago
|
||
This is my WIP patch, the reason I think this patch as incomplete is it doesn't get eOpenerAfterUserInteraction after await AntiTracking.interactWithTracker(); is called.
The reason is it received eOpener earlier, which I don't know if this is expected, and ContentBlockingLog only keeps the first reason.
Comment 2•6 years ago
|
||
Comment 3•6 years ago
|
||
We have two heuristics, one is triggered from https://searchfox.org/mozilla-central/rev/8d78f219702286c873860f39f9ed78bad1a6d062/dom/base/Document.cpp#12030 and one is triggered from https://searchfox.org/mozilla-central/rev/8d78f219702286c873860f39f9ed78bad1a6d062/dom/base/nsGlobalWindowOuter.cpp#7250. If you only see eOpener that's because it's the second heuristic which is being triggered not the first one.
If you think about how these heuristics work, first you need to do a window.open(), and then you would interact with the tracker. I think the only way to get the eOpenerAfterUserInteraction recorded in your log would be if:
- Your test called window.open() with a non-tracker URL on a tracker third-party iframe.
- That URL would redirect to a tracker page.
- Once the load is finished, you'd interact with the loaded tracker page after the redirect (for example with
AntiTracking.interactWithTracker().
We don't have an existing test which does this but perhaps you can add a new test case to browser_storageAccessWithHeuristics.js like that?
Updated•5 years ago
|
Updated•3 years ago
|
Description
•