OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <title>navigator.storage methods return promises that are fulfilled</title> | |
3 <script src="/resources/testharness.js"></script> | |
4 <script src="/resources/testharnessreport.js"></script> | |
5 <script> | |
6 | |
7 test(function() { assert_true(!!navigator.storage); }, "These tests requires nav igator.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.
| |
8 | |
9 promise_test(function() { | |
10 var promise = navigator.storage.requestPersistent(); | |
11 assert_true(promise instanceof Promise, "navigator.storage.requestPersistent () returned a Promise.") | |
12 return promise.then(function (result) { | |
13 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.
| |
14 assert_greater_than(result.length, 0, "result should have length >0"); | |
15 }); | |
16 }, "navigator.storage.requestPersistent returns a promise that resolves."); | |
17 | |
18 promise_test(function() { | |
19 var promise = navigator.storage.persistentPermission(); | |
20 assert_true(promise instanceof Promise, "navigator.storage.persistentPermiss ion() returned a Promise.") | |
21 return promise.then(function (result) { | |
22 assert_equals(typeof result, "string", result + " should be a string"); | |
23 assert_greater_than(result.length, 0, "result should have length >0"); | |
24 }); | |
25 }, "navigator.storage.persistentPermission returns a promise that resolves."); | |
26 | |
27 </script> | |
OLD | NEW |