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 522185 1fb1b5a75a7961b9ddcf1db6a49cc01832b04acd
parent 522184 58ff2725e6a596e2a99cef687cccae88aada7f47
child 522186 e5f7bd9d93a4110b8d1890601ba6d70029ad4ef5
push id10871
push usercbrindusan@mozilla.com
push dateMon, 18 Mar 2019 15:49:32 +0000
treeherdermozilla-beta@018abdd16060 [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>