Bug 1527719 [wpt PR 15359] - KV storage: make backingStore return the same frozen object, a=testonly
authorDomenic Denicola <domenic@chromium.org>
Tue, 05 Mar 2019 12:17:23 +0000
changeset 464584 f5dcec1e551e4e82a27be96e1afdd2248bd843d8
parent 464583 c2a6392bd581b822c5b17cbf357a05673cef8e09
child 464585 db90080867414585fb1baf9ad8974be98850b119
push id80669
push useraciure@mozilla.com
push dateSun, 17 Mar 2019 09:47:54 +0000
treeherderautoland@e0861be8d6c0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1527719, 15359, 931263, 1466863, 632657
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1527719 [wpt PR 15359] - KV storage: make backingStore return the same frozen object, a=testonly Automatic update from web-platform-tests KV storage: make backingStore return the same frozen object Follows https://github.com/WICG/kv-storage/pull/51. Bug: 931263 Change-Id: Ia3b1482093bfaca443b8809c6e284397fdb6fec1 Reviewed-on: https://chromium-review.googlesource.com/c/1466863 Reviewed-by: Victor Costan <pwnall@chromium.org> Commit-Queue: Victor Costan <pwnall@chromium.org> Cr-Commit-Position: refs/heads/master@{#632657} -- wpt-commits: 14b470e2e03c1e792bef6e2fafbc244b78af9f3b wpt-pr: 15359
testing/web-platform/tests/kv-storage/backingstore.https.html
testing/web-platform/tests/kv-storage/storage-smoke-test.https.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/kv-storage/backingstore.https.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>KV Storage: backingStore getter</title>
+<!-- See https://github.com/WICG/kv-storage/issues/45 -->
+
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<script type="module">
+import { storage } from "std:kv-storage";
+
+test(() => {
+  assert_equals(storage.backingStore, storage.backingStore);
+}, "backingStore must return the same object each time");
+
+test(() => {
+  assert_true(Object.isFrozen(storage.backingStore));
+}, "backingStore must be a frozen object");
+
+test(() => {
+  const { backingStore } = storage;
+  assert_array_equals(Object.keys(backingStore), ["database", "store", "version"], "property names");
+  assert_array_equals(Object.getOwnPropertySymbols(backingStore), [], "no symbols")
+  assert_own_property(backingStore, "database");
+  assert_own_property(backingStore, "store");
+  assert_own_property(backingStore, "version");
+  assert_equals(Object.getPrototypeOf(backingStore), Object.prototype);
+
+  assert_equals(backingStore.database, "kv-storage:default");
+  assert_equals(backingStore.store, "store");
+  assert_equals(backingStore.version, 1);
+}, "backingStore object must have the right shape");
+</script>
--- a/testing/web-platform/tests/kv-storage/storage-smoke-test.https.html
+++ b/testing/web-platform/tests/kv-storage/storage-smoke-test.https.html
@@ -4,25 +4,12 @@
 
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 
 <script type="module">
 import { testVariousMethodsWithDefaultArea } from "./helpers/kvs-tests.js";
 import { storage } from "std:kv-storage";
 
-test(() => {
-  const { backingStore } = storage;
-  assert_array_equals(Object.keys(backingStore), ["database", "store", "version"]);
-  assert_own_property(backingStore, "database");
-  assert_own_property(backingStore, "store");
-  assert_own_property(backingStore, "version");
-  assert_equals(Object.getPrototypeOf(backingStore), Object.prototype);
-
-  assert_equals(backingStore.database, "kv-storage:default");
-  assert_equals(backingStore.store, "store");
-  assert_equals(backingStore.version, 1);
-}, "backingStore returns the correct object");
-
 testVariousMethodsWithDefaultArea(
   "Storage methods smoke test with string key and value", "key", "value", assert_equals
 );
 </script>