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

Unified Diff: third_party/WebKit/LayoutTests/storage/indexeddb/shared-array-buffer-throws.html

Issue 2838783002: SharedArrayBuffer throws serializing to indexeddb (Closed)
Patch Set: forgot README 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/storage/indexeddb/shared-array-buffer-throws.html
diff --git a/third_party/WebKit/LayoutTests/storage/indexeddb/shared-array-buffer-throws.html b/third_party/WebKit/LayoutTests/storage/indexeddb/shared-array-buffer-throws.html
new file mode 100644
index 0000000000000000000000000000000000000000..b311032cfcbdcacac13cc4f36fd0e0c5dc195a40
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/storage/indexeddb/shared-array-buffer-throws.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<title>IndexedDB: Attempting to serialize a SharedArrayBuffer should throw</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+
+if (window.SharedArrayBuffer) {
+ async_test(t => {
+ const sab = new SharedArrayBuffer('256');
jbroman 2017/04/25 17:37:23 nit: It's rather weird to pass a string here, give
binji 2017/04/25 18:06:26 Heh, I noticed this too :) Done.
+ const open = indexedDB.open('db');
jsbell 2017/04/25 00:27:48 I know I gave you the sample code in the bug, but
binji 2017/04/25 17:37:18 Done.
+ open.onupgradeneeded = t.step_func(e => {
+ const db = open.result;
+ db.createObjectStore('store');
+ });
+ open.onsuccess = t.step_func_done(e => {
+ const db = open.result;
+ const tx = db.transaction('store', 'readwrite');
+ const store = tx.objectStore('store');
+
+ assert_throws("DataCloneError", () => {
+ store.put({sab: sab}, 'key');
+ });
+ });
+ }, 'Serializing SharedArrayBuffer throws DataClone error.');
+} else {
+ done();
jbroman 2017/04/25 17:37:23 nit: I don't think you need to explicitly call don
binji 2017/04/25 18:06:26 Hm, the non-virtual testsuite version hangs when I
jbroman 2017/04/25 18:09:42 Acknowledged.
+}
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698