diff options
Diffstat (limited to 'toolkit/components/antitracking/test/browser/browser_partitionedDOMCache.js')
-rw-r--r-- | toolkit/components/antitracking/test/browser/browser_partitionedDOMCache.js | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/toolkit/components/antitracking/test/browser/browser_partitionedDOMCache.js b/toolkit/components/antitracking/test/browser/browser_partitionedDOMCache.js new file mode 100644 index 0000000000..ff6c8b9b75 --- /dev/null +++ b/toolkit/components/antitracking/test/browser/browser_partitionedDOMCache.js @@ -0,0 +1,35 @@ +/* import-globals-from partitionedstorage_head.js */ + +PartitionedStorageHelper.runTest( + "DOMCache", + async (win3rdParty, win1stParty, allowed) => { + // DOM Cache is not supported. Always blocked. + await win3rdParty.caches.open("wow").then( + _ => { + ok(allowed, "DOM Cache cannot be used!"); + }, + _ => { + ok(!allowed, "DOM Cache cannot be used!"); + } + ); + + await win1stParty.caches.open("wow").then( + _ => { + ok(true, "DOM Cache should be available"); + }, + _ => { + ok(false, "DOM Cache should be available"); + } + ); + }, + + async _ => { + await new Promise(resolve => { + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => + resolve() + ); + }); + }, + + [["dom.caches.testing.enabled", true]] +); |