82 lines
2.8 KiB
Plaintext
82 lines
2.8 KiB
Plaintext
Test IndexedDB readonly properties
|
|
|
|
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
|
|
|
|
|
|
indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
|
|
|
|
indexedDB.deleteDatabase(dbname)
|
|
indexedDB.open(dbname)
|
|
transaction = event.target.transaction;
|
|
trying to set readonly property transaction.mode
|
|
transaction.mode = 666
|
|
PASS transaction.mode is still versionchange
|
|
trying to set readonly property transaction.db
|
|
transaction.db = this
|
|
PASS transaction.db is still [object IDBDatabase]
|
|
Deleted all object stores.
|
|
objectStore = db.createObjectStore('foo');
|
|
trying to set readonly property objectStore.keyPath
|
|
objectStore.keyPath = 'bar'
|
|
PASS objectStore.keyPath is still null
|
|
result = objectStore.add({}, 'first');
|
|
result = objectStore.openCursor();
|
|
cursor = event.target.result;
|
|
trying to set readonly property cursor.source
|
|
cursor.source = this
|
|
PASS cursor.source is still [object IDBObjectStore]
|
|
trying to set readonly property cursor.direction
|
|
cursor.direction = 666
|
|
PASS cursor.direction is still next
|
|
trying to set readonly property cursor.key
|
|
cursor.key = Infinity
|
|
PASS cursor.key is still first
|
|
trying to set readonly property cursor.primaryKey
|
|
cursor.primaryKey = Infinity
|
|
PASS cursor.primaryKey is still first
|
|
index = objectStore.createIndex('first', 'first');
|
|
trying to set readonly property index.objectStore
|
|
index.objectStore = this
|
|
PASS index.objectStore is still [object IDBObjectStore]
|
|
trying to set readonly property index.keyPath
|
|
index.keyPath = 'bar'
|
|
PASS index.keyPath is still first
|
|
trying to set readonly property index.unique
|
|
index.unique = true
|
|
PASS index.unique is still false
|
|
trying to set readonly property keyRange.lower
|
|
keyRange.lower = Infinity
|
|
PASS keyRange.lower is still first
|
|
trying to set readonly property keyRange.upper
|
|
keyRange.upper = Infinity
|
|
PASS keyRange.upper is still first
|
|
trying to set readonly property keyRange.lowerOpen
|
|
keyRange.lowerOpen = true
|
|
PASS keyRange.lowerOpen is still false
|
|
trying to set readonly property keyRange.upperOpen
|
|
keyRange.upperOpen = true
|
|
PASS keyRange.upperOpen is still false
|
|
trying to set readonly property request.result
|
|
request.result = Infinity
|
|
PASS request.result is still [object IDBDatabase]
|
|
trying to set readonly property request.error
|
|
request.error = {}
|
|
PASS request.error is still null
|
|
trying to set readonly property request.source
|
|
request.source = this
|
|
PASS request.source is still null
|
|
trying to set readonly property request.transaction
|
|
request.transaction = this
|
|
PASS request.transaction is still null
|
|
trying to set readonly property request.readyState
|
|
request.readyState = 666
|
|
PASS request.readyState is still done
|
|
db = event.target.result
|
|
trying to set readonly property db.name
|
|
db.name = 'bar'
|
|
PASS db.name is still readonly.html
|
|
PASS successfullyParsed is true
|
|
|
|
TEST COMPLETE
|
|
|