blob: 2dbdd5312c329587a2a62afcbe9c722b0b6d7457 [file] [log] [blame]
Test structured clone permutations in IndexedDB. File/FileList tests require DumpRenderTree.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
dbname = "structured-clone.html"
indexedDB.deleteDatabase(dbname)
indexedDB.open(dbname)
store = db.createObjectStore('storeName')
This index is not used, but evaluating key path on each put() call will exercise (de)serialization:
store.createIndex('indexName', 'dummyKeyPath')
Running tests...
Testing: undefined
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS is(test_data, result) is true
Testing: null
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS is(test_data, result) is true
Testing boolean primitives
Testing: true
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS is(test_data, result) is true
Testing: false
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS is(test_data, result) is true
Testing number primitives
Testing: NaN
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS is(test_data, result) is true
Testing: -Infinity
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS is(test_data, result) is true
Testing: -Number.MAX_VALUE
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS is(test_data, result) is true
Testing: -0xffffffff
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS is(test_data, result) is true
Testing: -0x80000000
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS is(test_data, result) is true
Testing: -0x7fffffff
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS is(test_data, result) is true
Testing: -1
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS is(test_data, result) is true
Testing: -Number.MIN_VALUE
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS is(test_data, result) is true
Testing: -0
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS is(test_data, result) is true
Testing: 0
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS is(test_data, result) is true
Testing: 1
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS is(test_data, result) is true
Testing: Number.MIN_VALUE
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS is(test_data, result) is true
Testing: 0x7fffffff
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS is(test_data, result) is true
Testing: 0x80000000
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS is(test_data, result) is true
Testing: 0xffffffff
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS is(test_data, result) is true
Testing: Number.MAX_VALUE
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS is(test_data, result) is true
Testing: Infinity
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS is(test_data, result) is true
Testing string primitives
Testing: ''
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS is(test_data, result) is true
Testing: 'this is a sample string'
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS is(test_data, result) is true
Testing: 'null(\0)'
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS is(test_data, result) is true
Testing Boolean objects
Testing: new Boolean(true)
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS typeof result is "object"
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data !== result is true
PASS result.toString() is test_data.toString()
PASS is(test_data.valueOf(), result.valueOf()) is true
Testing: new Boolean(false)
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS typeof result is "object"
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data !== result is true
PASS result.toString() is test_data.toString()
PASS is(test_data.valueOf(), result.valueOf()) is true
Testing Number objects
Testing: new Number(NaN)
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS typeof result is "object"
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data !== result is true
PASS result.toString() is test_data.toString()
PASS is(test_data.valueOf(), result.valueOf()) is true
Testing: new Number(-Infinity)
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS typeof result is "object"
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data !== result is true
PASS result.toString() is test_data.toString()
PASS is(test_data.valueOf(), result.valueOf()) is true
Testing: new Number(-Number.MAX_VALUE)
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS typeof result is "object"
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data !== result is true
PASS result.toString() is test_data.toString()
PASS is(test_data.valueOf(), result.valueOf()) is true
Testing: new Number(-Number.MIN_VALUE)
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS typeof result is "object"
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data !== result is true
PASS result.toString() is test_data.toString()
PASS is(test_data.valueOf(), result.valueOf()) is true
Testing: new Number(-0)
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS typeof result is "object"
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data !== result is true
PASS result.toString() is test_data.toString()
PASS is(test_data.valueOf(), result.valueOf()) is true
Testing: new Number(0)
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS typeof result is "object"
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data !== result is true
PASS result.toString() is test_data.toString()
PASS is(test_data.valueOf(), result.valueOf()) is true
Testing: new Number(Number.MIN_VALUE)
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS typeof result is "object"
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data !== result is true
PASS result.toString() is test_data.toString()
PASS is(test_data.valueOf(), result.valueOf()) is true
Testing: new Number(Number.MAX_VALUE)
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS typeof result is "object"
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data !== result is true
PASS result.toString() is test_data.toString()
PASS is(test_data.valueOf(), result.valueOf()) is true
Testing: new Number(Infinity)
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS typeof result is "object"
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data !== result is true
PASS result.toString() is test_data.toString()
PASS is(test_data.valueOf(), result.valueOf()) is true
Testing String objects
Testing: new String()
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS typeof result is "object"
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data !== result is true
PASS result.toString() is test_data.toString()
PASS is(test_data.valueOf(), result.valueOf()) is true
Testing: new String('this is a sample string')
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS typeof result is "object"
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data !== result is true
PASS result.toString() is test_data.toString()
PASS is(test_data.valueOf(), result.valueOf()) is true
Testing: new String('null(\0)')
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS typeof result is "object"
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data !== result is true
PASS result.toString() is test_data.toString()
PASS is(test_data.valueOf(), result.valueOf()) is true
Testing Date objects
Testing: new Date(-1e13)
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS typeof result is "object"
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data !== result is true
PASS result.toString() is test_data.toString()
PASS is(test_data.valueOf(), result.valueOf()) is true
Testing: new Date(-1e12)
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS typeof result is "object"
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data !== result is true
PASS result.toString() is test_data.toString()
PASS is(test_data.valueOf(), result.valueOf()) is true
Testing: new Date(-1e9)
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS typeof result is "object"
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data !== result is true
PASS result.toString() is test_data.toString()
PASS is(test_data.valueOf(), result.valueOf()) is true
Testing: new Date(-1e6)
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS typeof result is "object"
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data !== result is true
PASS result.toString() is test_data.toString()
PASS is(test_data.valueOf(), result.valueOf()) is true
Testing: new Date(-1e3)
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS typeof result is "object"
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data !== result is true
PASS result.toString() is test_data.toString()
PASS is(test_data.valueOf(), result.valueOf()) is true
Testing: new Date(0)
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS typeof result is "object"
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data !== result is true
PASS result.toString() is test_data.toString()
PASS is(test_data.valueOf(), result.valueOf()) is true
Testing: new Date(1e3)
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS typeof result is "object"
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data !== result is true
PASS result.toString() is test_data.toString()
PASS is(test_data.valueOf(), result.valueOf()) is true
Testing: new Date(1e6)
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS typeof result is "object"
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data !== result is true
PASS result.toString() is test_data.toString()
PASS is(test_data.valueOf(), result.valueOf()) is true
Testing: new Date(1e9)
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS typeof result is "object"
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data !== result is true
PASS result.toString() is test_data.toString()
PASS is(test_data.valueOf(), result.valueOf()) is true
Testing: new Date(1e12)
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS typeof result is "object"
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data !== result is true
PASS result.toString() is test_data.toString()
PASS is(test_data.valueOf(), result.valueOf()) is true
Testing: new Date(1e13)
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS typeof result is "object"
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data !== result is true
PASS result.toString() is test_data.toString()
PASS is(test_data.valueOf(), result.valueOf()) is true
Testing RegExp objects
Testing RegExp: new RegExp()
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS test_data !== result is true
PASS Object.prototype.toString.call(result) is "[object RegExp]"
PASS result.toString() is test_data.toString()
Testing RegExp: /abc/
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS test_data !== result is true
PASS Object.prototype.toString.call(result) is "[object RegExp]"
PASS result.toString() is test_data.toString()
Testing RegExp: /abc/g
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS test_data !== result is true
PASS Object.prototype.toString.call(result) is "[object RegExp]"
PASS result.toString() is test_data.toString()
Testing RegExp: /abc/i
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS test_data !== result is true
PASS Object.prototype.toString.call(result) is "[object RegExp]"
PASS result.toString() is test_data.toString()
Testing RegExp: /abc/gi
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS test_data !== result is true
PASS Object.prototype.toString.call(result) is "[object RegExp]"
PASS result.toString() is test_data.toString()
Testing RegExp: /abc/m
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS test_data !== result is true
PASS Object.prototype.toString.call(result) is "[object RegExp]"
PASS result.toString() is test_data.toString()
Testing RegExp: /abc/mg
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS test_data !== result is true
PASS Object.prototype.toString.call(result) is "[object RegExp]"
PASS result.toString() is test_data.toString()
Testing RegExp: /abc/mi
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS test_data !== result is true
PASS Object.prototype.toString.call(result) is "[object RegExp]"
PASS result.toString() is test_data.toString()
Testing RegExp: /abc/mgi
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS test_data !== result is true
PASS Object.prototype.toString.call(result) is "[object RegExp]"
PASS result.toString() is test_data.toString()
Testing ImageData
canvas = document.createElement('canvas')
canvas.width = 8
canvas.height = 8
test_data = canvas.getContext('2d').getImageData(0, 0, 8, 8)
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS test_data !== result is true
PASS Object.prototype.toString.call(result) is "[object ImageData]"
PASS result.width is test_data.width
PASS result.height is test_data.height
PASS result.data.length is test_data.data.length
PASS result data matches
Testing Blob
PASS FileReader != null is true
test_content = 'This is a test. This is only a test.'
test_data = new Blob([test_content])
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS test_data !== result is true
PASS Object.prototype.toString.call(result) is "[object Blob]"
PASS result.size is test_data.size
PASS result.type is test_data.type
PASS text is "This is a test. This is only a test."
Testing File
test_content = fileInput.files[0]
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS file1 !== file2 is true
PASS Object.prototype.toString.call(file1) is "[object File]"
PASS Object.prototype.toString.call(file2) is "[object File]"
file1.size: 102
PASS file1.size is file2.size
file1.type: text/html
PASS file1.type is file2.type
file1.name: test-data.html
PASS file1.name is file2.name
PASS String(file1.lastModifiedDate) is String(file2.lastModifiedDate)
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"
Testing FileList
test_content = fileInput.files
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS test_data !== result is true
PASS Object.prototype.toString.call(result) is "[object FileList]"
PASS result.length is test_data.length
comparing file[0]
PASS file1 !== file2 is true
PASS Object.prototype.toString.call(file1) is "[object File]"
PASS Object.prototype.toString.call(file2) is "[object File]"
file1.size: 102
PASS file1.size is file2.size
file1.type: text/html
PASS file1.type is file2.type
file1.name: test-data.html
PASS file1.name is file2.name
PASS String(file1.lastModifiedDate) is String(file2.lastModifiedDate)
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"
comparing file[1]
PASS file1 !== file2 is true
PASS Object.prototype.toString.call(file1) is "[object File]"
PASS Object.prototype.toString.call(file2) is "[object File]"
file1.size: 502
PASS file1.size is file2.size
file1.type: text/plain
PASS file1.type is file2.type
file1.name: test-data.txt
PASS file1.name is file2.name
PASS String(file1.lastModifiedDate) is String(file2.lastModifiedDate)
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"
Testing Array
test_data = []
test_data[0] = 'foo'
test_data[1] = 'bar'
test_data[10] = true
test_data[11] = false
test_data[20] = 123
test_data[21] = 456
test_data[30] = null
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS test_data !== result is true
PASS test_data.length === result.length is true
PASS test_data[0] is result[0]
PASS test_data[1] is result[1]
PASS test_data[10] is result[10]
PASS test_data[11] is result[11]
PASS test_data[20] is result[20]
PASS test_data[21] is result[21]
PASS test_data[30] is result[30]
Testing Object
test_data = []
test_data[0] = 'foo'
test_data[1] = 'bar'
test_data['a'] = true
test_data['b'] = false
test_data['foo'] = 123
test_data['bar'] = 456
test_data[''] = null
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS test_data !== result is true
PASS arrayCompare(Object.keys(result).sort(), Object.keys(test_data).sort()) is true
PASS test_data["0"] is result["0"]
PASS test_data["1"] is result["1"]
PASS test_data["a"] is result["a"]
PASS test_data["b"] is result["b"]
PASS test_data["foo"] is result["foo"]
PASS test_data["bar"] is result["bar"]
PASS test_data[""] is result[""]
Testing TypedArray
value = new Uint8Array([])
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS test_data !== result is true
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data.length === result.length is true
value = new Uint8Array([0, 1, 254, 255])
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS test_data !== result is true
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data.length === result.length is true
PASS is(test_data[0], result[0]) is true
PASS is(test_data[1], result[1]) is true
PASS is(test_data[2], result[2]) is true
PASS is(test_data[3], result[3]) is true
value = new Uint16Array([0x0000, 0x0001, 0xFFFE, 0xFFFF])
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS test_data !== result is true
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data.length === result.length is true
PASS is(test_data[0], result[0]) is true
PASS is(test_data[1], result[1]) is true
PASS is(test_data[2], result[2]) is true
PASS is(test_data[3], result[3]) is true
value = new Uint32Array([0x00000000, 0x00000001, 0xFFFFFFFE, 0xFFFFFFFF])
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS test_data !== result is true
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data.length === result.length is true
PASS is(test_data[0], result[0]) is true
PASS is(test_data[1], result[1]) is true
PASS is(test_data[2], result[2]) is true
PASS is(test_data[3], result[3]) is true
value = new Int8Array([0, 1, 254, 255])
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS test_data !== result is true
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data.length === result.length is true
PASS is(test_data[0], result[0]) is true
PASS is(test_data[1], result[1]) is true
PASS is(test_data[2], result[2]) is true
PASS is(test_data[3], result[3]) is true
value = new Int16Array([0x0000, 0x0001, 0xFFFE, 0xFFFF])
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS test_data !== result is true
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data.length === result.length is true
PASS is(test_data[0], result[0]) is true
PASS is(test_data[1], result[1]) is true
PASS is(test_data[2], result[2]) is true
PASS is(test_data[3], result[3]) is true
value = new Int32Array([0x00000000, 0x00000001, 0xFFFFFFFE, 0xFFFFFFFF])
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS test_data !== result is true
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data.length === result.length is true
PASS is(test_data[0], result[0]) is true
PASS is(test_data[1], result[1]) is true
PASS is(test_data[2], result[2]) is true
PASS is(test_data[3], result[3]) is true
value = new Uint8ClampedArray([0, 1, 254, 255])
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS test_data !== result is true
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data.length === result.length is true
PASS is(test_data[0], result[0]) is true
PASS is(test_data[1], result[1]) is true
PASS is(test_data[2], result[2]) is true
PASS is(test_data[3], result[3]) is true
value = new Float32Array([-Infinity, -1.5, -1, -0.5, 0, 0.5, 1, 1.5, Infinity, NaN])
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS test_data !== result is true
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data.length === result.length is true
PASS is(test_data[0], result[0]) is true
PASS is(test_data[1], result[1]) is true
PASS is(test_data[2], result[2]) is true
PASS is(test_data[3], result[3]) is true
PASS is(test_data[4], result[4]) is true
PASS is(test_data[5], result[5]) is true
PASS is(test_data[6], result[6]) is true
PASS is(test_data[7], result[7]) is true
PASS is(test_data[8], result[8]) is true
PASS is(test_data[9], result[9]) is true
value = new Float64Array([-Infinity, -Number.MAX_VALUE, -Number.MIN_VALUE, 0, Number.MIN_VALUE, Number.MAX_VALUE, Infinity, NaN])
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
store.put(value, 'key')
store.get('key')
PASS test_data !== result is true
PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data)
PASS test_data.length === result.length is true
PASS is(test_data[0], result[0]) is true
PASS is(test_data[1], result[1]) is true
PASS is(test_data[2], result[2]) is true
PASS is(test_data[3], result[3]) is true
PASS is(test_data[4], result[4]) is true
PASS is(test_data[5], result[5]) is true
PASS is(test_data[6], result[6]) is true
PASS is(test_data[7], result[7]) is true
Test types that can't be cloned:
transaction = db.transaction('storeName', 'readwrite')
store = transaction.objectStore('storeName')
Other JavaScript object types:
Expecting exception from store.put(new Error, 'key')
PASS Exception was thrown.
PASS code is DOMException.DATA_CLONE_ERR
Exception message: Failed to execute 'put' on 'IDBObjectStore': Error could not be cloned.
Expecting exception from store.put(new Function, 'key')
PASS Exception was thrown.
PASS code is DOMException.DATA_CLONE_ERR
Exception message: Failed to execute 'put' on 'IDBObjectStore': function anonymous() {
} could not be cloned.
Other host object types:
Expecting exception from store.put(self, 'key')
PASS Exception was thrown.
PASS code is DOMException.DATA_CLONE_ERR
Exception message: Failed to execute 'put' on 'IDBObjectStore': #<Window> could not be cloned.
Expecting exception from store.put(document, 'key')
PASS Exception was thrown.
PASS code is DOMException.DATA_CLONE_ERR
Exception message: Failed to execute 'put' on 'IDBObjectStore': HTMLDocument object could not be cloned.
Expecting exception from store.put(document.body, 'key')
PASS Exception was thrown.
PASS code is DOMException.DATA_CLONE_ERR
Exception message: Failed to execute 'put' on 'IDBObjectStore': HTMLBodyElement object could not be cloned.
PASS successfullyParsed is true
TEST COMPLETE