Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / storage / indexeddb / structured-clone-expected.txt
1 Test structured clone permutations in IndexedDB. File/FileList tests require DumpRenderTree.
2
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6 indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
7
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')
14
15 Running tests...
16
17 Testing: undefined
18 transaction = db.transaction('storeName', 'readwrite')
19 store = transaction.objectStore('storeName')
20 store.put(value, 'key')
21 store.get('key')
22 PASS is(test_data, result) is true
23
24
25 Testing: null
26 transaction = db.transaction('storeName', 'readwrite')
27 store = transaction.objectStore('storeName')
28 store.put(value, 'key')
29 store.get('key')
30 PASS is(test_data, result) is true
31
32
33 Testing boolean primitives
34
35 Testing: true
36 transaction = db.transaction('storeName', 'readwrite')
37 store = transaction.objectStore('storeName')
38 store.put(value, 'key')
39 store.get('key')
40 PASS is(test_data, result) is true
41
42 Testing: false
43 transaction = db.transaction('storeName', 'readwrite')
44 store = transaction.objectStore('storeName')
45 store.put(value, 'key')
46 store.get('key')
47 PASS is(test_data, result) is true
48
49
50 Testing number primitives
51
52 Testing: NaN
53 transaction = db.transaction('storeName', 'readwrite')
54 store = transaction.objectStore('storeName')
55 store.put(value, 'key')
56 store.get('key')
57 PASS is(test_data, result) is true
58
59 Testing: -Infinity
60 transaction = db.transaction('storeName', 'readwrite')
61 store = transaction.objectStore('storeName')
62 store.put(value, 'key')
63 store.get('key')
64 PASS is(test_data, result) is true
65
66 Testing: -Number.MAX_VALUE
67 transaction = db.transaction('storeName', 'readwrite')
68 store = transaction.objectStore('storeName')
69 store.put(value, 'key')
70 store.get('key')
71 PASS is(test_data, result) is true
72
73 Testing: -0xffffffff
74 transaction = db.transaction('storeName', 'readwrite')
75 store = transaction.objectStore('storeName')
76 store.put(value, 'key')
77 store.get('key')
78 PASS is(test_data, result) is true
79
80 Testing: -0x80000000
81 transaction = db.transaction('storeName', 'readwrite')
82 store = transaction.objectStore('storeName')
83 store.put(value, 'key')
84 store.get('key')
85 PASS is(test_data, result) is true
86
87 Testing: -0x7fffffff
88 transaction = db.transaction('storeName', 'readwrite')
89 store = transaction.objectStore('storeName')
90 store.put(value, 'key')
91 store.get('key')
92 PASS is(test_data, result) is true
93
94 Testing: -1
95 transaction = db.transaction('storeName', 'readwrite')
96 store = transaction.objectStore('storeName')
97 store.put(value, 'key')
98 store.get('key')
99 PASS is(test_data, result) is true
100
101 Testing: -Number.MIN_VALUE
102 transaction = db.transaction('storeName', 'readwrite')
103 store = transaction.objectStore('storeName')
104 store.put(value, 'key')
105 store.get('key')
106 PASS is(test_data, result) is true
107
108 Testing: -0
109 transaction = db.transaction('storeName', 'readwrite')
110 store = transaction.objectStore('storeName')
111 store.put(value, 'key')
112 store.get('key')
113 PASS is(test_data, result) is true
114
115 Testing: 0
116 transaction = db.transaction('storeName', 'readwrite')
117 store = transaction.objectStore('storeName')
118 store.put(value, 'key')
119 store.get('key')
120 PASS is(test_data, result) is true
121
122 Testing: 1
123 transaction = db.transaction('storeName', 'readwrite')
124 store = transaction.objectStore('storeName')
125 store.put(value, 'key')
126 store.get('key')
127 PASS is(test_data, result) is true
128
129 Testing: Number.MIN_VALUE
130 transaction = db.transaction('storeName', 'readwrite')
131 store = transaction.objectStore('storeName')
132 store.put(value, 'key')
133 store.get('key')
134 PASS is(test_data, result) is true
135
136 Testing: 0x7fffffff
137 transaction = db.transaction('storeName', 'readwrite')
138 store = transaction.objectStore('storeName')
139 store.put(value, 'key')
140 store.get('key')
141 PASS is(test_data, result) is true
142
143 Testing: 0x80000000
144 transaction = db.transaction('storeName', 'readwrite')
145 store = transaction.objectStore('storeName')
146 store.put(value, 'key')
147 store.get('key')
148 PASS is(test_data, result) is true
149
150 Testing: 0xffffffff
151 transaction = db.transaction('storeName', 'readwrite')
152 store = transaction.objectStore('storeName')
153 store.put(value, 'key')
154 store.get('key')
155 PASS is(test_data, result) is true
156
157 Testing: Number.MAX_VALUE
158 transaction = db.transaction('storeName', 'readwrite')
159 store = transaction.objectStore('storeName')
160 store.put(value, 'key')
161 store.get('key')
162 PASS is(test_data, result) is true
163
164 Testing: Infinity
165 transaction = db.transaction('storeName', 'readwrite')
166 store = transaction.objectStore('storeName')
167 store.put(value, 'key')
168 store.get('key')
169 PASS is(test_data, result) is true
170
171
172 Testing string primitives
173
174 Testing: ''
175 transaction = db.transaction('storeName', 'readwrite')
176 store = transaction.objectStore('storeName')
177 store.put(value, 'key')
178 store.get('key')
179 PASS is(test_data, result) is true
180
181 Testing: 'this is a sample string'
182 transaction = db.transaction('storeName', 'readwrite')
183 store = transaction.objectStore('storeName')
184 store.put(value, 'key')
185 store.get('key')
186 PASS is(test_data, result) is true
187
188 Testing: 'null(\0)'
189 transaction = db.transaction('storeName', 'readwrite')
190 store = transaction.objectStore('storeName')
191 store.put(value, 'key')
192 store.get('key')
193 PASS is(test_data, result) is true
194
195
196 Testing Boolean objects
197
198 Testing: new Boolean(true)
199 transaction = db.transaction('storeName', 'readwrite')
200 store = transaction.objectStore('storeName')
201 store.put(value, 'key')
202 store.get('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
208
209 Testing: new Boolean(false)
210 transaction = db.transaction('storeName', 'readwrite')
211 store = transaction.objectStore('storeName')
212 store.put(value, 'key')
213 store.get('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
219
220
221 Testing Number objects
222
223 Testing: new Number(NaN)
224 transaction = db.transaction('storeName', 'readwrite')
225 store = transaction.objectStore('storeName')
226 store.put(value, 'key')
227 store.get('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
233
234 Testing: new Number(-Infinity)
235 transaction = db.transaction('storeName', 'readwrite')
236 store = transaction.objectStore('storeName')
237 store.put(value, 'key')
238 store.get('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
244
245 Testing: new Number(-Number.MAX_VALUE)
246 transaction = db.transaction('storeName', 'readwrite')
247 store = transaction.objectStore('storeName')
248 store.put(value, 'key')
249 store.get('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
255
256 Testing: new Number(-Number.MIN_VALUE)
257 transaction = db.transaction('storeName', 'readwrite')
258 store = transaction.objectStore('storeName')
259 store.put(value, 'key')
260 store.get('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
266
267 Testing: new Number(-0)
268 transaction = db.transaction('storeName', 'readwrite')
269 store = transaction.objectStore('storeName')
270 store.put(value, 'key')
271 store.get('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
277
278 Testing: new Number(0)
279 transaction = db.transaction('storeName', 'readwrite')
280 store = transaction.objectStore('storeName')
281 store.put(value, 'key')
282 store.get('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
288
289 Testing: new Number(Number.MIN_VALUE)
290 transaction = db.transaction('storeName', 'readwrite')
291 store = transaction.objectStore('storeName')
292 store.put(value, 'key')
293 store.get('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
299
300 Testing: new Number(Number.MAX_VALUE)
301 transaction = db.transaction('storeName', 'readwrite')
302 store = transaction.objectStore('storeName')
303 store.put(value, 'key')
304 store.get('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
310
311 Testing: new Number(Infinity)
312 transaction = db.transaction('storeName', 'readwrite')
313 store = transaction.objectStore('storeName')
314 store.put(value, 'key')
315 store.get('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
321
322
323 Testing String objects
324
325 Testing: new String()
326 transaction = db.transaction('storeName', 'readwrite')
327 store = transaction.objectStore('storeName')
328 store.put(value, 'key')
329 store.get('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
335
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')
340 store.get('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
346
347 Testing: new String('null(\0)')
348 transaction = db.transaction('storeName', 'readwrite')
349 store = transaction.objectStore('storeName')
350 store.put(value, 'key')
351 store.get('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
357
358
359 Testing Date objects
360
361 Testing: new Date(-1e13)
362 transaction = db.transaction('storeName', 'readwrite')
363 store = transaction.objectStore('storeName')
364 store.put(value, 'key')
365 store.get('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
371
372 Testing: new Date(-1e12)
373 transaction = db.transaction('storeName', 'readwrite')
374 store = transaction.objectStore('storeName')
375 store.put(value, 'key')
376 store.get('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
382
383 Testing: new Date(-1e9)
384 transaction = db.transaction('storeName', 'readwrite')
385 store = transaction.objectStore('storeName')
386 store.put(value, 'key')
387 store.get('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
393
394 Testing: new Date(-1e6)
395 transaction = db.transaction('storeName', 'readwrite')
396 store = transaction.objectStore('storeName')
397 store.put(value, 'key')
398 store.get('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
404
405 Testing: new Date(-1e3)
406 transaction = db.transaction('storeName', 'readwrite')
407 store = transaction.objectStore('storeName')
408 store.put(value, 'key')
409 store.get('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
415
416 Testing: new Date(0)
417 transaction = db.transaction('storeName', 'readwrite')
418 store = transaction.objectStore('storeName')
419 store.put(value, 'key')
420 store.get('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
426
427 Testing: new Date(1e3)
428 transaction = db.transaction('storeName', 'readwrite')
429 store = transaction.objectStore('storeName')
430 store.put(value, 'key')
431 store.get('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
437
438 Testing: new Date(1e6)
439 transaction = db.transaction('storeName', 'readwrite')
440 store = transaction.objectStore('storeName')
441 store.put(value, 'key')
442 store.get('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
448
449 Testing: new Date(1e9)
450 transaction = db.transaction('storeName', 'readwrite')
451 store = transaction.objectStore('storeName')
452 store.put(value, 'key')
453 store.get('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
459
460 Testing: new Date(1e12)
461 transaction = db.transaction('storeName', 'readwrite')
462 store = transaction.objectStore('storeName')
463 store.put(value, 'key')
464 store.get('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
470
471 Testing: new Date(1e13)
472 transaction = db.transaction('storeName', 'readwrite')
473 store = transaction.objectStore('storeName')
474 store.put(value, 'key')
475 store.get('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
481
482
483 Testing RegExp objects
484
485 Testing RegExp: new RegExp()
486 transaction = db.transaction('storeName', 'readwrite')
487 store = transaction.objectStore('storeName')
488 store.put(value, 'key')
489 store.get('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()
493
494 Testing RegExp: /abc/
495 transaction = db.transaction('storeName', 'readwrite')
496 store = transaction.objectStore('storeName')
497 store.put(value, 'key')
498 store.get('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()
502
503 Testing RegExp: /abc/g
504 transaction = db.transaction('storeName', 'readwrite')
505 store = transaction.objectStore('storeName')
506 store.put(value, 'key')
507 store.get('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()
511
512 Testing RegExp: /abc/i
513 transaction = db.transaction('storeName', 'readwrite')
514 store = transaction.objectStore('storeName')
515 store.put(value, 'key')
516 store.get('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()
520
521 Testing RegExp: /abc/gi
522 transaction = db.transaction('storeName', 'readwrite')
523 store = transaction.objectStore('storeName')
524 store.put(value, 'key')
525 store.get('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()
529
530 Testing RegExp: /abc/m
531 transaction = db.transaction('storeName', 'readwrite')
532 store = transaction.objectStore('storeName')
533 store.put(value, 'key')
534 store.get('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()
538
539 Testing RegExp: /abc/mg
540 transaction = db.transaction('storeName', 'readwrite')
541 store = transaction.objectStore('storeName')
542 store.put(value, 'key')
543 store.get('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()
547
548 Testing RegExp: /abc/mi
549 transaction = db.transaction('storeName', 'readwrite')
550 store = transaction.objectStore('storeName')
551 store.put(value, 'key')
552 store.get('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()
556
557 Testing RegExp: /abc/mgi
558 transaction = db.transaction('storeName', 'readwrite')
559 store = transaction.objectStore('storeName')
560 store.put(value, 'key')
561 store.get('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()
565
566
567 Testing ImageData
568 canvas = document.createElement('canvas')
569 canvas.width = 8
570 canvas.height = 8
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')
575 store.get('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
582
583 Testing Blob
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')
590 store.get('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."
596
597 Testing File
598 test_content = fileInput.files[0]
599 transaction = db.transaction('storeName', 'readwrite')
600 store = transaction.objectStore('storeName')
601 store.put(value, 'key')
602 store.get('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]"
606 file1.size: 102
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"
614
615 Testing FileList
616 test_content = fileInput.files
617 transaction = db.transaction('storeName', 'readwrite')
618 store = transaction.objectStore('storeName')
619 store.put(value, 'key')
620 store.get('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
624 comparing file[0]
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]"
628 file1.size: 102
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"
636 comparing file[1]
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]"
640 file1.size: 502
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"
648
649 Testing Array
650 test_data = []
651 test_data[0] = 'foo'
652 test_data[1] = 'bar'
653 test_data[10] = true
654 test_data[11] = false
655 test_data[20] = 123
656 test_data[21] = 456
657 test_data[30] = null
658 transaction = db.transaction('storeName', 'readwrite')
659 store = transaction.objectStore('storeName')
660 store.put(value, 'key')
661 store.get('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]
671
672 Testing Object
673 test_data = []
674 test_data[0] = 'foo'
675 test_data[1] = 'bar'
676 test_data['a'] = true
677 test_data['b'] = false
678 test_data['foo'] = 123
679 test_data['bar'] = 456
680 test_data[''] = null
681 transaction = db.transaction('storeName', 'readwrite')
682 store = transaction.objectStore('storeName')
683 store.put(value, 'key')
684 store.get('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[""]
694
695 Testing TypedArray
696 value = new Uint8Array([])
697 transaction = db.transaction('storeName', 'readwrite')
698 store = transaction.objectStore('storeName')
699 store.put(value, 'key')
700 store.get('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
704
705 value = new Uint8Array([0, 1, 254, 255])
706 transaction = db.transaction('storeName', 'readwrite')
707 store = transaction.objectStore('storeName')
708 store.put(value, 'key')
709 store.get('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
717
718 value = new Uint16Array([0x0000, 0x0001, 0xFFFE, 0xFFFF])
719 transaction = db.transaction('storeName', 'readwrite')
720 store = transaction.objectStore('storeName')
721 store.put(value, 'key')
722 store.get('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
730
731 value = new Uint32Array([0x00000000, 0x00000001, 0xFFFFFFFE, 0xFFFFFFFF])
732 transaction = db.transaction('storeName', 'readwrite')
733 store = transaction.objectStore('storeName')
734 store.put(value, 'key')
735 store.get('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
743
744 value = new Int8Array([0, 1, 254, 255])
745 transaction = db.transaction('storeName', 'readwrite')
746 store = transaction.objectStore('storeName')
747 store.put(value, 'key')
748 store.get('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
756
757 value = new Int16Array([0x0000, 0x0001, 0xFFFE, 0xFFFF])
758 transaction = db.transaction('storeName', 'readwrite')
759 store = transaction.objectStore('storeName')
760 store.put(value, 'key')
761 store.get('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
769
770 value = new Int32Array([0x00000000, 0x00000001, 0xFFFFFFFE, 0xFFFFFFFF])
771 transaction = db.transaction('storeName', 'readwrite')
772 store = transaction.objectStore('storeName')
773 store.put(value, 'key')
774 store.get('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
782
783 value = new Uint8ClampedArray([0, 1, 254, 255])
784 transaction = db.transaction('storeName', 'readwrite')
785 store = transaction.objectStore('storeName')
786 store.put(value, 'key')
787 store.get('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
795
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')
800 store.get('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
814
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')
819 store.get('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
831
832
833
834 Test types that can't be cloned:
835
836 transaction = db.transaction('storeName', 'readwrite')
837 store = transaction.objectStore('storeName')
838
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.
848
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
863
864 TEST COMPLETE
865