chromium/third_party/blink/web_tests/storage/indexeddb/mozilla/clear-expected.txt

Test IndexedDB's clearing an object store

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".

dbname = "clear.html"
indexedDB.deleteDatabase(dbname)
indexedDB.open(dbname)
objectStore = db.createObjectStore('foo', { autoIncrement: true });
request = objectStore.add({});
Expecting exception from db.transaction('foo', 'readonly', {durability: 'relaxed'}).objectStore('foo').clear();
PASS Exception was thrown.
PASS code is 0
PASS ename is 'ReadOnlyError'
Exception message: Failed to execute 'clear' on 'IDBObjectStore': The transaction is read-only.
db.transaction('foo', 'readwrite', {durability: 'relaxed'})
transaction.objectStore('foo').clear();
request = db.transaction('foo', 'readonly', {durability: 'relaxed'}).objectStore('foo').openCursor();
cursor = request.result;
PASS cursor is null
PASS successfullyParsed is true

TEST COMPLETE