<!DOCTYPE html>
<!--
  original test: http://mxr.mozilla.org/mozilla2.0/source/dom/indexedDB/test/test_readonly_transactions.html
  license of original test:
    " Any copyright is dedicated to the Public Domain.
      http://creativecommons.org/publicdomain/zero/1.0/ "
-->
<html>
<head>
<script src="../../../fast/js/resources/js-test-pre.js"></script>
<script src="../resources/shared.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>

description("Test IndexedDB's read/write transactions");
if (window.layoutTestController)
    layoutTestController.waitUntilDone();

function test()
{
    indexedDB = evalAndLog("indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB;");
    shouldBeFalse("indexedDB == null");
    IDBDatabaseException = evalAndLog("IDBDatabaseException = window.IDBDatabaseException || window.webkitIDBDatabaseException;");
    shouldBeFalse("IDBDatabaseException == null");
    IDBTransaction = evalAndLog("IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction;");
    shouldBeFalse("IDBTransaction == null");

    name = window.location.pathname;
    description = "My Test Database";
    request = evalAndLog("indexedDB.open(name, description)");
    request.onsuccess = openSuccess;
    request.onerror = unexpectedErrorCallback;
}

function openSuccess()
{
    db = evalAndLog("db = event.target.result");

    request = evalAndLog("request = db.setVersion('1')");
    request.onsuccess = cleanDatabase;
    request.onerror = unexpectedErrorCallback;
}

function cleanDatabase()
{
    deleteAllObjectStores(db);

    osName = "test store";
    objectStore = evalAndLog("objectStore = db.createObjectStore(osName, { autoIncrement: true });");
    request = evalAndLog("request = db.transaction([osName], IDBTransaction.READ_WRITE).objectStore(osName).add({});");
    request.onsuccess = postAdd;
    request.onerror = unexpectedErrorCallback;
}

function postAdd()
{
    shouldBe("event.target.transaction.mode", "IDBTransaction.READ_WRITE");
    key1 = evalAndLog("key1 = event.target.result;");
    request = evalAndLog("request = db.transaction(osName, IDBTransaction.READ_WRITE).objectStore(osName).add({});");
    request.onsuccess = postAdd2;
    request.onerror = unexpectedErrorCallback;
}

function postAdd2()
{
    shouldBe("event.target.transaction.mode", "IDBTransaction.READ_WRITE");
    key2 = evalAndLog("key2 = event.target.result;");
    request = evalAndLog("request = db.transaction([osName], IDBTransaction.READ_WRITE).objectStore(osName).put({}, key1);");
    request.onsuccess = postPut;
    request.onerror = unexpectedErrorCallback;
}

function postPut()
{
    shouldBe("event.target.transaction.mode", "IDBTransaction.READ_WRITE");
    request = evalAndLog("request = db.transaction(osName, IDBTransaction.READ_WRITE).objectStore(osName).put({}, key2);");
    request.onsuccess = postPut2;
    request.onerror = unexpectedErrorCallback;
}

function postPut2()
{
    shouldBe("event.target.transaction.mode", "IDBTransaction.READ_WRITE");
    request = evalAndLog("request = db.transaction([osName], IDBTransaction.READ_WRITE).objectStore(osName).put({}, key1);");
    request.onsuccess = postPut3;
    request.onerror = unexpectedErrorCallback;
}

function postPut3()
{
    shouldBe("event.target.transaction.mode", "IDBTransaction.READ_WRITE");
    request = evalAndLog("request = db.transaction(osName, IDBTransaction.READ_WRITE).objectStore(osName).put({}, key1);");
    request.onsuccess = postPut4;
    request.onerror = unexpectedErrorCallback;
}

function postPut4()
{
    shouldBe("event.target.transaction.mode", "IDBTransaction.READ_WRITE");
    request = evalAndLog("request = db.transaction([osName], IDBTransaction.READ_WRITE).objectStore(osName).delete(key1);");
    request.onsuccess = postDelete;
    request.onerror = unexpectedErrorCallback;
}

function postDelete()
{
    shouldBe("event.target.transaction.mode", "IDBTransaction.READ_WRITE");
    request = evalAndLog("request = db.transaction(osName, IDBTransaction.READ_WRITE).objectStore(osName).delete(key2);");
    request.onsuccess = postDelete2;
    request.onerror = unexpectedErrorCallback;
}

function postDelete2()
{
    shouldBe("event.target.transaction.mode", "IDBTransaction.READ_WRITE");
    done();
}


test();

</script>
</body>
</html>

