https://github.com/web-platform-tests/wpt
Raw File
Tip revision: dc4d765410fee7b5e4b0d638c12e881a806f55a8 authored by Anne van Kesteren on 05 April 2018, 13:53:52 UTC
add scenario from smaug
Tip revision: dc4d765
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