Chromium Code Reviews| Index: LayoutTests/http/tests/storage/durability-basics.html |
| diff --git a/LayoutTests/http/tests/storage/durability-basics.html b/LayoutTests/http/tests/storage/durability-basics.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..68bb682c0dd9a613d002c96503cf6e7951377e96 |
| --- /dev/null |
| +++ b/LayoutTests/http/tests/storage/durability-basics.html |
| @@ -0,0 +1,27 @@ |
| +<!DOCTYPE html> |
| +<title>navigator.storage methods return promises that are fulfilled</title> |
| +<script src="/resources/testharness.js"></script> |
| +<script src="/resources/testharnessreport.js"></script> |
| +<script> |
| + |
| +test(function() { assert_true(!!navigator.storage); }, "These tests requires navigator.storage"); |
|
jsbell
2015/08/10 17:49:41
Nit (if you're touching this file) - can you forma
dgrogan
2015/08/10 18:39:56
Done.
|
| + |
| +promise_test(function() { |
| + var promise = navigator.storage.requestPersistent(); |
| + assert_true(promise instanceof Promise, "navigator.storage.requestPersistent() returned a Promise.") |
| + return promise.then(function (result) { |
| + assert_equals(typeof result, "string", result + " should be a string"); |
|
jsbell
2015/08/10 17:49:41
As we've discussed offline, layout tests get canne
dgrogan
2015/08/10 18:39:56
Done.
|
| + assert_greater_than(result.length, 0, "result should have length >0"); |
| + }); |
| +}, "navigator.storage.requestPersistent returns a promise that resolves."); |
| + |
| +promise_test(function() { |
| + var promise = navigator.storage.persistentPermission(); |
| + assert_true(promise instanceof Promise, "navigator.storage.persistentPermission() returned a Promise.") |
| + return promise.then(function (result) { |
| + assert_equals(typeof result, "string", result + " should be a string"); |
| + assert_greater_than(result.length, 0, "result should have length >0"); |
| + }); |
| +}, "navigator.storage.persistentPermission returns a promise that resolves."); |
| + |
| +</script> |