diff --git a/testing/web-platform/meta/MANIFEST.json b/testing/web-platform/meta/MANIFEST.json
index 4b042a085cb6..7eef1a9325dc 100644
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -300854,26 +300854,6 @@
{}
]
],
- "storage/resources/storagemanager-persist-worker.js": [
- [
- {}
- ]
- ],
- "storage/resources/storagemanager-persisted-worker.js": [
- [
- {}
- ]
- ],
- "storage/storage-estimate-indexeddb.js": [
- [
- {}
- ]
- ],
- "storage/storage-persisted.js": [
- [
- {}
- ]
- ],
"streams/META.yml": [
[
{}
@@ -392190,21 +392170,23 @@
{}
]
],
- "storage/estimate-indexeddb-worker.https.html": [
+ "storage/estimate-indexeddb.https.any.js": [
[
- "/storage/estimate-indexeddb-worker.https.html",
+ "/storage/estimate-indexeddb.https.any.html",
+ {}
+ ],
+ [
+ "/storage/estimate-indexeddb.https.any.worker.html",
{}
]
],
- "storage/estimate-indexeddb.https.html": [
+ "storage/estimate-parallel.https.any.js": [
[
- "/storage/estimate-indexeddb.https.html",
+ "/storage/estimate-parallel.https.any.html",
{}
- ]
- ],
- "storage/estimate-parallel.https.html": [
+ ],
[
- "/storage/estimate-parallel.https.html",
+ "/storage/estimate-parallel.https.any.worker.html",
{}
]
],
@@ -392218,51 +392200,51 @@
{}
]
],
- "storage/opaque-origin.https.html": [
+ "storage/opaque-origin.https.window.js": [
[
- "/storage/opaque-origin.https.html",
+ "/storage/opaque-origin.https.window.html",
{}
]
],
- "storage/persisted-worker.https.html": [
+ "storage/persisted.https.any.js": [
[
- "/storage/persisted-worker.https.html",
+ "/storage/persisted.https.any.html",
+ {}
+ ],
+ [
+ "/storage/persisted.https.any.worker.html",
{}
]
],
- "storage/persisted.https.html": [
+ "storage/storagemanager-estimate.https.any.js": [
[
- "/storage/persisted.https.html",
+ "/storage/storagemanager-estimate.https.any.html",
+ {}
+ ],
+ [
+ "/storage/storagemanager-estimate.https.any.worker.html",
{}
]
],
- "storage/storagemanager-estimate.https.html": [
+ "storage/storagemanager-persist.https.window.js": [
[
- "/storage/storagemanager-estimate.https.html",
+ "/storage/storagemanager-persist.https.window.html",
{}
]
],
- "storage/storagemanager-persist-worker.https.html": [
+ "storage/storagemanager-persist.https.worker.js": [
[
- "/storage/storagemanager-persist-worker.https.html",
+ "/storage/storagemanager-persist.https.worker.html",
{}
]
],
- "storage/storagemanager-persist.https.html": [
+ "storage/storagemanager-persisted.https.any.js": [
[
- "/storage/storagemanager-persist.https.html",
+ "/storage/storagemanager-persisted.https.any.html",
{}
- ]
- ],
- "storage/storagemanager-persisted-worker.https.html": [
+ ],
[
- "/storage/storagemanager-persisted-worker.https.html",
- {}
- ]
- ],
- "storage/storagemanager-persisted.https.html": [
- [
- "/storage/storagemanager-persisted.https.html",
+ "/storage/storagemanager-persisted.https.any.worker.html",
{}
]
],
@@ -636357,72 +636339,44 @@
"d95c3ce8cff5d5f5428ee14c555c556c68f7f2a4",
"support"
],
- "storage/estimate-indexeddb-worker.https.html": [
- "2366760bdbed833b382a1adad350771bf3da7bb7",
+ "storage/estimate-indexeddb.https.any.js": [
+ "3e34ad19babf53da04974ceafe0fd4cb7be33621",
"testharness"
],
- "storage/estimate-indexeddb.https.html": [
- "3f5e1589d346e075e93fb08f5edf1b64d23643ec",
- "testharness"
- ],
- "storage/estimate-parallel.https.html": [
- "571b08cd5e211424035ec4fd7632d07548e4261c",
+ "storage/estimate-parallel.https.any.js": [
+ "090f004b8514bc9c99e8f85f9e8f9073dff2a263",
"testharness"
],
"storage/idlharness.https.any.js": [
"0ce4d5a0c8fccf07f6908a7a9ac9ac5ab5df6624",
"testharness"
],
- "storage/opaque-origin.https.html": [
- "563f2fea3c51627d919451cde1664703e4e87fe4",
+ "storage/opaque-origin.https.window.js": [
+ "3e101dde6759b2b8c379d6adc95190742328630f",
"testharness"
],
"storage/persist-permission-manual.https.html": [
"aa49900d69562284e35d8d1a4c4d5946586464ac",
"manual"
],
- "storage/persisted-worker.https.html": [
- "21f5c8bd92d849851994267c3d3459237f4bfa5c",
+ "storage/persisted.https.any.js": [
+ "57e15f0e811de3e94652b2f16c5482a94be63c24",
"testharness"
],
- "storage/persisted.https.html": [
- "a5a91ff0b2632d07d9b5ae681f1f9786afa686e6",
+ "storage/storagemanager-estimate.https.any.js": [
+ "d1d2e21924cd016165b02436dea994f44c193cd9",
"testharness"
],
- "storage/resources/storagemanager-persist-worker.js": [
- "1152e4ec7349b5cfccb2cad5d267c910c85632d2",
- "support"
- ],
- "storage/resources/storagemanager-persisted-worker.js": [
- "979c8be3cd39377df9ef4e4a42a8601612a471e3",
- "support"
- ],
- "storage/storage-estimate-indexeddb.js": [
- "5f7895350ef5235099d9d0fd343578b30b47883e",
- "support"
- ],
- "storage/storage-persisted.js": [
- "5bc86fea951973180570434b572604c0fcc2eb22",
- "support"
- ],
- "storage/storagemanager-estimate.https.html": [
- "08a699adfb001a7cfded79f462d2f0261c2f5149",
+ "storage/storagemanager-persist.https.window.js": [
+ "13e17a16e14198e21b0b5984ed46c93a50daed41",
"testharness"
],
- "storage/storagemanager-persist-worker.https.html": [
- "9c89a2f6712575001da0a4758d25ca6716bae3ae",
+ "storage/storagemanager-persist.https.worker.js": [
+ "fcf8175f706fe131c84ed2ac2a022e676d618c40",
"testharness"
],
- "storage/storagemanager-persist.https.html": [
- "61624fe272a610d3454ea2e245cdc6dbf6f59647",
- "testharness"
- ],
- "storage/storagemanager-persisted-worker.https.html": [
- "75004946164d59032228861cb854ae3e470723a0",
- "testharness"
- ],
- "storage/storagemanager-persisted.https.html": [
- "1d88c11bd8aace12223fb94845f1fb270a7b8877",
+ "storage/storagemanager-persisted.https.any.js": [
+ "70999406690fb26b7bc154093d826d7c0b8cf72c",
"testharness"
],
"streams/META.yml": [
diff --git a/testing/web-platform/tests/storage/estimate-indexeddb-worker.https.html b/testing/web-platform/tests/storage/estimate-indexeddb-worker.https.html
deleted file mode 100644
index 2366760bdbed..000000000000
--- a/testing/web-platform/tests/storage/estimate-indexeddb-worker.https.html
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
- StorageManager: estimate() for indexeddb from worker
-
-
-
-
-
-
-
-
-
diff --git a/testing/web-platform/tests/storage/storage-estimate-indexeddb.js b/testing/web-platform/tests/storage/estimate-indexeddb.https.any.js
similarity index 61%
rename from testing/web-platform/tests/storage/storage-estimate-indexeddb.js
rename to testing/web-platform/tests/storage/estimate-indexeddb.https.any.js
index 5f7895350ef5..3e34ad19babf 100644
--- a/testing/web-platform/tests/storage/storage-estimate-indexeddb.js
+++ b/testing/web-platform/tests/storage/estimate-indexeddb.https.any.js
@@ -1,15 +1,13 @@
-if (this.document === undefined) {
- importScripts("/resources/testharness.js");
-}
+// META: title=StorageManager: estimate() for indexeddb
-test(function(t) {
+test(t => {
assert_true('estimate' in navigator.storage);
assert_equals(typeof navigator.storage.estimate, 'function');
assert_true(navigator.storage.estimate() instanceof Promise);
}, 'estimate() method exists and returns a Promise');
-promise_test(function(t) {
- return navigator.storage.estimate().then(function(result) {
+promise_test(t => {
+ return navigator.storage.estimate().then(result => {
assert_true(typeof result === 'object');
assert_true('usage' in result);
assert_equals(typeof result.usage, 'number');
@@ -18,20 +16,20 @@ promise_test(function(t) {
});
}, 'estimate() resolves to dictionary with members');
-promise_test(function(t) {
+promise_test(t => {
const arraySize = 1e6;
const objectStoreName = "storageManager";
const dbname = this.window ? window.location.pathname :
- "estimate-worker.https.html";
+ "estimate-worker.https.html";
let db;
let usageBeforeCreate, usageAfterCreate, usageAfterPut;
function deleteDB(name) {
- return new Promise(function(resolve, reject) {
+ return new Promise((resolve, reject) => {
let deleteRequest = indexedDB.deleteDatabase(name);
- deleteRequest.onerror = function() { reject(deleteRequest.error); };
- deleteRequest.onsuccess = function() { resolve(); };
+ deleteRequest.onerror = () => { reject(deleteRequest.error); };
+ deleteRequest.onsuccess = () => { resolve(); };
});
}
@@ -41,13 +39,13 @@ promise_test(function(t) {
})
.then(estimate => {
usageBeforeCreate = estimate.usage;
- return new Promise(function(resolve, reject) {
+ return new Promise((resolve, reject) => {
let openRequest = indexedDB.open(dbname);
- openRequest.onerror = function() { reject(openRequest.error); };
- openRequest.onupgradeneeded = function(event) {
+ openRequest.onerror = () => { reject(openRequest.error); };
+ openRequest.onupgradeneeded = event => {
openRequest.result.createObjectStore(objectStoreName);
};
- openRequest.onsuccess = function() { resolve(openRequest.result); };
+ openRequest.onsuccess = () => { resolve(openRequest.result); };
});
})
.then(connection => {
@@ -56,8 +54,9 @@ promise_test(function(t) {
})
.then(estimate => {
usageAfterCreate = estimate.usage;
- assert_greater_than(usageAfterCreate, usageBeforeCreate,
- 'estimated usage should increase after object store is created');
+ assert_greater_than(
+ usageAfterCreate, usageBeforeCreate,
+ 'estimated usage should increase after object store is created');
let txn = db.transaction(objectStoreName, 'readwrite');
let buffer = new ArrayBuffer(arraySize);
@@ -70,9 +69,9 @@ promise_test(function(t) {
let testBlob = new Blob([buffer], {type: "binary/random"});
txn.objectStore(objectStoreName).add(testBlob, 1);
- return new Promise(function(resolve, reject) {
- txn.onabort = function() { reject(txn.error); };
- txn.oncomplete = function() { resolve(); };
+ return new Promise((resolve, reject) => {
+ txn.onabort = () => { reject(txn.error); };
+ txn.oncomplete = () => { resolve(); };
});
})
.then(() => {
@@ -80,15 +79,14 @@ promise_test(function(t) {
})
.then(estimate => {
usageAfterPut = estimate.usage;
- assert_greater_than(usageAfterPut, usageAfterCreate,
- 'estimated usage should increase after large value is stored');
+ assert_greater_than(
+ usageAfterPut, usageAfterCreate,
+ 'estimated usage should increase after large value is stored');
db.close();
- return deleteDB(dbname)
+ return deleteDB(dbname);
})
.then(() => {
t.done();
- })
+ });
}, 'estimate() shows usage increase after large value is stored');
-
-done();
diff --git a/testing/web-platform/tests/storage/estimate-indexeddb.https.html b/testing/web-platform/tests/storage/estimate-indexeddb.https.html
deleted file mode 100644
index 3f5e1589d346..000000000000
--- a/testing/web-platform/tests/storage/estimate-indexeddb.https.html
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
- StorageManager: estimate() for indexeddb
-
-
-
-
-
-
-
-
-
diff --git a/testing/web-platform/tests/storage/estimate-parallel.https.html b/testing/web-platform/tests/storage/estimate-parallel.https.any.js
similarity index 59%
rename from testing/web-platform/tests/storage/estimate-parallel.https.html
rename to testing/web-platform/tests/storage/estimate-parallel.https.any.js
index 571b08cd5e21..090f004b8514 100644
--- a/testing/web-platform/tests/storage/estimate-parallel.https.html
+++ b/testing/web-platform/tests/storage/estimate-parallel.https.any.js
@@ -1,10 +1,5 @@
-
-
-StorageManager: multiple estimate() calls in parallel
-
-
-
-
diff --git a/testing/web-platform/tests/storage/opaque-origin.https.html b/testing/web-platform/tests/storage/opaque-origin.https.window.js
similarity index 91%
rename from testing/web-platform/tests/storage/opaque-origin.https.html
rename to testing/web-platform/tests/storage/opaque-origin.https.window.js
index 563f2fea3c51..3e101dde6759 100644
--- a/testing/web-platform/tests/storage/opaque-origin.https.html
+++ b/testing/web-platform/tests/storage/opaque-origin.https.window.js
@@ -1,9 +1,4 @@
-
-
-StorageManager API and opaque origins
-
-
-
diff --git a/testing/web-platform/tests/storage/persisted-worker.https.html b/testing/web-platform/tests/storage/persisted-worker.https.html
deleted file mode 100644
index 21f5c8bd92d8..000000000000
--- a/testing/web-platform/tests/storage/persisted-worker.https.html
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
- StorageManager: persisted() from worker
-
-
-
-
-
-
-
-
-
diff --git a/testing/web-platform/tests/storage/storage-persisted.js b/testing/web-platform/tests/storage/persisted.https.any.js
similarity index 84%
rename from testing/web-platform/tests/storage/storage-persisted.js
rename to testing/web-platform/tests/storage/persisted.https.any.js
index 5bc86fea9519..57e15f0e811d 100644
--- a/testing/web-platform/tests/storage/storage-persisted.js
+++ b/testing/web-platform/tests/storage/persisted.https.any.js
@@ -1,6 +1,4 @@
-if (this.document === undefined) {
- importScripts("/resources/testharness.js");
-}
+// META: title=StorageManager: persisted()
test(function(t) {
assert_true('persisted' in navigator.storage);
@@ -14,5 +12,3 @@ promise_test(function(t) {
assert_equals(result, false);
});
}, 'persisted() returns a promise and resolves as boolean with false');
-
-done();
diff --git a/testing/web-platform/tests/storage/persisted.https.html b/testing/web-platform/tests/storage/persisted.https.html
deleted file mode 100644
index a5a91ff0b263..000000000000
--- a/testing/web-platform/tests/storage/persisted.https.html
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
- StorageManager: persisted()
-
-
-
-
-
-
-
-
-
diff --git a/testing/web-platform/tests/storage/resources/storagemanager-persisted-worker.js b/testing/web-platform/tests/storage/resources/storagemanager-persisted-worker.js
deleted file mode 100644
index 979c8be3cd39..000000000000
--- a/testing/web-platform/tests/storage/resources/storagemanager-persisted-worker.js
+++ /dev/null
@@ -1,13 +0,0 @@
-importScripts('/resources/testharness.js');
-
-promise_test(function() {
- var promise = navigator.storage.persisted();
- assert_true(promise instanceof Promise,
- 'navigator.storage.persisted() returned a Promise.');
- return promise.then(function (result) {
- assert_equals(typeof result, 'boolean',
- result + ' should be a boolean');
- });
-}, 'navigator.storage.persisted returns a promise that resolves.');
-
-done();
diff --git a/testing/web-platform/tests/storage/storagemanager-estimate.https.html b/testing/web-platform/tests/storage/storagemanager-estimate.https.any.js
similarity index 88%
rename from testing/web-platform/tests/storage/storagemanager-estimate.https.html
rename to testing/web-platform/tests/storage/storagemanager-estimate.https.any.js
index 08a699adfb00..d1d2e21924cd 100644
--- a/testing/web-platform/tests/storage/storagemanager-estimate.https.html
+++ b/testing/web-platform/tests/storage/storagemanager-estimate.https.any.js
@@ -1,10 +1,4 @@
-
-
-StorageManager: estimate()
-
-
-
-
diff --git a/testing/web-platform/tests/storage/storagemanager-persist-worker.https.html b/testing/web-platform/tests/storage/storagemanager-persist-worker.https.html
deleted file mode 100644
index 9c89a2f67125..000000000000
--- a/testing/web-platform/tests/storage/storagemanager-persist-worker.https.html
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-StorageManager: persist() (worker)
-
-
-
-
diff --git a/testing/web-platform/tests/storage/storagemanager-persist.https.html b/testing/web-platform/tests/storage/storagemanager-persist.https.window.js
similarity index 56%
rename from testing/web-platform/tests/storage/storagemanager-persist.https.html
rename to testing/web-platform/tests/storage/storagemanager-persist.https.window.js
index 61624fe272a6..13e17a16e141 100644
--- a/testing/web-platform/tests/storage/storagemanager-persist.https.html
+++ b/testing/web-platform/tests/storage/storagemanager-persist.https.window.js
@@ -1,10 +1,4 @@
-
-
-StorageManager: persist()
-
-
-
-
diff --git a/testing/web-platform/tests/storage/resources/storagemanager-persist-worker.js b/testing/web-platform/tests/storage/storagemanager-persist.https.worker.js
similarity index 59%
rename from testing/web-platform/tests/storage/resources/storagemanager-persist-worker.js
rename to testing/web-platform/tests/storage/storagemanager-persist.https.worker.js
index 1152e4ec7349..fcf8175f706f 100644
--- a/testing/web-platform/tests/storage/resources/storagemanager-persist-worker.js
+++ b/testing/web-platform/tests/storage/storagemanager-persist.https.worker.js
@@ -1,4 +1,5 @@
-importScripts('/resources/testharness.js');
+// META: title=StorageManager: persist() (worker)
+importScripts("/resources/testharness.js");
test(function() {
assert_false('persist' in navigator.storage);
diff --git a/testing/web-platform/tests/storage/storagemanager-persisted-worker.https.html b/testing/web-platform/tests/storage/storagemanager-persisted-worker.https.html
deleted file mode 100644
index 75004946164d..000000000000
--- a/testing/web-platform/tests/storage/storagemanager-persisted-worker.https.html
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-StorageManager: persisted() (worker)
-
-
-
-
diff --git a/testing/web-platform/tests/storage/storagemanager-persisted.https.html b/testing/web-platform/tests/storage/storagemanager-persisted.https.any.js
similarity index 56%
rename from testing/web-platform/tests/storage/storagemanager-persisted.https.html
rename to testing/web-platform/tests/storage/storagemanager-persisted.https.any.js
index 1d88c11bd8aa..70999406690f 100644
--- a/testing/web-platform/tests/storage/storagemanager-persisted.https.html
+++ b/testing/web-platform/tests/storage/storagemanager-persisted.https.any.js
@@ -1,10 +1,4 @@
-
-
-StorageManager: persist()
-
-
-
-