Chromium Code Reviews| 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> |