blob: bdabda722200fa45cf35a1291bc8baf3cfa25868 [file] [log] [blame]
Test IndexedDB's readonly transactions
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB;
PASS indexedDB == null is false
IDBDatabaseException = window.IDBDatabaseException || window.webkitIDBDatabaseException;
PASS IDBDatabaseException == null is false
indexedDB.open(name, description)
db = event.target.result
request = db.setVersion('1')
Deleted all object stores.
objectStore = db.createObjectStore(osName, { autoIncrement: true });
Expecting exception from db.transaction([osName]).objectStore(osName).add({});
PASS Exception was thrown.
PASS code is IDBDatabaseException.READ_ONLY_ERR
Expecting exception from db.transaction(osName).objectStore(osName).add({});
PASS Exception was thrown.
PASS code is IDBDatabaseException.READ_ONLY_ERR
key1 = 1;
key2 = 2;
Expecting exception from db.transaction([osName]).objectStore(osName).put({}, key1);
PASS Exception was thrown.
PASS code is IDBDatabaseException.READ_ONLY_ERR
Expecting exception from db.transaction(osName).objectStore(osName).put({}, key2);
PASS Exception was thrown.
PASS code is IDBDatabaseException.READ_ONLY_ERR
Expecting exception from db.transaction([osName]).objectStore(osName).put({}, key1);
PASS Exception was thrown.
PASS code is IDBDatabaseException.READ_ONLY_ERR
Expecting exception from db.transaction(osName).objectStore(osName).put({}, key1);
PASS Exception was thrown.
PASS code is IDBDatabaseException.READ_ONLY_ERR
Expecting exception from db.transaction([osName]).objectStore(osName).delete(key1);
PASS Exception was thrown.
PASS code is IDBDatabaseException.READ_ONLY_ERR
Expecting exception from db.transaction(osName).objectStore(osName).delete(key2);
PASS Exception was thrown.
PASS code is IDBDatabaseException.READ_ONLY_ERR
PASS successfullyParsed is true
TEST COMPLETE