Closed Bug 1556881 Opened 4 months ago Closed 2 months ago

Don't assume the dom.storage.next_gen pref is live

Categories

(Core :: Privacy: Anti-Tracking, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: ehsan, Assigned: ehsan)

References

Details

Attachments

(1 file)

Here: https://searchfox.org/mozilla-central/rev/9eb2f739c165b4e294929f7b99fbb4d90f8a396b/dom/localstorage/LocalStorageCommon.cpp#41 we read the value of the pref at startup only once and never update it again. This affects e.g. what window.localStorage returns.

However we have tests in the tree like https://searchfox.org/mozilla-central/rev/9eb2f739c165b4e294929f7b99fbb4d90f8a396b/toolkit/components/antitracking/test/browser/browser_partitionedLocalStorage_events.js#67 which are written as if dom.storage.next_gen were a live pref!

Is this pref not being live intentional? Can we convert it into a live pref so that these tests actually test the thing they think they are testing rather than a combination of the new/old LS backends?

Flags: needinfo?(jvarga)
Flags: needinfo?(amarchesini)

It's intentional. It would be really hard to make it a live pref.

Flags: needinfo?(jvarga)

Interesting! So attempting to set this pref inside a browser-chrome test is completely broken, right? I see inside the debugger that the code is instantiating the old LS backend while the test is thinking the new backend is being tested...

Blocks: 1556812

I was thinking we might be able to make it work via nsIQuotaManagerService::Reset()

Andrew, do you have time to work on it?

Flags: needinfo?(amarchesini) → needinfo?(bugmail)
Component: DOM: Core & HTML → DOM: Web Storage
Type: defect → enhancement
Priority: -- → P5

We talked about this at the all hands and decided to morph the bug into fixing our test to not assume the pref is live.

Assignee: nobody → ehsan
Flags: needinfo?(bugmail)
Summary: dom.storage.next_gen pref isn't live, but tests depend on it being so → Don't assume the dom.storage.next_gen pref is live
Component: DOM: Web Storage → Privacy: Anti-Tracking
Priority: P5 → P3
Pushed by eakhgari@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1d89c2f4521b
Fix browser_partitionedLocalStorage_events.js to not assume the dom.storage.next_gen pref is live; r=baku
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in before you can comment on or make changes to this bug.