blob: 18ed386d3514f5b4aead5840a182bdbcead28c56 [file] [log] [blame]
Test IndexedDB's readonly transactions
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)
objectStore = db.createObjectStore(osName, { autoIncrement: true });
Expecting exception from db.transaction([osName]).objectStore(osName).add({});
PASS Exception was thrown.
PASS code is 0
PASS ename is 'ReadOnlyError'
Exception message: Failed to store record in an IDBObjectStore: The transaction is read-only.
Expecting exception from db.transaction(osName).objectStore(osName).add({});
PASS Exception was thrown.
PASS code is 0
PASS ename is 'ReadOnlyError'
Exception message: Failed to store record in an IDBObjectStore: The transaction is read-only.
key1 = 1;
key2 = 2;
Expecting exception from db.transaction([osName]).objectStore(osName).put({}, key1);
PASS Exception was thrown.
PASS code is 0
PASS ename is 'ReadOnlyError'
Exception message: Failed to store record in an IDBObjectStore: The transaction is read-only.
Expecting exception from db.transaction(osName).objectStore(osName).put({}, key2);
PASS Exception was thrown.
PASS code is 0
PASS ename is 'ReadOnlyError'
Exception message: Failed to store record in an IDBObjectStore: The transaction is read-only.
Expecting exception from db.transaction([osName]).objectStore(osName).put({}, key1);
PASS Exception was thrown.
PASS code is 0
PASS ename is 'ReadOnlyError'
Exception message: Failed to store record in an IDBObjectStore: The transaction is read-only.
Expecting exception from db.transaction(osName).objectStore(osName).put({}, key1);
PASS Exception was thrown.
PASS code is 0
PASS ename is 'ReadOnlyError'
Exception message: Failed to store record in an IDBObjectStore: The transaction is read-only.
Expecting exception from db.transaction([osName]).objectStore(osName).delete(key1);
PASS Exception was thrown.
PASS code is 0
PASS ename is 'ReadOnlyError'
Exception message: Failed to execute 'delete' on 'IDBObjectStore': The transaction is read-only.
Expecting exception from db.transaction(osName).objectStore(osName).delete(key2);
PASS Exception was thrown.
PASS code is 0
PASS ename is 'ReadOnlyError'
Exception message: Failed to execute 'delete' on 'IDBObjectStore': The transaction is read-only.
PASS successfullyParsed is true
TEST COMPLETE