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

Unified Diff: LayoutTests/http/tests/storage/resources/durability-worker.js

Issue 1301393002: Expose durable storage to workers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/storage/resources/durability-worker.js
diff --git a/LayoutTests/http/tests/storage/durability-basics.html b/LayoutTests/http/tests/storage/resources/durability-worker.js
similarity index 50%
copy from LayoutTests/http/tests/storage/durability-basics.html
copy to LayoutTests/http/tests/storage/resources/durability-worker.js
index dc476829a1239f2b9439d19bccfe2acbaef93d98..8c0c5b706a96ff4b7445355e8c9d410be13d7ba0 100644
--- a/LayoutTests/http/tests/storage/durability-basics.html
+++ b/LayoutTests/http/tests/storage/resources/durability-worker.js
@@ -1,33 +1,22 @@
-<!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>
+importScripts("/resources/testharness.js");
test(function() { assert_true(!!navigator.storage); },
- "These tests requires navigator.storage");
+ "These worker tests require navigator.storage");
-promise_test(function() {
- var promise = navigator.storage.requestPersistent();
- assert_true(promise instanceof Promise,
- "navigator.storage.requestPersistent() returned a Promise.")
- return promise.then(function (result) {
- // Layout tests get canned results, not the value per spec. So testing
- // their values here would only be testing our test plumbing. But we can
- // test that the type of the returned value is correct.
- assert_equals(typeof result, "boolean", result + " should be boolean");
- });
-}, "navigator.storage.requestPersistent returns a promise that resolves.");
+test(function() { assert_false(navigator.storage.requestPersistent); },
+ "navigator.storage.requestPersistent should not exist in workers");
promise_test(function() {
var promise = navigator.storage.persistentPermission();
assert_true(promise instanceof Promise,
"navigator.storage.persistentPermission() returned a Promise.")
return promise.then(function (result) {
- // See comment above about why the result value isn't being tested here.
+ // Layout tests get canned results, not the value per spec. So testing
+ // their values here would only be testing our test plumbing. But we can
+ // test that the type of the returned value is correct.
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>
+done();

Powered by Google App Engine
This is Rietveld 408576698