Bug 1837282 - Update tests to use testdriver.set_permission() r=dom-storage-reviewers,janv

And trimming some Android OK/TIMEOUT redunduncies.

Differential Revision: https://phabricator.services.mozilla.com/D212837
This commit is contained in:
Kagami Sascha Rosylight 2024-06-07 10:55:05 +00:00
parent 197b096c22
commit 7c0b8a714d
15 changed files with 30 additions and 93 deletions

View file

@ -1,7 +0,0 @@
[estimate-parallel.https.any.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[estimate-parallel.https.any.worker.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]

View file

@ -1,12 +1,8 @@
[estimate-usage-details-caches.https.tentative.any.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[estimate() shows usage increase after large value is stored]
expected: FAIL
[estimate-usage-details-caches.https.tentative.any.worker.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[estimate() shows usage increase after large value is stored]
expected: FAIL

View file

@ -1,12 +1,8 @@
[estimate-usage-details.https.tentative.any.worker.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[estimate() resolves to dictionary with members, including usageDetails]
expected: FAIL
[estimate-usage-details.https.tentative.any.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[estimate() resolves to dictionary with members, including usageDetails]
expected: FAIL

View file

@ -1,7 +0,0 @@
[idlharness.https.any.worker.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[idlharness.https.any.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]

View file

@ -1,30 +0,0 @@
[opaque-origin.https.window.html]
expected:
if os == "android": OK
TIMEOUT
[navigator.storage.persist() in non-sandboxed iframe should not reject]
expected:
if os == "win": [TIMEOUT, NOTRUN]
if os == "android": PASS
TIMEOUT
[navigator.storage.persist() in sandboxed iframe should reject with TypeError]
expected:
if os == "android": PASS
NOTRUN
[navigator.storage.estimate() in non-sandboxed iframe should not reject]
expected:
if os == "win": [PASS, NOTRUN]
[navigator.storage.estimate() in sandboxed iframe should reject with TypeError]
expected:
if os == "win": [PASS, NOTRUN]
[navigator.storage.persisted() in sandboxed iframe should reject with TypeError]
expected:
if os == "win": [PASS, NOTRUN]
[navigator.storage.persisted() in non-sandboxed iframe should not reject]
expected:
if os == "win": [PASS, TIMEOUT]

View file

@ -1,7 +0,0 @@
[persisted.https.any.worker.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[persisted.https.any.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]

View file

@ -1,5 +1,3 @@
[quotachange-in-detached-iframe.tentative.https.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[Add quotachange listener on detached iframe.]
expected: FAIL

View file

@ -1,13 +0,0 @@
[storagemanager-persist-persisted-match.https.any.html]
expected:
if os == "android": OK
TIMEOUT
[navigator.storage.persist() resolves to a value that matches navigator.storage.persisted()]
expected:
if os == "android": PASS
TIMEOUT
[storagemanager-persist-persisted-match.https.any.worker.html]
[navigator.storage.persist() resolves to a value that matches navigator.storage.persisted()]
expected: FAIL

View file

@ -1,9 +0,0 @@
[storagemanager-persist.https.window.html]
expected:
if (os == "android") and not fission: OK
if (os == "android") and fission: [OK, TIMEOUT]
TIMEOUT
[navigator.storage.persist() returns a promise that resolves.]
expected:
if os == "android": PASS
TIMEOUT

View file

@ -1,3 +0,0 @@
[storagemanager-persist.https.worker.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]

View file

@ -1,7 +0,0 @@
[storagemanager-persisted.https.any.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[storagemanager-persisted.https.any.worker.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]

View file

@ -1,4 +1,7 @@
// META: title=StorageManager API and opaque origins
// META: script=/resources/testdriver.js
// META: script=/resources/testdriver-vendor.js
// META: script=resources/helpers.js
function load_iframe(src, sandbox) {
return new Promise(resolve => {
@ -49,6 +52,10 @@ function make_script(snippet) {
'<\/script>';
}
promise_setup(async () => {
await tryDenyingPermission();
});
['navigator.storage.persisted()',
'navigator.storage.estimate()',
// persist() can prompt, so make sure we test that last

View file

@ -0,0 +1,9 @@
// Try explicitly denying so that persist() won't wait for user prompt
async function tryDenyingPermission() {
try {
await test_driver.set_permission({ name: "persistent-storage" }, "denied");
} catch {
// Not all implementations support this yet, but some implementations may
// still be able to continue without explicit permission
}
}

View file

@ -1,4 +1,11 @@
// META: title=StorageManager: result of persist() matches result of persisted()
// META: script=/resources/testdriver.js
// META: script=/resources/testdriver-vendor.js
// META: script=resources/helpers.js
promise_setup(async () => {
await tryDenyingPermission();
});
promise_test(async t => {
var persistResult = await navigator.storage.persist();

View file

@ -1,4 +1,11 @@
// META: title=StorageManager: persist()
// META: script=/resources/testdriver.js
// META: script=/resources/testdriver-vendor.js
// META: script=resources/helpers.js
promise_setup(async () => {
await tryDenyingPermission();
});
promise_test(function() {
var promise = navigator.storage.persist();