Diff
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (282087 => 282088)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2021-09-07 15:44:40 UTC (rev 282087)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2021-09-07 15:56:08 UTC (rev 282088)
@@ -1,3 +1,106 @@
+2021-09-07 Sihui Liu <sihui_...@apple.com>
+
+ Import storage tests from WPT
+ https://bugs.webkit.org/show_bug.cgi?id=229965
+
+ Reviewed by Youenn Fablet.
+
+ * resources/import-expectations.json:
+ * web-platform-tests/storage/META.yml: Added.
+ * web-platform-tests/storage/README.md: Added.
+ * web-platform-tests/storage/buckets/META.yml: Added.
+ * web-platform-tests/storage/buckets/w3c-import.log: Added.
+ * web-platform-tests/storage/estimate-indexeddb.https.any-expected.txt: Added.
+ * web-platform-tests/storage/estimate-indexeddb.https.any.html: Added.
+ * web-platform-tests/storage/estimate-indexeddb.https.any.js: Added.
+ (indexedDbOpenRequest):
+ (promise_test.async t):
+ * web-platform-tests/storage/estimate-indexeddb.https.any.worker-expected.txt: Added.
+ * web-platform-tests/storage/estimate-indexeddb.https.any.worker.html: Added.
+ * web-platform-tests/storage/estimate-parallel.https.any-expected.txt: Added.
+ * web-platform-tests/storage/estimate-parallel.https.any.html: Added.
+ * web-platform-tests/storage/estimate-parallel.https.any.js: Added.
+ (promise_test.async t):
+ * web-platform-tests/storage/estimate-parallel.https.any.worker-expected.txt: Added.
+ * web-platform-tests/storage/estimate-parallel.https.any.worker.html: Added.
+ * web-platform-tests/storage/estimate-usage-details-application-cache.https.tentative-expected.txt: Added.
+ * web-platform-tests/storage/estimate-usage-details-application-cache.https.tentative.html: Added.
+ * web-platform-tests/storage/estimate-usage-details-caches.https.tentative.any-expected.txt: Added.
+ * web-platform-tests/storage/estimate-usage-details-caches.https.tentative.any.html: Added.
+ * web-platform-tests/storage/estimate-usage-details-caches.https.tentative.any.js: Added.
+ (promise_test.async t):
+ * web-platform-tests/storage/estimate-usage-details-caches.https.tentative.any.worker-expected.txt: Added.
+ * web-platform-tests/storage/estimate-usage-details-caches.https.tentative.any.worker.html: Added.
+ * web-platform-tests/storage/estimate-usage-details-indexeddb.https.tentative.any-expected.txt: Added.
+ * web-platform-tests/storage/estimate-usage-details-indexeddb.https.tentative.any.html: Added.
+ * web-platform-tests/storage/estimate-usage-details-indexeddb.https.tentative.any.js: Added.
+ (promise_test.async t):
+ * web-platform-tests/storage/estimate-usage-details-indexeddb.https.tentative.any.worker-expected.txt: Added.
+ * web-platform-tests/storage/estimate-usage-details-indexeddb.https.tentative.any.worker.html: Added.
+ * web-platform-tests/storage/estimate-usage-details-service-workers.https.tentative.window-expected.txt: Added.
+ * web-platform-tests/storage/estimate-usage-details-service-workers.https.tentative.window.html: Added.
+ * web-platform-tests/storage/estimate-usage-details-service-workers.https.tentative.window.js: Added.
+ (promise_test.async t):
+ * web-platform-tests/storage/estimate-usage-details.https.tentative.any-expected.txt: Added.
+ * web-platform-tests/storage/estimate-usage-details.https.tentative.any.html: Added.
+ * web-platform-tests/storage/estimate-usage-details.https.tentative.any.js: Added.
+ (promise_test.async t):
+ * web-platform-tests/storage/estimate-usage-details.https.tentative.any.worker-expected.txt: Added.
+ * web-platform-tests/storage/estimate-usage-details.https.tentative.any.worker.html: Added.
+ * web-platform-tests/storage/helpers.js: Added.
+ (createDB):
+ * web-platform-tests/storage/idlharness.https.any-expected.txt: Added.
+ * web-platform-tests/storage/idlharness.https.any.html: Added.
+ * web-platform-tests/storage/idlharness.https.any.js: Added.
+ * web-platform-tests/storage/idlharness.https.any.worker-expected.txt: Added.
+ * web-platform-tests/storage/idlharness.https.any.worker.html: Added.
+ * web-platform-tests/storage/opaque-origin.https.window-expected.txt: Added.
+ * web-platform-tests/storage/opaque-origin.https.window.html: Added.
+ * web-platform-tests/storage/opaque-origin.https.window.js: Added.
+ (load_iframe):
+ (wait_for_message.return.new.Promise):
+ (forEach.snippet.assert_equals):
+ * web-platform-tests/storage/permission-query.https.any-expected.txt: Added.
+ * web-platform-tests/storage/permission-query.https.any.html: Added.
+ * web-platform-tests/storage/permission-query.https.any.js: Added.
+ (promise_test.async t):
+ * web-platform-tests/storage/permission-query.https.any.worker-expected.txt: Added.
+ * web-platform-tests/storage/permission-query.https.any.worker.html: Added.
+ * web-platform-tests/storage/persisted.https.any-expected.txt: Added.
+ * web-platform-tests/storage/persisted.https.any.html: Added.
+ * web-platform-tests/storage/persisted.https.any.js: Added.
+ (test):
+ (promise_test):
+ * web-platform-tests/storage/persisted.https.any.worker-expected.txt: Added.
+ * web-platform-tests/storage/persisted.https.any.worker.html: Added.
+ * web-platform-tests/storage/quotachange-in-detached-iframe.tentative.https-expected.txt: Added.
+ * web-platform-tests/storage/quotachange-in-detached-iframe.tentative.https.html: Added.
+ * web-platform-tests/storage/resources/appcache.manifest: Added.
+ * web-platform-tests/storage/resources/iframe_with_appcache_manifest.html: Added.
+ * web-platform-tests/storage/resources/w3c-import.log: Added.
+ * web-platform-tests/storage/storagemanager-estimate.https.any-expected.txt: Added.
+ * web-platform-tests/storage/storagemanager-estimate.https.any.html: Added.
+ * web-platform-tests/storage/storagemanager-estimate.https.any.js: Added.
+ (test):
+ (promise_test):
+ * web-platform-tests/storage/storagemanager-estimate.https.any.worker-expected.txt: Added.
+ * web-platform-tests/storage/storagemanager-estimate.https.any.worker.html: Added.
+ * web-platform-tests/storage/storagemanager-persist.https.window-expected.txt: Added.
+ * web-platform-tests/storage/storagemanager-persist.https.window.html: Added.
+ * web-platform-tests/storage/storagemanager-persist.https.window.js: Added.
+ (promise_test):
+ * web-platform-tests/storage/storagemanager-persist.https.worker-expected.txt: Added.
+ * web-platform-tests/storage/storagemanager-persist.https.worker.html: Added.
+ * web-platform-tests/storage/storagemanager-persist.https.worker.js: Added.
+ (test):
+ * web-platform-tests/storage/storagemanager-persisted.https.any-expected.txt: Added.
+ * web-platform-tests/storage/storagemanager-persisted.https.any.html: Added.
+ * web-platform-tests/storage/storagemanager-persisted.https.any.js: Added.
+ (promise_test):
+ * web-platform-tests/storage/storagemanager-persisted.https.any.worker-expected.txt: Added.
+ * web-platform-tests/storage/storagemanager-persisted.https.any.worker.html: Added.
+ * web-platform-tests/storage/w3c-import.log: Added.
+
2021-09-07 Brent Fulgham <bfulg...@apple.com>
[wpt-improvement] Improve CSP support for window reuse
Modified: trunk/LayoutTests/imported/w3c/resources/import-expectations.json (282087 => 282088)
--- trunk/LayoutTests/imported/w3c/resources/import-expectations.json 2021-09-07 15:44:40 UTC (rev 282087)
+++ trunk/LayoutTests/imported/w3c/resources/import-expectations.json 2021-09-07 15:56:08 UTC (rev 282088)
@@ -409,7 +409,7 @@
"web-platform-tests/shadow-dom/untriaged": "skip",
"web-platform-tests/speech-api": "import",
"web-platform-tests/staticrange": "skip",
- "web-platform-tests/storage": "skip",
+ "web-platform-tests/storage": "import",
"web-platform-tests/streams": "import",
"web-platform-tests/streams/writable-streams": "skip",
"web-platform-tests/subresource-integrity": "import",
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/META.yml (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/META.yml (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/META.yml 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,4 @@
+spec: https://storage.spec.whatwg.org/
+suggested_reviewers:
+ - annevk
+ - inexorabletash
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/README.md (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/README.md (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/README.md 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,7 @@
+This directory contains the Storage test suite.
+
+To run the tests in this test suite within a browser, go to: <https://w3c-test.org/storage/>.
+
+The living standard is: <https://storage.spec.whatwg.org/>
+
+The API is at: <https://storage.spec.whatwg.org/#api>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/buckets/META.yml (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/buckets/META.yml (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/buckets/META.yml 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,5 @@
+spec: https://github.com/WICG/storage-buckets
+suggested_reviewers:
+ - ayui
+ - jsbell
+ - pwnall
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/buckets/w3c-import.log (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/buckets/w3c-import.log (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/buckets/w3c-import.log 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,17 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the WPT github:
+ https://github.com/web-platform-tests/wpt
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/storage/buckets/META.yml
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-indexeddb.https.any-expected.txt (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-indexeddb.https.any-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-indexeddb.https.any-expected.txt 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,5 @@
+
+FAIL estimate() method exists and returns a Promise navigator.storage is not an Object. (evaluating ''estimate' in navigator.storage')
+FAIL estimate() resolves to dictionary with members promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.storage.estimate')"
+FAIL estimate() shows usage increase after large value is stored promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.storage.estimate')"
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-indexeddb.https.any.html (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-indexeddb.https.any.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-indexeddb.https.any.html 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-indexeddb.https.any.js (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-indexeddb.https.any.js (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-indexeddb.https.any.js 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,101 @@
+// META: title=StorageManager: estimate() for indexeddb
+
+function indexedDbOpenRequest(t, dbname, upgrade_func) {
+ return new Promise((resolve, reject) => {
+ const openRequest = indexedDB.open(dbname);
+ t.add_cleanup(() => {
+ indexedDbDeleteRequest(dbname);
+ });
+
+ openRequest._onerror_ = () => {
+ reject(openRequest.error);
+ };
+ openRequest._onsuccess_ = () => {
+ resolve(openRequest.result);
+ };
+ openRequest._onupgradeneeded_ = event => {
+ upgrade_func(openRequest.result);
+ };
+ });
+}
+
+function indexedDbDeleteRequest(name) {
+ return new Promise((resolve, reject) => {
+ const deleteRequest = indexedDB.deleteDatabase(name);
+ deleteRequest._onerror_ = () => {
+ reject(deleteRequest.error);
+ };
+ deleteRequest._onsuccess_ = () => {
+ resolve();
+ };
+ });
+}
+
+function transactionPromise(txn) {
+ return new Promise((resolve, reject) => {
+ txn._onabort_ = () => {
+ reject(txn.error);
+ };
+ txn._oncomplete_ = () => {
+ resolve();
+ };
+ });
+}
+
+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(async t => {
+ const estimate = await navigator.storage.estimate();
+ assert_equals(typeof estimate, 'object');
+ assert_true('usage' in estimate);
+ assert_equals(typeof estimate.usage, 'number');
+ assert_true('quota' in estimate);
+ assert_equals(typeof estimate.quota, 'number');
+}, 'estimate() resolves to dictionary with members');
+
+promise_test(async t => {
+ const arraySize = 1e6;
+ const objectStoreName = "storageManager";
+ const dbname = this.window ? window.location.pathname :
+ "estimate-worker.https.html";
+
+ await indexedDbDeleteRequest(dbname);
+ let estimate = await navigator.storage.estimate();
+
+ const usageBeforeCreate = estimate.usage;
+ const db = await indexedDbOpenRequest(t, dbname, (db_to_upgrade) => {
+ db_to_upgrade.createObjectStore(objectStoreName);
+ });
+
+ estimate = await navigator.storage.estimate();
+ const usageAfterCreate = estimate.usage;
+
+ assert_greater_than(
+ usageAfterCreate, usageBeforeCreate,
+ 'estimated usage should increase after object store is created');
+
+ const txn = db.transaction(objectStoreName, 'readwrite');
+ const buffer = new ArrayBuffer(arraySize);
+ const view = new Uint8Array(buffer);
+
+ for (let i = 0; i < arraySize; i++) {
+ view[i] = Math.floor(Math.random() * 255);
+ }
+
+ const testBlob = new Blob([buffer], {type: "binary/random"});
+ txn.objectStore(objectStoreName).add(testBlob, 1);
+
+ await transactionPromise(txn);
+
+ estimate = await navigator.storage.estimate();
+ const usageAfterPut = estimate.usage;
+ assert_greater_than(
+ usageAfterPut, usageAfterCreate,
+ 'estimated usage should increase after large value is stored');
+
+ db.close();
+}, 'estimate() shows usage increase after large value is stored');
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-indexeddb.https.any.worker-expected.txt (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-indexeddb.https.any.worker-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-indexeddb.https.any.worker-expected.txt 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,5 @@
+
+FAIL estimate() method exists and returns a Promise navigator.storage is not an Object. (evaluating ''estimate' in navigator.storage')
+FAIL estimate() resolves to dictionary with members promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.storage.estimate')"
+FAIL estimate() shows usage increase after large value is stored promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.storage.estimate')"
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-indexeddb.https.any.worker.html (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-indexeddb.https.any.worker.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-indexeddb.https.any.worker.html 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-parallel.https.any-expected.txt (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-parallel.https.any-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-parallel.https.any-expected.txt 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,3 @@
+
+FAIL Multiple estimate() calls in parallel should complete promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.storage.estimate')"
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-parallel.https.any.html (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-parallel.https.any.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-parallel.https.any.html 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-parallel.https.any.js (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-parallel.https.any.js (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-parallel.https.any.js 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,13 @@
+// META: title=StorageManager: multiple estimate() calls in parallel
+
+promise_test(async t => {
+ let r1, r2;
+ await Promise.all([
+ navigator.storage.estimate().then(r => { r1 = r; }),
+ navigator.storage.estimate().then(r => { r2 = r; })
+ ]);
+ assert_true(('usage' in r1) && ('quota' in r1),
+ 'first response should have expected fields');
+ assert_true(('usage' in r2) && ('quota' in r2),
+ 'second response should have expected fields');
+}, 'Multiple estimate() calls in parallel should complete');
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-parallel.https.any.worker-expected.txt (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-parallel.https.any.worker-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-parallel.https.any.worker-expected.txt 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,3 @@
+
+FAIL Multiple estimate() calls in parallel should complete promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.storage.estimate')"
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-parallel.https.any.worker.html (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-parallel.https.any.worker.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-parallel.https.any.worker.html 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-application-cache.https.tentative-expected.txt (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-application-cache.https.tentative-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-application-cache.https.tentative-expected.txt 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,3 @@
+
+FAIL estimate() shows usage increase after app is cached promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.storage.estimate')"
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-application-cache.https.tentative.html (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-application-cache.https.tentative.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-application-cache.https.tentative.html 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,29 @@
+<!doctype html>
+<html>
+<title>Quota Estimate: usage details reflect application cache changes.</title>
+<meta charset='utf-8'>
+<link rel='author' href='' title='Jarryd Goodman'>
+<script src=''></script>
+<script src=''></script>
+<script src=''></script>
+<script>
+'use strict';
+
+promise_test(async t => {
+ let estimate = await navigator.storage.estimate();
+
+ const usageBeforeCreate = estimate.usageDetails.applicationCache || 0;
+
+ const iframe = await
+ createIframe('./resources/iframe_with_appcache_manifest.html', t);
+ await waitForMessage();
+
+ estimate = await navigator.storage.estimate();
+ assert_true('applicationCache' in estimate.usageDetails);
+ const usageAfterCreate = estimate.usageDetails.applicationCache;
+
+ assert_greater_than(
+ usageAfterCreate, usageBeforeCreate);
+}, 'estimate() shows usage increase after app is cached');
+</script>
+</html>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-caches.https.tentative.any-expected.txt (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-caches.https.tentative.any-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-caches.https.tentative.any-expected.txt 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,3 @@
+
+FAIL estimate() shows usage increase after large value is stored promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.storage.estimate')"
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-caches.https.tentative.any.html (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-caches.https.tentative.any.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-caches.https.tentative.any.html 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-caches.https.tentative.any.js (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-caches.https.tentative.any.js (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-caches.https.tentative.any.js 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,20 @@
+// META: title=StorageManager: estimate() for caches
+
+promise_test(async t => {
+ let estimate = await navigator.storage.estimate();
+
+ const cachesUsageBeforeCreate = estimate.usageDetails.caches || 0;
+
+ const cacheName = 'testCache';
+ const cache = await caches.open(cacheName);
+ t.add_cleanup(() => caches.delete(cacheName));
+
+ await cache.put('/test.json', new Response('x'.repeat(1024*1024)));
+
+ estimate = await navigator.storage.estimate();
+ assert_true('caches' in estimate.usageDetails);
+ const cachesUsageAfterPut = estimate.usageDetails.caches;
+ assert_greater_than(
+ cachesUsageAfterPut, cachesUsageBeforeCreate,
+ 'estimated usage should increase after value is stored');
+}, 'estimate() shows usage increase after large value is stored');
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-caches.https.tentative.any.worker-expected.txt (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-caches.https.tentative.any.worker-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-caches.https.tentative.any.worker-expected.txt 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,3 @@
+
+FAIL estimate() shows usage increase after large value is stored promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.storage.estimate')"
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-caches.https.tentative.any.worker.html (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-caches.https.tentative.any.worker.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-caches.https.tentative.any.worker.html 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-indexeddb.https.tentative.any-expected.txt (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-indexeddb.https.tentative.any-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-indexeddb.https.tentative.any-expected.txt 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,4 @@
+
+FAIL estimate() resolves to dictionary with usageDetails member promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.storage.estimate')"
+FAIL estimate() usage details reflects increase in indexedDB after large value is stored promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.storage.estimate')"
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-indexeddb.https.tentative.any.html (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-indexeddb.https.tentative.any.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-indexeddb.https.tentative.any.html 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-indexeddb.https.tentative.any.js (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-indexeddb.https.tentative.any.js (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-indexeddb.https.tentative.any.js 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,59 @@
+// META: title=StorageManager: estimate() usage details for indexeddb
+// META: script=helpers.js
+// META: script=../IndexedDB/support-promises.js
+
+promise_test(async t => {
+ const estimate = await navigator.storage.estimate()
+ assert_equals(typeof estimate.usageDetails, 'object');
+}, 'estimate() resolves to dictionary with usageDetails member');
+
+promise_test(async t => {
+ // We use 100KB here because db compaction usually happens every few MB
+ // 100KB is large enough to avoid a false positive (small amounts of metadata
+ // getting written for some random reason), and small enough to avoid
+ // compaction with a reasonably high probability.
+ const writeSize = 1024 * 100;
+ const objectStoreName = 'store';
+ const dbname = self.location.pathname;
+
+ await indexedDB.deleteDatabase(dbname);
+ let usageAfterWrite, usageBeforeWrite;
+ // TODO(crbug.com/906867): Refactor this test to better deal with db/log
+ // compaction flakiness
+ // The for loop here is to help make this test less flaky. The reason it is
+ // flaky is that database and/or log compaction could happen in the middle of
+ // this loop. The problem is that this test runs in a large batch of tests,
+ // and previous tests might have created a lot of garbage which could trigger
+ // compaction. Suppose the initial estimate shows 1MB usage before creating
+ // the db. Compaction could happen after this step and before we measure
+ // usage at the end, meaning the 1MB could be wiped to 0, an extra 1024 * 100
+ // is put in, and the actual increase in usage does not reach our expected
+ // increase. Loop 10 times here to be safe (and reduce the number of bot
+ // builds that fail); all it takes is one iteration without compaction for
+ // this to pass.
+ for (let i = 0; i < 10; i++) {
+ const db = await createDB(dbname, objectStoreName, t);
+ let estimate = await navigator.storage.estimate();
+
+ // If usage is 0, usageDetails does not include the usage (undefined)
+ usageBeforeWrite = estimate.usageDetails.indexedDB || 0;
+
+ const txn = db.transaction(objectStoreName, 'readwrite');
+ const valueToStore = largeValue(writeSize, Math.random() * 255);
+ txn.objectStore(objectStoreName).add(valueToStore, 1);
+
+ await transactionPromise(txn);
+
+ estimate = await navigator.storage.estimate();
+ usageAfterWrite = estimate.usageDetails.indexedDB;
+ db.close();
+
+ if (usageAfterWrite - usageBeforeWrite >= writeSize) {
+ break;
+ }
+ }
+
+ assert_greater_than_equal(usageAfterWrite - usageBeforeWrite,
+ writeSize);
+}, 'estimate() usage details reflects increase in indexedDB after large ' +
+ 'value is stored');
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-indexeddb.https.tentative.any.worker-expected.txt (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-indexeddb.https.tentative.any.worker-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-indexeddb.https.tentative.any.worker-expected.txt 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,4 @@
+
+FAIL estimate() resolves to dictionary with usageDetails member promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.storage.estimate')"
+FAIL estimate() usage details reflects increase in indexedDB after large value is stored promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.storage.estimate')"
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-indexeddb.https.tentative.any.worker.html (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-indexeddb.https.tentative.any.worker.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-indexeddb.https.tentative.any.worker.html 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-service-workers.https.tentative.window-expected.txt (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-service-workers.https.tentative.window-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-service-workers.https.tentative.window-expected.txt 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,3 @@
+
+FAIL estimate() shows usage increase after large value is stored promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.storage.estimate')"
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-service-workers.https.tentative.window.html (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-service-workers.https.tentative.window.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-service-workers.https.tentative.window.html 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-service-workers.https.tentative.window.js (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-service-workers.https.tentative.window.js (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-service-workers.https.tentative.window.js 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,38 @@
+// META: title=StorageManager: estimate() for service worker registrations
+const wait_for_active = worker => new Promise(resolve =>{
+ if (worker.active) { resolve(worker.active); }
+
+ const listen_for_active = worker => e => {
+ if (e.target.state === 'activated') { resolve(worker.active); }
+ }
+
+ if (worker.waiting) {
+ worker.waiting
+ .addEventListener('statechange', listen_for_active(worker.waiting));
+ }
+ if (worker.installing) {
+ worker.installing
+ .addEventListener('statechange', listen_for_active(worker.installing));
+ }
+});
+
+promise_test(async t => {
+ let estimate = await navigator.storage.estimate();
+ const usageBeforeCreate = estimate.usageDetails.serviceWorkerRegistrations ||
+ 0;
+ // Note: helpers.js is an arbitrary file; it could be any file that
+ // exists, but this test does not depend on the contents of said file.
+ const serviceWorkerRegistration = await
+ navigator.serviceWorker.register('./helpers.js');
+
+ t.add_cleanup(() => serviceWorkerRegistration.unregister());
+ await wait_for_active(serviceWorkerRegistration);
+
+ estimate = await navigator.storage.estimate();
+ assert_true('serviceWorkerRegistrations' in estimate.usageDetails);
+
+ const usageAfterCreate = estimate.usageDetails.serviceWorkerRegistrations;
+ assert_greater_than(
+ usageAfterCreate, usageBeforeCreate,
+ 'estimated usage should increase after service worker is registered');
+}, 'estimate() shows usage increase after large value is stored');
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details.https.tentative.any-expected.txt (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details.https.tentative.any-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details.https.tentative.any-expected.txt 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,3 @@
+
+FAIL estimate() resolves to dictionary with members, including usageDetails promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.storage.estimate')"
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details.https.tentative.any.html (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details.https.tentative.any.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details.https.tentative.any.html 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details.https.tentative.any.js (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details.https.tentative.any.js (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details.https.tentative.any.js 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,12 @@
+// META: title=StorageManager: estimate() should have usage details
+
+promise_test(async t => {
+ const estimate = await navigator.storage.estimate();
+ assert_equals(typeof estimate, 'object');
+ assert_true('usage' in estimate);
+ assert_equals(typeof estimate.usage, 'number');
+ assert_true('quota' in estimate);
+ assert_equals(typeof estimate.quota, 'number');
+ assert_true('usageDetails' in estimate);
+ assert_equals(typeof estimate.usageDetails, 'object');
+}, 'estimate() resolves to dictionary with members, including usageDetails');
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details.https.tentative.any.worker-expected.txt (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details.https.tentative.any.worker-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details.https.tentative.any.worker-expected.txt 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,3 @@
+
+FAIL estimate() resolves to dictionary with members, including usageDetails promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.storage.estimate')"
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details.https.tentative.any.worker.html (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details.https.tentative.any.worker.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details.https.tentative.any.worker.html 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/helpers.js (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/helpers.js (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/helpers.js 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,43 @@
+/**
+ * @description - Function will create a database with the supplied name
+ * and also create an object store with the specified name.
+ * If a db with the name dbName exists, this will raze the
+ * existing DB beforehand.
+ * @param {string} dbName
+ * @param {string} objectStoreName
+ * @param {testCase} t
+ * @returns {Promise} - A promise that resolves to an indexedDB open request
+ */
+function createDB(dbName, objectStoreName, t) {
+ return new Promise((resolve, reject) => {
+ const openRequest = indexedDB.open(dbName);
+ t.add_cleanup(() => {
+ indexedDB.deleteDatabase(dbName);
+ });
+
+ openRequest._onerror_ = () => {
+ reject(openRequest.error);
+ };
+ openRequest._onsuccess_ = () => {
+ resolve(openRequest.result);
+ };
+ openRequest._onupgradeneeded_ = event => {
+ openRequest.result.createObjectStore(objectStoreName);
+ };
+ });
+}
+
+/**
+ * @description - This function will wrap an IDBTransaction in a promise,
+ * resolving in the oncomplete() method and rejecting with the
+ * transaction error in the onabort() case.
+ * @param {IDBTransaction} transaction - The transaction to wrap in a promise.
+ * @returns {Promise} - A promise that resolves when the transaction is either
+ * aborted or completed.
+ */
+function transactionPromise(transaction) {
+ return new Promise((resolve, reject) => {
+ transaction._onabort_ = () => { reject(transaction.error); };
+ transaction._oncomplete_ = () => { resolve(); };
+ });
+}
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/idlharness.https.any-expected.txt (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/idlharness.https.any-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/idlharness.https.any-expected.txt 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,34 @@
+
+PASS idl_test setup
+PASS idl_test validation
+PASS Partial interface mixin NavigatorID: member names are unique
+PASS Navigator includes NavigatorStorage: member names are unique
+PASS WorkerNavigator includes NavigatorStorage: member names are unique
+PASS Navigator includes NavigatorID: member names are unique
+PASS Navigator includes NavigatorLanguage: member names are unique
+PASS Navigator includes NavigatorOnLine: member names are unique
+PASS Navigator includes NavigatorContentUtils: member names are unique
+PASS Navigator includes NavigatorCookies: member names are unique
+PASS Navigator includes NavigatorPlugins: member names are unique
+PASS Navigator includes NavigatorConcurrentHardware: member names are unique
+PASS WorkerNavigator includes NavigatorID: member names are unique
+PASS WorkerNavigator includes NavigatorLanguage: member names are unique
+PASS WorkerNavigator includes NavigatorOnLine: member names are unique
+PASS WorkerNavigator includes NavigatorConcurrentHardware: member names are unique
+FAIL StorageManager interface: existence and properties of interface object assert_own_property: self does not have own property "StorageManager" expected property "StorageManager" missing
+FAIL StorageManager interface object length assert_own_property: self does not have own property "StorageManager" expected property "StorageManager" missing
+FAIL StorageManager interface object name assert_own_property: self does not have own property "StorageManager" expected property "StorageManager" missing
+FAIL StorageManager interface: existence and properties of interface prototype object assert_own_property: self does not have own property "StorageManager" expected property "StorageManager" missing
+FAIL StorageManager interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "StorageManager" expected property "StorageManager" missing
+FAIL StorageManager interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "StorageManager" expected property "StorageManager" missing
+FAIL StorageManager interface: operation persisted() assert_own_property: self does not have own property "StorageManager" expected property "StorageManager" missing
+FAIL StorageManager interface: operation persist() assert_own_property: self does not have own property "StorageManager" expected property "StorageManager" missing
+FAIL StorageManager interface: operation estimate() assert_own_property: self does not have own property "StorageManager" expected property "StorageManager" missing
+FAIL StorageManager must be primary interface of navigator.storage assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL Stringification of navigator.storage assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL StorageManager interface: navigator.storage must inherit property "persisted()" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL StorageManager interface: navigator.storage must inherit property "persist()" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL StorageManager interface: navigator.storage must inherit property "estimate()" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL Navigator interface: attribute storage assert_true: The prototype object must have a property "storage" expected true got false
+FAIL Navigator interface: navigator must inherit property "storage" with the proper type assert_inherits: property "storage" not found in prototype chain
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/idlharness.https.any.html (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/idlharness.https.any.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/idlharness.https.any.html 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/idlharness.https.any.js (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/idlharness.https.any.js (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/idlharness.https.any.js 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,18 @@
+// META: script=/resources/WebIDLParser.js
+// META: script=/resources/idlharness.js
+// META: timeout=long
+
+'use strict';
+
+idl_test(
+ ['storage'],
+ ['html'],
+ idl_array => {
+ idl_array.add_objects({ StorageManager: ['navigator.storage'] });
+ if (self.Window) {
+ idl_array.add_objects({ Navigator: ['navigator'] });
+ } else {
+ idl_array.add_objects({ WorkerNavigator: ['navigator'] });
+ }
+ }
+);
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/idlharness.https.any.worker-expected.txt (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/idlharness.https.any.worker-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/idlharness.https.any.worker-expected.txt 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,34 @@
+
+PASS idl_test setup
+PASS idl_test validation
+PASS Partial interface mixin NavigatorID: member names are unique
+PASS Navigator includes NavigatorStorage: member names are unique
+PASS WorkerNavigator includes NavigatorStorage: member names are unique
+PASS Navigator includes NavigatorID: member names are unique
+PASS Navigator includes NavigatorLanguage: member names are unique
+PASS Navigator includes NavigatorOnLine: member names are unique
+PASS Navigator includes NavigatorContentUtils: member names are unique
+PASS Navigator includes NavigatorCookies: member names are unique
+PASS Navigator includes NavigatorPlugins: member names are unique
+PASS Navigator includes NavigatorConcurrentHardware: member names are unique
+PASS WorkerNavigator includes NavigatorID: member names are unique
+PASS WorkerNavigator includes NavigatorLanguage: member names are unique
+PASS WorkerNavigator includes NavigatorOnLine: member names are unique
+PASS WorkerNavigator includes NavigatorConcurrentHardware: member names are unique
+FAIL StorageManager interface: existence and properties of interface object assert_own_property: self does not have own property "StorageManager" expected property "StorageManager" missing
+FAIL StorageManager interface object length assert_own_property: self does not have own property "StorageManager" expected property "StorageManager" missing
+FAIL StorageManager interface object name assert_own_property: self does not have own property "StorageManager" expected property "StorageManager" missing
+FAIL StorageManager interface: existence and properties of interface prototype object assert_own_property: self does not have own property "StorageManager" expected property "StorageManager" missing
+FAIL StorageManager interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "StorageManager" expected property "StorageManager" missing
+FAIL StorageManager interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "StorageManager" expected property "StorageManager" missing
+FAIL StorageManager interface: operation persisted() assert_own_property: self does not have own property "StorageManager" expected property "StorageManager" missing
+FAIL StorageManager interface: member persist undefined is not an Object. (evaluating 'member.name in this.get_interface_object()')
+FAIL StorageManager interface: operation estimate() assert_own_property: self does not have own property "StorageManager" expected property "StorageManager" missing
+FAIL StorageManager must be primary interface of navigator.storage assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL Stringification of navigator.storage assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL StorageManager interface: navigator.storage must inherit property "persisted()" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL StorageManager interface: navigator.storage must not have property "persist" obj is not an Object. (evaluating 'member.name in obj')
+FAIL StorageManager interface: navigator.storage must inherit property "estimate()" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL WorkerNavigator interface: attribute storage assert_true: The prototype object must have a property "storage" expected true got false
+FAIL WorkerNavigator interface: navigator must inherit property "storage" with the proper type assert_inherits: property "storage" not found in prototype chain
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/idlharness.https.any.worker.html (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/idlharness.https.any.worker.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/idlharness.https.any.worker.html 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/opaque-origin.https.window-expected.txt (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/opaque-origin.https.window-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/opaque-origin.https.window-expected.txt 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,8 @@
+
+FAIL navigator.storage.persisted() in non-sandboxed iframe should not reject assert_equals: navigator.storage.persisted() should not reject expected "no rejection" but got "API access threw"
+FAIL navigator.storage.persisted() in sandboxed iframe should reject with TypeError assert_equals: navigator.storage.persisted() should reject with TypeError expected "correct rejection" but got "API access threw"
+FAIL navigator.storage.estimate() in non-sandboxed iframe should not reject assert_equals: navigator.storage.estimate() should not reject expected "no rejection" but got "API access threw"
+FAIL navigator.storage.estimate() in sandboxed iframe should reject with TypeError assert_equals: navigator.storage.estimate() should reject with TypeError expected "correct rejection" but got "API access threw"
+FAIL navigator.storage.persist() in non-sandboxed iframe should not reject assert_equals: navigator.storage.persist() should not reject expected "no rejection" but got "API access threw"
+FAIL navigator.storage.persist() in sandboxed iframe should reject with TypeError assert_equals: navigator.storage.persist() should reject with TypeError expected "correct rejection" but got "API access threw"
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/opaque-origin.https.window.html (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/opaque-origin.https.window.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/opaque-origin.https.window.html 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/opaque-origin.https.window.js (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/opaque-origin.https.window.js (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/opaque-origin.https.window.js 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,80 @@
+// META: title=StorageManager API and opaque origins
+
+function load_iframe(src, sandbox) {
+ return new Promise(resolve => {
+ const iframe = document.createElement('iframe');
+ iframe._onload_ = () => { resolve(iframe); };
+ if (sandbox)
+ iframe.sandbox = sandbox;
+ iframe.srcdoc = src;
+ iframe.style.display = 'none';
+ document.documentElement.appendChild(iframe);
+ });
+}
+
+function wait_for_message(iframe) {
+ return new Promise(resolve => {
+ self.addEventListener('message', function listener(e) {
+ if (e.source === iframe.contentWindow && "result" in e.data) {
+ resolve(e.data);
+ self.removeEventListener('message', listener);
+ }
+ });
+ });
+}
+
+function make_script(snippet) {
+ return '<script src="" +
+ '<script>' +
+ ' window._onmessage_ = () => {' +
+ ' try {' +
+ ' (' + snippet + ')' +
+ ' .then(' +
+ ' result => {' +
+ ' window.parent.postMessage({result: "no rejection"}, "*");' +
+ ' }, ' +
+ ' error => {' +
+ ' try {' +
+ ' assert_throws_js(TypeError, () => { throw error; });' +
+ ' window.parent.postMessage({result: "correct rejection"}, "*");' +
+ ' } catch (e) {' +
+ ' window.parent.postMessage({result: "incorrect rejection"}, "*");' +
+ ' }' +
+ ' });' +
+ ' } catch (ex) {' +
+ // Report if not implemented/exposed, rather than time out.
+ ' window.parent.postMessage({result: "API access threw"}, "*");' +
+ ' }' +
+ ' };' +
+ '<\/script>';
+}
+
+['navigator.storage.persisted()',
+ 'navigator.storage.estimate()',
+ // persist() can prompt, so make sure we test that last
+ 'navigator.storage.persist()',
+].forEach(snippet => {
+ promise_test(t => {
+ return load_iframe(make_script(snippet))
+ .then(iframe => {
+ iframe.contentWindow.postMessage({}, '*');
+ return wait_for_message(iframe);
+ })
+ .then(message => {
+ assert_equals(message.result, 'no rejection',
+ `${snippet} should not reject`);
+ });
+ }, `${snippet} in non-sandboxed iframe should not reject`);
+
+ promise_test(t => {
+ return load_iframe(make_script(snippet), 'allow-scripts')
+ .then(iframe => {
+ iframe.contentWindow.postMessage({}, '*');
+ return wait_for_message(iframe);
+ })
+ .then(message => {
+ assert_equals(message.result, 'correct rejection',
+ `${snippet} should reject with TypeError`);
+ });
+ }, `${snippet} in sandboxed iframe should reject with TypeError`);
+});
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/permission-query.https.any-expected.txt (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/permission-query.https.any-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/permission-query.https.any-expected.txt 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,3 @@
+
+FAIL The "persistent-storage" permission is recognized promise_test: Unhandled rejection with value: object "TypeError: Type error"
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/permission-query.https.any.html (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/permission-query.https.any.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/permission-query.https.any.html 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/permission-query.https.any.js (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/permission-query.https.any.js (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/permission-query.https.any.js 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,10 @@
+// META: title=The Permission API registration for "persistent-storage"
+
+promise_test(async t => {
+ const status =
+ await navigator.permissions.query({name: 'persistent-storage'});
+ assert_equals(status.constructor, PermissionStatus,
+ 'query() result should resolve to a PermissionStatus');
+ assert_true(['granted','denied', 'prompt'].includes(status.state),
+ 'state should be a PermissionState');
+}, 'The "persistent-storage" permission is recognized');
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/permission-query.https.any.worker-expected.txt (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/permission-query.https.any.worker-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/permission-query.https.any.worker-expected.txt 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,3 @@
+
+FAIL The "persistent-storage" permission is recognized promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.permissions.query')"
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/permission-query.https.any.worker.html (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/permission-query.https.any.worker.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/permission-query.https.any.worker.html 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/persisted.https.any-expected.txt (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/persisted.https.any-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/persisted.https.any-expected.txt 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,4 @@
+
+FAIL persisted() method exists and returns a Promise navigator.storage is not an Object. (evaluating ''persisted' in navigator.storage')
+FAIL persisted() returns a promise and resolves as boolean with false undefined is not an object (evaluating 'navigator.storage.persisted')
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/persisted.https.any.html (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/persisted.https.any.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/persisted.https.any.html 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/persisted.https.any.js (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/persisted.https.any.js (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/persisted.https.any.js 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,14 @@
+// META: title=StorageManager: persisted()
+
+test(function(t) {
+ assert_true('persisted' in navigator.storage);
+ assert_equals(typeof navigator.storage.persisted, 'function');
+ assert_true(navigator.storage.persisted() instanceof Promise);
+}, 'persisted() method exists and returns a Promise');
+
+promise_test(function(t) {
+ return navigator.storage.persisted().then(function(result) {
+ assert_equals(typeof result, 'boolean');
+ assert_equals(result, false);
+ });
+}, 'persisted() returns a promise and resolves as boolean with false');
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/persisted.https.any.worker-expected.txt (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/persisted.https.any.worker-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/persisted.https.any.worker-expected.txt 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,4 @@
+
+FAIL persisted() method exists and returns a Promise navigator.storage is not an Object. (evaluating ''persisted' in navigator.storage')
+FAIL persisted() returns a promise and resolves as boolean with false undefined is not an object (evaluating 'navigator.storage.persisted')
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/persisted.https.any.worker.html (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/persisted.https.any.worker.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/persisted.https.any.worker.html 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/quotachange-in-detached-iframe.tentative.https-expected.txt (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/quotachange-in-detached-iframe.tentative.https-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/quotachange-in-detached-iframe.tentative.https-expected.txt 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,3 @@
+
+FAIL Add quotachange listener on detached iframe. undefined is not an object (evaluating 'storageManager.addEventListener')
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/quotachange-in-detached-iframe.tentative.https.html (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/quotachange-in-detached-iframe.tentative.https.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/quotachange-in-detached-iframe.tentative.https.html 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,21 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>quotachange event on DOMWindow of detached iframe</title>
+<link rel="author" href="" title="Jarryd">
+<script src=""
+<script src=""
+<iframe id="iframe"></iframe>
+<script>
+'use strict';
+
+test(t => {
+ const iframe = document.getElementById('iframe');
+ const frameWindow = iframe.contentWindow;
+ const storageManager = frameWindow.navigator.storage;
+
+ iframe.parentNode.removeChild(iframe);
+ const emptyListener = () => {};
+ storageManager.addEventListener('quotachange', emptyListener);
+ storageManager.removeEventListener('quotachange', emptyListener);
+}, "Add quotachange listener on detached iframe.");
+</script>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/resources/appcache.manifest (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/resources/appcache.manifest (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/resources/appcache.manifest 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,3 @@
+CACHE MANIFEST
+# iframe_with_appcache_manifest.html references this manifest to get cached in
+# AppCache.
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/resources/iframe_with_appcache_manifest.html (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/resources/iframe_with_appcache_manifest.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/resources/iframe_with_appcache_manifest.html 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,17 @@
+<!doctype html>
+<html manifest="appcache.manifest">
+<title>Iframe that will be cached using application cache.</title>
+<meta charset='utf-8'>
+<link rel='author' href='' title='Jarryd Goodman'>
+<script>
+(async () => {
+ const initPromise = new Promise(resolve => {
+ applicationCache.addEventListener('cached', resolve);
+ applicationCache.addEventListener('noupdate', resolve);
+ });
+ await initPromise;
+
+ window.parent.postMessage('document cached');
+})();
+</script>
+</html>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/resources/w3c-import.log (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/resources/w3c-import.log (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/resources/w3c-import.log 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,18 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the WPT github:
+ https://github.com/web-platform-tests/wpt
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/storage/resources/appcache.manifest
+/LayoutTests/imported/w3c/web-platform-tests/storage/resources/iframe_with_appcache_manifest.html
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-estimate.https.any-expected.txt (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-estimate.https.any-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-estimate.https.any-expected.txt 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,5 @@
+
+FAIL estimate() method returns a Promise undefined is not an object (evaluating 'navigator.storage.estimate')
+FAIL estimate() resolves to dictionary with members undefined is not an object (evaluating 'navigator.storage.estimate')
+FAIL estimate() shows usage increase after 1MB IndexedDB record is stored promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.storage.estimate')"
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-estimate.https.any.html (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-estimate.https.any.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-estimate.https.any.html 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-estimate.https.any.js (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-estimate.https.any.js (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-estimate.https.any.js 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,60 @@
+// META: title=StorageManager: estimate()
+
+test(function(t) {
+ assert_true(navigator.storage.estimate() instanceof Promise);
+}, 'estimate() method returns a Promise');
+
+promise_test(function(t) {
+ return navigator.storage.estimate().then(function(result) {
+ assert_equals(typeof result, 'object');
+ assert_true('usage' in result);
+ assert_equals(typeof result.usage, 'number');
+ assert_true('quota' in result);
+ assert_equals(typeof result.quota, 'number');
+ });
+}, 'estimate() resolves to dictionary with members');
+
+promise_test(function(t) {
+ const large_value = new Uint8Array(1e6);
+ const dbname = `db-${location}-${t.name}`;
+ let db, before, after;
+
+ indexedDB.deleteDatabase(dbname);
+ return new Promise((resolve, reject) => {
+ const open = indexedDB.open(dbname);
+ open._onerror_ = () => { reject(open.error); };
+ open._onupgradeneeded_ = () => {
+ const connection = open.result;
+ connection.createObjectStore('store');
+ };
+ open._onsuccess_ = () => {
+ const connection = open.result;
+ t.add_cleanup(() => {
+ connection.close();
+ indexedDB.deleteDatabase(dbname);
+ });
+ resolve(connection);
+ };
+ })
+ .then(connection => {
+ db = connection;
+ return navigator.storage.estimate();
+ })
+ .then(estimate => {
+ before = estimate.usage;
+ return new Promise((resolve, reject) => {
+ const tx = db.transaction('store', 'readwrite');
+ tx.objectStore('store').put(large_value, 'key');
+ tx._onabort_ = () => { reject(tx.error); };
+ tx._oncomplete_ = () => { resolve(); };
+ });
+ })
+ .then(() => {
+ return navigator.storage.estimate();
+ })
+ .then(estimate => {
+ after = estimate.usage;
+ assert_greater_than(after, before,
+ 'estimated usage should increase');
+ });
+}, 'estimate() shows usage increase after 1MB IndexedDB record is stored');
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-estimate.https.any.worker-expected.txt (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-estimate.https.any.worker-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-estimate.https.any.worker-expected.txt 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,5 @@
+
+FAIL estimate() method returns a Promise undefined is not an object (evaluating 'navigator.storage.estimate')
+FAIL estimate() resolves to dictionary with members undefined is not an object (evaluating 'navigator.storage.estimate')
+FAIL estimate() shows usage increase after 1MB IndexedDB record is stored promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'navigator.storage.estimate')"
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-estimate.https.any.worker.html (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-estimate.https.any.worker.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-estimate.https.any.worker.html 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persist.https.window-expected.txt (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persist.https.window-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persist.https.window-expected.txt 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,3 @@
+
+FAIL navigator.storage.persist() returns a promise that resolves. undefined is not an object (evaluating 'navigator.storage.persist')
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persist.https.window.html (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persist.https.window.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persist.https.window.html 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persist.https.window.js (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persist.https.window.js (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persist.https.window.js 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,10 @@
+// META: title=StorageManager: persist()
+
+promise_test(function() {
+ var promise = navigator.storage.persist();
+ assert_true(promise instanceof Promise,
+ 'navigator.storage.persist() returned a Promise.');
+ return promise.then(function(result) {
+ assert_equals(typeof result, 'boolean', result + ' should be boolean');
+ });
+}, 'navigator.storage.persist() returns a promise that resolves.');
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persist.https.worker-expected.txt (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persist.https.worker-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persist.https.worker-expected.txt 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,3 @@
+
+FAIL navigator.storage.persist should not exist in workers navigator.storage is not an Object. (evaluating ''persist' in navigator.storage')
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persist.https.worker.html (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persist.https.worker.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persist.https.worker.html 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persist.https.worker.js (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persist.https.worker.js (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persist.https.worker.js 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,8 @@
+// META: title=StorageManager: persist() (worker)
+importScripts("/resources/testharness.js");
+
+test(function() {
+ assert_false('persist' in navigator.storage);
+}, 'navigator.storage.persist should not exist in workers');
+
+done();
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persisted.https.any-expected.txt (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persisted.https.any-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persisted.https.any-expected.txt 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,3 @@
+
+FAIL navigator.storage.persisted() returns a promise that resolves. undefined is not an object (evaluating 'navigator.storage.persisted')
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persisted.https.any.html (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persisted.https.any.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persisted.https.any.html 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persisted.https.any.js (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persisted.https.any.js (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persisted.https.any.js 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,10 @@
+// META: title=StorageManager: persisted()
+
+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 boolean');
+ });
+}, 'navigator.storage.persisted() returns a promise that resolves.');
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persisted.https.any.worker-expected.txt (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persisted.https.any.worker-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persisted.https.any.worker-expected.txt 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,3 @@
+
+FAIL navigator.storage.persisted() returns a promise that resolves. undefined is not an object (evaluating 'navigator.storage.persisted')
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persisted.https.any.worker.html (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persisted.https.any.worker.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persisted.https.any.worker.html 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/storage/w3c-import.log (0 => 282088)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/storage/w3c-import.log (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/storage/w3c-import.log 2021-09-07 15:56:08 UTC (rev 282088)
@@ -0,0 +1,35 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the WPT github:
+ https://github.com/web-platform-tests/wpt
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/storage/META.yml
+/LayoutTests/imported/w3c/web-platform-tests/storage/README.md
+/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-indexeddb.https.any.js
+/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-parallel.https.any.js
+/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-application-cache.https.tentative.html
+/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-caches.https.tentative.any.js
+/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-indexeddb.https.tentative.any.js
+/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details-service-workers.https.tentative.window.js
+/LayoutTests/imported/w3c/web-platform-tests/storage/estimate-usage-details.https.tentative.any.js
+/LayoutTests/imported/w3c/web-platform-tests/storage/helpers.js
+/LayoutTests/imported/w3c/web-platform-tests/storage/idlharness.https.any.js
+/LayoutTests/imported/w3c/web-platform-tests/storage/opaque-origin.https.window.js
+/LayoutTests/imported/w3c/web-platform-tests/storage/permission-query.https.any.js
+/LayoutTests/imported/w3c/web-platform-tests/storage/persisted.https.any.js
+/LayoutTests/imported/w3c/web-platform-tests/storage/quotachange-in-detached-iframe.tentative.https.html
+/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-estimate.https.any.js
+/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persist.https.window.js
+/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persist.https.worker.js
+/LayoutTests/imported/w3c/web-platform-tests/storage/storagemanager-persisted.https.any.js