summaryrefslogtreecommitdiffstats
path: root/LayoutTests/storage/indexeddb/transaction-event-propagation.html
diff options
context:
space:
mode:
Diffstat (limited to 'LayoutTests/storage/indexeddb/transaction-event-propagation.html')
-rw-r--r--LayoutTests/storage/indexeddb/transaction-event-propagation.html37
1 files changed, 21 insertions, 16 deletions
diff --git a/LayoutTests/storage/indexeddb/transaction-event-propagation.html b/LayoutTests/storage/indexeddb/transaction-event-propagation.html
index c31646a..15c275c 100644
--- a/LayoutTests/storage/indexeddb/transaction-event-propagation.html
+++ b/LayoutTests/storage/indexeddb/transaction-event-propagation.html
@@ -16,37 +16,32 @@ if (window.layoutTestController)
function test()
{
- result = evalAndLog("webkitIndexedDB.open('name')");
- verifyResult(result);
- result.onsuccess = setVersion;
- result.onerror = unexpectedErrorCallback;
+ request = evalAndLog("webkitIndexedDB.open('transaction-event-propagation')");
+ request.onsuccess = setVersion;
+ request.onerror = unexpectedErrorCallback;
}
function setVersion()
{
- db = evalAndLog("db = event.result");
+ db = evalAndLog("db = event.target.result");
- result = evalAndLog("db.setVersion('new version')");
- verifyResult(result);
- result.onsuccess = deleteExisting;
- result.onerror = unexpectedErrorCallback;
+ request = evalAndLog("db.setVersion('new version')");
+ request.onsuccess = deleteExisting;
+ request.onerror = unexpectedErrorCallback;
}
function deleteExisting()
{
- window.trans = evalAndLog("trans = event.result");
+ window.trans = evalAndLog("trans = event.target.result");
shouldBeTrue("trans !== null");
trans.onabort = unexpectedAbortCallback;
evalAndLog("trans.oncomplete = startTest");
- deleteAllObjectStores(db, createObjectStore);
-}
+ deleteAllObjectStores(db);
-function createObjectStore()
-{
store = evalAndLog("store = db.createObjectStore('storeName', null)");
- result = evalAndLog("store.add({x: 'value', y: 'zzz'}, 'key')");
- result.onerror = unexpectedErrorCallback;
+ request = evalAndLog("store.add({x: 'value', y: 'zzz'}, 'key')");
+ request.onerror = unexpectedErrorCallback;
}
function startTest()
@@ -73,6 +68,8 @@ function dbAbortCaptureCallback()
shouldBeFalse("dbCaptureFired");
shouldBeFalse("abortFired");
shouldBeFalse("dbBubbleFired1");
+ shouldBe("event.target", "trans");
+ shouldBe("event.currentTarget", "db");
dbCaptureFired = true;
}
@@ -83,6 +80,8 @@ function abortFiredCallback()
shouldBeTrue("dbCaptureFired");
shouldBeFalse("abortFired");
shouldBeFalse("dbBubbleFired1");
+ shouldBe("event.target", "trans");
+ shouldBe("event.currentTarget", "trans");
abortFired = true;
}
@@ -93,6 +92,8 @@ function dbAbortBubbleCallback()
shouldBeTrue("dbCaptureFired");
shouldBeTrue("abortFired");
shouldBeFalse("dbBubbleFired1");
+ shouldBe("event.target", "trans");
+ shouldBe("event.currentTarget", "db");
dbBubbleFired1 = true;
debug("");
debug("Verifing success.");
@@ -121,6 +122,8 @@ function dbCompleteCaptureCallback()
shouldBeFalse("dbCaptureFired");
shouldBeFalse("completeFired");
shouldBeFalse("dbBubbleFired2");
+ shouldBe("event.target", "trans");
+ shouldBe("event.currentTarget", "db");
dbCaptureFired = true;
}
@@ -131,6 +134,8 @@ function completeFiredCallback()
shouldBeTrue("dbCaptureFired");
shouldBeFalse("completeFired");
shouldBeFalse("dbBubbleFired2");
+ shouldBe("event.target", "trans");
+ shouldBe("event.currentTarget", "trans");
completeFired = true;
debug("");
done();