https://github.com/web-platform-tests/wpt
Raw File
Tip revision: de277f72555a8613d1d38a9a6df270d16621ac89 authored by Chris Nardi on 29 March 2018, 23:23:28 UTC
Build spec links with short URLs for CSS testsuites
Tip revision: de277f7
storage-persisted.js
if (this.document === undefined) {
  importScripts("/resources/testharness.js");
}

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');

done();
back to top