1 if (this.importScripts) {
2 importScripts('../../../resources/js-test.js');
3 importScripts('shared.js');
6 description("readonly transaction should see the result of a previous readwrite transaction");
8 indexedDBTest(prepareDatabase, runTransactions);
10 function prepareDatabase(evt)
13 evalAndLog("db = event.target.result");
14 evalAndLog("store = db.createObjectStore('store')");
15 evalAndLog("store.put('original value', 'key')");
18 function runTransactions(evt)
21 evalAndLog("db = event.target.result");
22 evalAndLog("transaction1 = db.transaction('store', 'readwrite')");
23 transaction1.onabort = unexpectedAbortCallback;
24 evalAndLog("transaction2 = db.transaction('store', 'readonly')");
25 transaction2.onabort = unexpectedAbortCallback;
27 evalAndLog("request = transaction1.objectStore('store').put('new value', 'key')");
28 request.onerror = unexpectedErrorCallback;
30 evalAndLog("request2 = transaction2.objectStore('store').get('key')");
31 request2.onerror = unexpectedErrorCallback;
32 request2.onsuccess = function checkResult(evt) {
34 shouldBeEqualToString('request2.result', 'new value');