Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/storage/durability-basics.html

Issue 2805353003: Upstream navigator.storage.persist()/persisted() tests to WPT (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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); },
8 "These tests requires navigator.storage");
9
10 promise_test(function() {
11 var promise = navigator.storage.persist();
12 assert_true(promise instanceof Promise,
13 "navigator.storage.persist() returned a Promise.");
14 return promise.then(function (result) {
15 // Layout tests get canned results, not the value per spec. So testing
16 // their values here would only be testing our test plumbing. But we can
17 // test that the type of the returned value is correct.
18 assert_equals(typeof result, "boolean", result + " should be boolean");
19 });
20 }, "navigator.storage.persist returns a promise that resolves.");
21
22 promise_test(function() {
23 var promise = navigator.storage.persisted();
24 assert_true(promise instanceof Promise,
25 "navigator.storage.persisted() returned a Promise.");
26 return promise.then(function (result) {
27 // See comment above about why the result value isn't being tested here.
28 assert_equals(typeof result, "boolean", result + " should be boolean");
29 });
30 }, "navigator.storage.persisted returns a promise that resolves.");
31
32 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698