1 Test structured clone permutations in IndexedDB. File/FileList tests require DumpRenderTree.
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
6 indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
8 dbname = "structured-clone.html"
9 indexedDB.deleteDatabase(dbname)
10 indexedDB.open(dbname)
11 store = db.createObjectStore('storeName')
12 This index is not used, but evaluating key path on each put() call will exercise (de)serialization:
13 store.createIndex('indexName', 'dummyKeyPath')
18 transaction = db.transaction('storeName', 'readwrite')
19 store = transaction.objectStore('storeName')
20 store.put(value, 'key')
22 PASS is(test_data, result) is true
26 transaction = db.transaction('storeName', 'readwrite')
27 store = transaction.objectStore('storeName')
28 store.put(value, 'key')
30 PASS is(test_data, result) is true
33 Testing boolean primitives
36 transaction = db.transaction('storeName', 'readwrite')
37 store = transaction.objectStore('storeName')
38 store.put(value, 'key')
40 PASS is(test_data, result) is true
43 transaction = db.transaction('storeName', 'readwrite')
44 store = transaction.objectStore('storeName')
45 store.put(value, 'key')
47 PASS is(test_data, result) is true
50 Testing number primitives
53 transaction = db.transaction('storeName', 'readwrite')
54 store = transaction.objectStore('storeName')
55 store.put(value, 'key')
57 PASS is(test_data, result) is true
60 transaction = db.transaction('storeName', 'readwrite')
61 store = transaction.objectStore('storeName')
62 store.put(value, 'key')
64 PASS is(test_data, result) is true
66 Testing: -Number.MAX_VALUE
67 transaction = db.transaction('storeName', 'readwrite')
68 store = transaction.objectStore('storeName')
69 store.put(value, 'key')
71 PASS is(test_data, result) is true
74 transaction = db.transaction('storeName', 'readwrite')
75 store = transaction.objectStore('storeName')
76 store.put(value, 'key')
78 PASS is(test_data, result) is true
81 transaction = db.transaction('storeName', 'readwrite')
82 store = transaction.objectStore('storeName')
83 store.put(value, 'key')
85 PASS is(test_data, result) is true
88 transaction = db.transaction('storeName', 'readwrite')
89 store = transaction.objectStore('storeName')
90 store.put(value, 'key')
92 PASS is(test_data, result) is true
95 transaction = db.transaction('storeName', 'readwrite')
96 store = transaction.objectStore('storeName')
97 store.put(value, 'key')
99 PASS is(test_data, result) is true
101 Testing: -Number.MIN_VALUE
102 transaction = db.transaction('storeName', 'readwrite')
103 store = transaction.objectStore('storeName')
104 store.put(value, 'key')
106 PASS is(test_data, result) is true
109 transaction = db.transaction('storeName', 'readwrite')
110 store = transaction.objectStore('storeName')
111 store.put(value, 'key')
113 PASS is(test_data, result) is true
116 transaction = db.transaction('storeName', 'readwrite')
117 store = transaction.objectStore('storeName')
118 store.put(value, 'key')
120 PASS is(test_data, result) is true
123 transaction = db.transaction('storeName', 'readwrite')
124 store = transaction.objectStore('storeName')
125 store.put(value, 'key')
127 PASS is(test_data, result) is true
129 Testing: Number.MIN_VALUE
130 transaction = db.transaction('storeName', 'readwrite')
131 store = transaction.objectStore('storeName')
132 store.put(value, 'key')
134 PASS is(test_data, result) is true
137 transaction = db.transaction('storeName', 'readwrite')
138 store = transaction.objectStore('storeName')
139 store.put(value, 'key')
141 PASS is(test_data, result) is true
144 transaction = db.transaction('storeName', 'readwrite')
145 store = transaction.objectStore('storeName')
146 store.put(value, 'key')
148 PASS is(test_data, result) is true
151 transaction = db.transaction('storeName', 'readwrite')
152 store = transaction.objectStore('storeName')
153 store.put(value, 'key')
155 PASS is(test_data, result) is true
157 Testing: Number.MAX_VALUE
158 transaction = db.transaction('storeName', 'readwrite')
159 store = transaction.objectStore('storeName')
160 store.put(value, 'key')
162 PASS is(test_data, result) is true
165 transaction = db.transaction('storeName', 'readwrite')
166 store = transaction.objectStore('storeName')
167 store.put(value, 'key')
169 PASS is(test_data, result) is true
172 Testing string primitives
175 transaction = db.transaction('storeName', 'readwrite')
176 store = transaction.objectStore('storeName')
177 store.put(value, 'key')
179 PASS is(test_data, result) is true
181 Testing: 'this is a sample string'
182 transaction = db.transaction('storeName', 'readwrite')
183 store = transaction.objectStore('storeName')
184 store.put(value, 'key')
186 PASS is(test_data, result) is true
189 transaction = db.transaction('storeName', 'readwrite')
190 store = transaction.objectStore('storeName')
191 store.put(value, 'key')
193 PASS is(test_data, result) is true
196 Testing Boolean objects
198 Testing: new Boolean(true)
199 transaction = db.transaction('storeName', 'readwrite')
200 store = transaction.objectStore('storeName')
201 store.put(value, 'key')
203 PASS typeof result is "object"
204 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
205 PASS test_data !== result is true
206 PASS result.toString() is test_data.toString()
207 PASS is(test_data.valueOf(), result.valueOf()) is true
209 Testing: new Boolean(false)
210 transaction = db.transaction('storeName', 'readwrite')
211 store = transaction.objectStore('storeName')
212 store.put(value, 'key')
214 PASS typeof result is "object"
215 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
216 PASS test_data !== result is true
217 PASS result.toString() is test_data.toString()
218 PASS is(test_data.valueOf(), result.valueOf()) is true
221 Testing Number objects
223 Testing: new Number(NaN)
224 transaction = db.transaction('storeName', 'readwrite')
225 store = transaction.objectStore('storeName')
226 store.put(value, 'key')
228 PASS typeof result is "object"
229 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
230 PASS test_data !== result is true
231 PASS result.toString() is test_data.toString()
232 PASS is(test_data.valueOf(), result.valueOf()) is true
234 Testing: new Number(-Infinity)
235 transaction = db.transaction('storeName', 'readwrite')
236 store = transaction.objectStore('storeName')
237 store.put(value, 'key')
239 PASS typeof result is "object"
240 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
241 PASS test_data !== result is true
242 PASS result.toString() is test_data.toString()
243 PASS is(test_data.valueOf(), result.valueOf()) is true
245 Testing: new Number(-Number.MAX_VALUE)
246 transaction = db.transaction('storeName', 'readwrite')
247 store = transaction.objectStore('storeName')
248 store.put(value, 'key')
250 PASS typeof result is "object"
251 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
252 PASS test_data !== result is true
253 PASS result.toString() is test_data.toString()
254 PASS is(test_data.valueOf(), result.valueOf()) is true
256 Testing: new Number(-Number.MIN_VALUE)
257 transaction = db.transaction('storeName', 'readwrite')
258 store = transaction.objectStore('storeName')
259 store.put(value, 'key')
261 PASS typeof result is "object"
262 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
263 PASS test_data !== result is true
264 PASS result.toString() is test_data.toString()
265 PASS is(test_data.valueOf(), result.valueOf()) is true
267 Testing: new Number(-0)
268 transaction = db.transaction('storeName', 'readwrite')
269 store = transaction.objectStore('storeName')
270 store.put(value, 'key')
272 PASS typeof result is "object"
273 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
274 PASS test_data !== result is true
275 PASS result.toString() is test_data.toString()
276 PASS is(test_data.valueOf(), result.valueOf()) is true
278 Testing: new Number(0)
279 transaction = db.transaction('storeName', 'readwrite')
280 store = transaction.objectStore('storeName')
281 store.put(value, 'key')
283 PASS typeof result is "object"
284 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
285 PASS test_data !== result is true
286 PASS result.toString() is test_data.toString()
287 PASS is(test_data.valueOf(), result.valueOf()) is true
289 Testing: new Number(Number.MIN_VALUE)
290 transaction = db.transaction('storeName', 'readwrite')
291 store = transaction.objectStore('storeName')
292 store.put(value, 'key')
294 PASS typeof result is "object"
295 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
296 PASS test_data !== result is true
297 PASS result.toString() is test_data.toString()
298 PASS is(test_data.valueOf(), result.valueOf()) is true
300 Testing: new Number(Number.MAX_VALUE)
301 transaction = db.transaction('storeName', 'readwrite')
302 store = transaction.objectStore('storeName')
303 store.put(value, 'key')
305 PASS typeof result is "object"
306 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
307 PASS test_data !== result is true
308 PASS result.toString() is test_data.toString()
309 PASS is(test_data.valueOf(), result.valueOf()) is true
311 Testing: new Number(Infinity)
312 transaction = db.transaction('storeName', 'readwrite')
313 store = transaction.objectStore('storeName')
314 store.put(value, 'key')
316 PASS typeof result is "object"
317 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
318 PASS test_data !== result is true
319 PASS result.toString() is test_data.toString()
320 PASS is(test_data.valueOf(), result.valueOf()) is true
323 Testing String objects
325 Testing: new String()
326 transaction = db.transaction('storeName', 'readwrite')
327 store = transaction.objectStore('storeName')
328 store.put(value, 'key')
330 PASS typeof result is "object"
331 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
332 PASS test_data !== result is true
333 PASS result.toString() is test_data.toString()
334 PASS is(test_data.valueOf(), result.valueOf()) is true
336 Testing: new String('this is a sample string')
337 transaction = db.transaction('storeName', 'readwrite')
338 store = transaction.objectStore('storeName')
339 store.put(value, 'key')
341 PASS typeof result is "object"
342 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
343 PASS test_data !== result is true
344 PASS result.toString() is test_data.toString()
345 PASS is(test_data.valueOf(), result.valueOf()) is true
347 Testing: new String('null(\0)')
348 transaction = db.transaction('storeName', 'readwrite')
349 store = transaction.objectStore('storeName')
350 store.put(value, 'key')
352 PASS typeof result is "object"
353 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
354 PASS test_data !== result is true
355 PASS result.toString() is test_data.toString()
356 PASS is(test_data.valueOf(), result.valueOf()) is true
361 Testing: new Date(-1e13)
362 transaction = db.transaction('storeName', 'readwrite')
363 store = transaction.objectStore('storeName')
364 store.put(value, 'key')
366 PASS typeof result is "object"
367 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
368 PASS test_data !== result is true
369 PASS result.toString() is test_data.toString()
370 PASS is(test_data.valueOf(), result.valueOf()) is true
372 Testing: new Date(-1e12)
373 transaction = db.transaction('storeName', 'readwrite')
374 store = transaction.objectStore('storeName')
375 store.put(value, 'key')
377 PASS typeof result is "object"
378 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
379 PASS test_data !== result is true
380 PASS result.toString() is test_data.toString()
381 PASS is(test_data.valueOf(), result.valueOf()) is true
383 Testing: new Date(-1e9)
384 transaction = db.transaction('storeName', 'readwrite')
385 store = transaction.objectStore('storeName')
386 store.put(value, 'key')
388 PASS typeof result is "object"
389 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
390 PASS test_data !== result is true
391 PASS result.toString() is test_data.toString()
392 PASS is(test_data.valueOf(), result.valueOf()) is true
394 Testing: new Date(-1e6)
395 transaction = db.transaction('storeName', 'readwrite')
396 store = transaction.objectStore('storeName')
397 store.put(value, 'key')
399 PASS typeof result is "object"
400 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
401 PASS test_data !== result is true
402 PASS result.toString() is test_data.toString()
403 PASS is(test_data.valueOf(), result.valueOf()) is true
405 Testing: new Date(-1e3)
406 transaction = db.transaction('storeName', 'readwrite')
407 store = transaction.objectStore('storeName')
408 store.put(value, 'key')
410 PASS typeof result is "object"
411 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
412 PASS test_data !== result is true
413 PASS result.toString() is test_data.toString()
414 PASS is(test_data.valueOf(), result.valueOf()) is true
417 transaction = db.transaction('storeName', 'readwrite')
418 store = transaction.objectStore('storeName')
419 store.put(value, 'key')
421 PASS typeof result is "object"
422 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
423 PASS test_data !== result is true
424 PASS result.toString() is test_data.toString()
425 PASS is(test_data.valueOf(), result.valueOf()) is true
427 Testing: new Date(1e3)
428 transaction = db.transaction('storeName', 'readwrite')
429 store = transaction.objectStore('storeName')
430 store.put(value, 'key')
432 PASS typeof result is "object"
433 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
434 PASS test_data !== result is true
435 PASS result.toString() is test_data.toString()
436 PASS is(test_data.valueOf(), result.valueOf()) is true
438 Testing: new Date(1e6)
439 transaction = db.transaction('storeName', 'readwrite')
440 store = transaction.objectStore('storeName')
441 store.put(value, 'key')
443 PASS typeof result is "object"
444 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
445 PASS test_data !== result is true
446 PASS result.toString() is test_data.toString()
447 PASS is(test_data.valueOf(), result.valueOf()) is true
449 Testing: new Date(1e9)
450 transaction = db.transaction('storeName', 'readwrite')
451 store = transaction.objectStore('storeName')
452 store.put(value, 'key')
454 PASS typeof result is "object"
455 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
456 PASS test_data !== result is true
457 PASS result.toString() is test_data.toString()
458 PASS is(test_data.valueOf(), result.valueOf()) is true
460 Testing: new Date(1e12)
461 transaction = db.transaction('storeName', 'readwrite')
462 store = transaction.objectStore('storeName')
463 store.put(value, 'key')
465 PASS typeof result is "object"
466 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
467 PASS test_data !== result is true
468 PASS result.toString() is test_data.toString()
469 PASS is(test_data.valueOf(), result.valueOf()) is true
471 Testing: new Date(1e13)
472 transaction = db.transaction('storeName', 'readwrite')
473 store = transaction.objectStore('storeName')
474 store.put(value, 'key')
476 PASS typeof result is "object"
477 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
478 PASS test_data !== result is true
479 PASS result.toString() is test_data.toString()
480 PASS is(test_data.valueOf(), result.valueOf()) is true
483 Testing RegExp objects
485 Testing RegExp: new RegExp()
486 transaction = db.transaction('storeName', 'readwrite')
487 store = transaction.objectStore('storeName')
488 store.put(value, 'key')
490 PASS test_data !== result is true
491 PASS Object.prototype.toString.call(result) is "[object RegExp]"
492 PASS result.toString() is test_data.toString()
494 Testing RegExp: /abc/
495 transaction = db.transaction('storeName', 'readwrite')
496 store = transaction.objectStore('storeName')
497 store.put(value, 'key')
499 PASS test_data !== result is true
500 PASS Object.prototype.toString.call(result) is "[object RegExp]"
501 PASS result.toString() is test_data.toString()
503 Testing RegExp: /abc/g
504 transaction = db.transaction('storeName', 'readwrite')
505 store = transaction.objectStore('storeName')
506 store.put(value, 'key')
508 PASS test_data !== result is true
509 PASS Object.prototype.toString.call(result) is "[object RegExp]"
510 PASS result.toString() is test_data.toString()
512 Testing RegExp: /abc/i
513 transaction = db.transaction('storeName', 'readwrite')
514 store = transaction.objectStore('storeName')
515 store.put(value, 'key')
517 PASS test_data !== result is true
518 PASS Object.prototype.toString.call(result) is "[object RegExp]"
519 PASS result.toString() is test_data.toString()
521 Testing RegExp: /abc/gi
522 transaction = db.transaction('storeName', 'readwrite')
523 store = transaction.objectStore('storeName')
524 store.put(value, 'key')
526 PASS test_data !== result is true
527 PASS Object.prototype.toString.call(result) is "[object RegExp]"
528 PASS result.toString() is test_data.toString()
530 Testing RegExp: /abc/m
531 transaction = db.transaction('storeName', 'readwrite')
532 store = transaction.objectStore('storeName')
533 store.put(value, 'key')
535 PASS test_data !== result is true
536 PASS Object.prototype.toString.call(result) is "[object RegExp]"
537 PASS result.toString() is test_data.toString()
539 Testing RegExp: /abc/mg
540 transaction = db.transaction('storeName', 'readwrite')
541 store = transaction.objectStore('storeName')
542 store.put(value, 'key')
544 PASS test_data !== result is true
545 PASS Object.prototype.toString.call(result) is "[object RegExp]"
546 PASS result.toString() is test_data.toString()
548 Testing RegExp: /abc/mi
549 transaction = db.transaction('storeName', 'readwrite')
550 store = transaction.objectStore('storeName')
551 store.put(value, 'key')
553 PASS test_data !== result is true
554 PASS Object.prototype.toString.call(result) is "[object RegExp]"
555 PASS result.toString() is test_data.toString()
557 Testing RegExp: /abc/mgi
558 transaction = db.transaction('storeName', 'readwrite')
559 store = transaction.objectStore('storeName')
560 store.put(value, 'key')
562 PASS test_data !== result is true
563 PASS Object.prototype.toString.call(result) is "[object RegExp]"
564 PASS result.toString() is test_data.toString()
568 canvas = document.createElement('canvas')
571 test_data = canvas.getContext('2d').getImageData(0, 0, 8, 8)
572 transaction = db.transaction('storeName', 'readwrite')
573 store = transaction.objectStore('storeName')
574 store.put(value, 'key')
576 PASS test_data !== result is true
577 PASS Object.prototype.toString.call(result) is "[object ImageData]"
578 PASS result.width is test_data.width
579 PASS result.height is test_data.height
580 PASS result.data.length is test_data.data.length
581 PASS result data matches
584 PASS FileReader != null is true
585 test_content = 'This is a test. This is only a test.'
586 test_data = new Blob([test_content])
587 transaction = db.transaction('storeName', 'readwrite')
588 store = transaction.objectStore('storeName')
589 store.put(value, 'key')
591 PASS test_data !== result is true
592 PASS Object.prototype.toString.call(result) is "[object Blob]"
593 PASS result.size is test_data.size
594 PASS result.type is test_data.type
595 PASS text is "This is a test. This is only a test."
598 test_content = fileInput.files[0]
599 transaction = db.transaction('storeName', 'readwrite')
600 store = transaction.objectStore('storeName')
601 store.put(value, 'key')
603 PASS file1 !== file2 is true
604 PASS Object.prototype.toString.call(file1) is "[object File]"
605 PASS Object.prototype.toString.call(file2) is "[object File]"
607 PASS file1.size is file2.size
608 file1.type: text/html
609 PASS file1.type is file2.type
610 file1.name: test-data.html
611 PASS file1.name is file2.name
612 PASS String(file1.lastModifiedDate) is String(file2.lastModifiedDate)
613 PASS text2 is "<!DOCTYPE html>\n<title>This is some test data</title>\n<h1>Test data!</h1>\n<p>Get your test data here!\n"
616 test_content = fileInput.files
617 transaction = db.transaction('storeName', 'readwrite')
618 store = transaction.objectStore('storeName')
619 store.put(value, 'key')
621 PASS test_data !== result is true
622 PASS Object.prototype.toString.call(result) is "[object FileList]"
623 PASS result.length is test_data.length
625 PASS file1 !== file2 is true
626 PASS Object.prototype.toString.call(file1) is "[object File]"
627 PASS Object.prototype.toString.call(file2) is "[object File]"
629 PASS file1.size is file2.size
630 file1.type: text/html
631 PASS file1.type is file2.type
632 file1.name: test-data.html
633 PASS file1.name is file2.name
634 PASS String(file1.lastModifiedDate) is String(file2.lastModifiedDate)
635 PASS text2 is "<!DOCTYPE html>\n<title>This is some test data</title>\n<h1>Test data!</h1>\n<p>Get your test data here!\n"
637 PASS file1 !== file2 is true
638 PASS Object.prototype.toString.call(file1) is "[object File]"
639 PASS Object.prototype.toString.call(file2) is "[object File]"
641 PASS file1.size is file2.size
642 file1.type: text/plain
643 PASS file1.type is file2.type
644 file1.name: test-data.txt
645 PASS file1.name is file2.name
646 PASS String(file1.lastModifiedDate) is String(file2.lastModifiedDate)
647 PASS text2 is "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean laoreet dolor id urna eleifend aliquet. Nulla vel dolor ipsum. Aliquam ut turpis nisl, in vulputate sapien. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed congue magna vitae dolor feugiat vehicula. Sed volutpat, tellus vel varius vestibulum, purus quam mollis sapien, in condimentum leo neque sed nulla. Nunc quis porta elit. Pellentesque erat lectus, ultricies a lobortis id, faucibus id quam.\n"
654 test_data[11] = false
658 transaction = db.transaction('storeName', 'readwrite')
659 store = transaction.objectStore('storeName')
660 store.put(value, 'key')
662 PASS test_data !== result is true
663 PASS test_data.length === result.length is true
664 PASS test_data[0] is result[0]
665 PASS test_data[1] is result[1]
666 PASS test_data[10] is result[10]
667 PASS test_data[11] is result[11]
668 PASS test_data[20] is result[20]
669 PASS test_data[21] is result[21]
670 PASS test_data[30] is result[30]
676 test_data['a'] = true
677 test_data['b'] = false
678 test_data['foo'] = 123
679 test_data['bar'] = 456
681 transaction = db.transaction('storeName', 'readwrite')
682 store = transaction.objectStore('storeName')
683 store.put(value, 'key')
685 PASS test_data !== result is true
686 PASS arrayCompare(Object.keys(result).sort(), Object.keys(test_data).sort()) is true
687 PASS test_data["0"] is result["0"]
688 PASS test_data["1"] is result["1"]
689 PASS test_data["a"] is result["a"]
690 PASS test_data["b"] is result["b"]
691 PASS test_data["foo"] is result["foo"]
692 PASS test_data["bar"] is result["bar"]
693 PASS test_data[""] is result[""]
696 value = new Uint8Array([])
697 transaction = db.transaction('storeName', 'readwrite')
698 store = transaction.objectStore('storeName')
699 store.put(value, 'key')
701 PASS test_data !== result is true
702 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
703 PASS test_data.length === result.length is true
705 value = new Uint8Array([0, 1, 254, 255])
706 transaction = db.transaction('storeName', 'readwrite')
707 store = transaction.objectStore('storeName')
708 store.put(value, 'key')
710 PASS test_data !== result is true
711 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
712 PASS test_data.length === result.length is true
713 PASS is(test_data[0], result[0]) is true
714 PASS is(test_data[1], result[1]) is true
715 PASS is(test_data[2], result[2]) is true
716 PASS is(test_data[3], result[3]) is true
718 value = new Uint16Array([0x0000, 0x0001, 0xFFFE, 0xFFFF])
719 transaction = db.transaction('storeName', 'readwrite')
720 store = transaction.objectStore('storeName')
721 store.put(value, 'key')
723 PASS test_data !== result is true
724 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
725 PASS test_data.length === result.length is true
726 PASS is(test_data[0], result[0]) is true
727 PASS is(test_data[1], result[1]) is true
728 PASS is(test_data[2], result[2]) is true
729 PASS is(test_data[3], result[3]) is true
731 value = new Uint32Array([0x00000000, 0x00000001, 0xFFFFFFFE, 0xFFFFFFFF])
732 transaction = db.transaction('storeName', 'readwrite')
733 store = transaction.objectStore('storeName')
734 store.put(value, 'key')
736 PASS test_data !== result is true
737 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
738 PASS test_data.length === result.length is true
739 PASS is(test_data[0], result[0]) is true
740 PASS is(test_data[1], result[1]) is true
741 PASS is(test_data[2], result[2]) is true
742 PASS is(test_data[3], result[3]) is true
744 value = new Int8Array([0, 1, 254, 255])
745 transaction = db.transaction('storeName', 'readwrite')
746 store = transaction.objectStore('storeName')
747 store.put(value, 'key')
749 PASS test_data !== result is true
750 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
751 PASS test_data.length === result.length is true
752 PASS is(test_data[0], result[0]) is true
753 PASS is(test_data[1], result[1]) is true
754 PASS is(test_data[2], result[2]) is true
755 PASS is(test_data[3], result[3]) is true
757 value = new Int16Array([0x0000, 0x0001, 0xFFFE, 0xFFFF])
758 transaction = db.transaction('storeName', 'readwrite')
759 store = transaction.objectStore('storeName')
760 store.put(value, 'key')
762 PASS test_data !== result is true
763 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
764 PASS test_data.length === result.length is true
765 PASS is(test_data[0], result[0]) is true
766 PASS is(test_data[1], result[1]) is true
767 PASS is(test_data[2], result[2]) is true
768 PASS is(test_data[3], result[3]) is true
770 value = new Int32Array([0x00000000, 0x00000001, 0xFFFFFFFE, 0xFFFFFFFF])
771 transaction = db.transaction('storeName', 'readwrite')
772 store = transaction.objectStore('storeName')
773 store.put(value, 'key')
775 PASS test_data !== result is true
776 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
777 PASS test_data.length === result.length is true
778 PASS is(test_data[0], result[0]) is true
779 PASS is(test_data[1], result[1]) is true
780 PASS is(test_data[2], result[2]) is true
781 PASS is(test_data[3], result[3]) is true
783 value = new Uint8ClampedArray([0, 1, 254, 255])
784 transaction = db.transaction('storeName', 'readwrite')
785 store = transaction.objectStore('storeName')
786 store.put(value, 'key')
788 PASS test_data !== result is true
789 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
790 PASS test_data.length === result.length is true
791 PASS is(test_data[0], result[0]) is true
792 PASS is(test_data[1], result[1]) is true
793 PASS is(test_data[2], result[2]) is true
794 PASS is(test_data[3], result[3]) is true
796 value = new Float32Array([-Infinity, -1.5, -1, -0.5, 0, 0.5, 1, 1.5, Infinity, NaN])
797 transaction = db.transaction('storeName', 'readwrite')
798 store = transaction.objectStore('storeName')
799 store.put(value, 'key')
801 PASS test_data !== result is true
802 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
803 PASS test_data.length === result.length is true
804 PASS is(test_data[0], result[0]) is true
805 PASS is(test_data[1], result[1]) is true
806 PASS is(test_data[2], result[2]) is true
807 PASS is(test_data[3], result[3]) is true
808 PASS is(test_data[4], result[4]) is true
809 PASS is(test_data[5], result[5]) is true
810 PASS is(test_data[6], result[6]) is true
811 PASS is(test_data[7], result[7]) is true
812 PASS is(test_data[8], result[8]) is true
813 PASS is(test_data[9], result[9]) is true
815 value = new Float64Array([-Infinity, -Number.MAX_VALUE, -Number.MIN_VALUE, 0, Number.MIN_VALUE, Number.MAX_VALUE, Infinity, NaN])
816 transaction = db.transaction('storeName', 'readwrite')
817 store = transaction.objectStore('storeName')
818 store.put(value, 'key')
820 PASS test_data !== result is true
821 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
822 PASS test_data.length === result.length is true
823 PASS is(test_data[0], result[0]) is true
824 PASS is(test_data[1], result[1]) is true
825 PASS is(test_data[2], result[2]) is true
826 PASS is(test_data[3], result[3]) is true
827 PASS is(test_data[4], result[4]) is true
828 PASS is(test_data[5], result[5]) is true
829 PASS is(test_data[6], result[6]) is true
830 PASS is(test_data[7], result[7]) is true
834 Test types that can't be cloned:
836 transaction = db.transaction('storeName', 'readwrite')
837 store = transaction.objectStore('storeName')
839 Other JavaScript object types:
840 Expecting exception from store.put(new Error, 'key')
841 PASS Exception was thrown.
842 PASS code is DOMException.DATA_CLONE_ERR
843 Exception message: Failed to execute 'put' on 'IDBObjectStore': An object could not be cloned.
844 Expecting exception from store.put(new Function, 'key')
845 PASS Exception was thrown.
846 PASS code is DOMException.DATA_CLONE_ERR
847 Exception message: Failed to execute 'put' on 'IDBObjectStore': An object could not be cloned.
849 Other host object types:
850 Expecting exception from store.put(self, 'key')
851 PASS Exception was thrown.
852 PASS code is DOMException.DATA_CLONE_ERR
853 Exception message: Failed to execute 'put' on 'IDBObjectStore': An object could not be cloned.
854 Expecting exception from store.put(document, 'key')
855 PASS Exception was thrown.
856 PASS code is DOMException.DATA_CLONE_ERR
857 Exception message: Failed to execute 'put' on 'IDBObjectStore': An object could not be cloned.
858 Expecting exception from store.put(document.body, 'key')
859 PASS Exception was thrown.
860 PASS code is DOMException.DATA_CLONE_ERR
861 Exception message: Failed to execute 'put' on 'IDBObjectStore': An object could not be cloned.
862 PASS successfullyParsed is true