Modified: trunk/LayoutTests/ChangeLog (101459 => 101460)
--- trunk/LayoutTests/ChangeLog 2011-11-30 09:01:54 UTC (rev 101459)
+++ trunk/LayoutTests/ChangeLog 2011-11-30 09:07:29 UTC (rev 101460)
@@ -1,3 +1,21 @@
+2011-11-30 David Grogan <[email protected]>
+
+ IndexedDB: fix transaction-basics layout test
+ https://bugs.webkit.org/show_bug.cgi?id=73302
+
+ Reviewed by Tony Chang.
+
+ - removed commitAndContinue in favor of transaction complete event
+ handlers
+ - abort event handler no longer prints "complete event fired"
+ - addIDBObjectsAndCommit no longer overrides addIDBObjects
+ - removed starting a transaction from within a setversion transaction
+ - removed layoutTestController call and idb-specific done() in favor of
+ finishJSTest and js-test-post include
+
+ * storage/indexeddb/transaction-basics-expected.txt:
+ * storage/indexeddb/transaction-basics.html:
+
2011-11-30 Philippe Normand <[email protected]>
Unreviewed, skip tests on GTK presenting 1px differences since r101342.
Modified: trunk/LayoutTests/storage/indexeddb/transaction-basics-expected.txt (101459 => 101460)
--- trunk/LayoutTests/storage/indexeddb/transaction-basics-expected.txt 2011-11-30 09:01:54 UTC (rev 101459)
+++ trunk/LayoutTests/storage/indexeddb/transaction-basics-expected.txt 2011-11-30 09:07:29 UTC (rev 101460)
@@ -21,6 +21,8 @@
index = store.createIndex('indexFail', 'x', false)
db.deleteObjectStore('storeFail')
store.deleteIndex('indexFail')
+
+testSetVersionAbort2():
PASS window.db.objectStoreNames is []
PASS window.db.objectStoreNames.length is 0
PASS window.db.objectStoreNames.contains('storeFail') is false
@@ -34,16 +36,32 @@
store.deleteIndex('indexFail')
store = db.createObjectStore('storeFail', null)
index = store.createIndex('indexFail', 'x', false)
+
+testSetVersionAbort3():
PASS event.cancelable is false
PASS window.db.objectStoreNames is []
PASS window.db.objectStoreNames.length is 0
PASS window.db.objectStoreNames.contains('storeFail') is false
request = startSetVersion('version fail')
addIDBObjects():
+PASS event.cancelable is false
trans = event.target.result
PASS trans !== null is true
store = db.createObjectStore('storeFail', null)
index = store.createIndex('indexFail', 'x', false)
+
+testSetVersionAbort4():
+PASS window.db.objectStoreNames is []
+PASS window.db.objectStoreNames.length is 0
+PASS window.db.objectStoreNames.contains('storeFail') is false
+request = startSetVersion('version fail')
+addIDBObjectsAndCommit():
+trans = event.target.result
+PASS trans !== null is true
+store = db.createObjectStore('storeFail', null)
+index = store.createIndex('indexFail', 'x', false)
+
+testSetVersionAbort5():
PASS db.objectStoreNames is ['storeFail']
PASS db.objectStoreNames.length is 1
PASS db.objectStoreNames.contains('storeFail') is true
@@ -54,22 +72,24 @@
store = trans.objectStore('storeFail')
store.deleteIndex('indexFail')
db.deleteObjectStore('storeFail')
+
+testSetVersionAbort6():
PASS db.objectStoreNames is ['storeFail']
PASS db.objectStoreNames.length is 1
PASS db.objectStoreNames.contains('storeFail') is true
db.setVersion('new version')
+
setVersionSuccess():
trans = event.target.result
PASS trans !== null is true
Deleted all object stores.
db.createObjectStore('storeName', null)
+PASS event.cancelable is false
+PASS complete event fired
db.transaction(['storeName'])
store = transaction.objectStore('storeName')
PASS store.name is "storeName"
-PASS complete event fired
-PASS event.cancelable is false
-PASS complete event fired
-PASS oncomplete event had fired
+PASS abort event fired
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/LayoutTests/storage/indexeddb/transaction-basics.html (101459 => 101460)
--- trunk/LayoutTests/storage/indexeddb/transaction-basics.html 2011-11-30 09:01:54 UTC (rev 101459)
+++ trunk/LayoutTests/storage/indexeddb/transaction-basics.html 2011-11-30 09:07:29 UTC (rev 101460)
@@ -9,8 +9,6 @@
<script>
description("Test IndexedDB transaction basics.");
-if (window.layoutTestController)
- layoutTestController.waitUntilDone();
function test()
{
@@ -34,7 +32,7 @@
function cleanDatabase()
{
deleteAllObjectStores(db, checkMetadataEmpty);
- commitAndContinue(testSetVersionAbort1);
+ event.target.result._oncomplete_ = testSetVersionAbort1;
}
function testSetVersionAbort1()
@@ -63,6 +61,8 @@
function testSetVersionAbort2()
{
+ debug("");
+ debug("testSetVersionAbort2():");
checkMetadataEmpty();
request = evalAndLog("request = startSetVersion('version fail')");
request._onsuccess_ = addRemoveAddIDBObjects;
@@ -90,6 +90,8 @@
function testSetVersionAbort3()
{
+ debug("");
+ debug("testSetVersionAbort3():");
shouldBeFalse("event.cancelable");
checkMetadataEmpty();
request = evalAndLog("request = startSetVersion('version fail')");
@@ -98,8 +100,8 @@
function addIDBObjects()
{
- shouldBeFalse("event.cancelable");
debug("addIDBObjects():");
+ shouldBeFalse("event.cancelable");
var trans = evalAndLog("trans = event.target.result");
shouldBeTrue("trans !== null");
trans._onabort_ = testSetVersionAbort4;
@@ -113,14 +115,16 @@
function testSetVersionAbort4()
{
+ debug("");
+ debug("testSetVersionAbort4():");
checkMetadataEmpty();
request = evalAndLog("request = startSetVersion('version fail')");
request._onsuccess_ = addIDBObjectsAndCommit;
}
-function addIDBObjects()
+function addIDBObjectsAndCommit()
{
- debug("addIDBObjects():");
+ debug("addIDBObjectsAndCommit():");
var trans = evalAndLog("trans = event.target.result");
shouldBeTrue("trans !== null");
trans._onabort_ = unexpectedAbortCallback;
@@ -128,16 +132,13 @@
var store = evalAndLog("store = db.createObjectStore('storeFail', null)");
var index = evalAndLog("index = store.createIndex('indexFail', 'x', false)");
- commitAndContinue(testSetVersionAbort5);
+ trans._oncomplete_ = testSetVersionAbort5;
}
-function commitAndContinue(continueFunction)
-{
- window.setTimeout(continueFunction, 0);
-}
-
function testSetVersionAbort5()
{
+ debug("");
+ debug("testSetVersionAbort5():");
checkMetadataExistingObjectStore();
request = evalAndLog("request = startSetVersion('version fail')");
request._onsuccess_ = removeIDBObjects;
@@ -160,6 +161,8 @@
function testSetVersionAbort6()
{
+ debug("");
+ debug("testSetVersionAbort6():");
checkMetadataExistingObjectStore();
setNewVersion();
}
@@ -194,6 +197,7 @@
function setVersionSuccess()
{
+ debug("");
debug("setVersionSuccess():");
window.trans = evalAndLog("trans = event.target.result");
shouldBeTrue("trans !== null");
@@ -204,37 +208,28 @@
deleteAllObjectStores(db);
evalAndLog("db.createObjectStore('storeName', null)");
- transaction = evalAndLog("db.transaction(['storeName'])");
- transaction._onabort_ = abortCallback;
- var store = evalAndLog("store = transaction.objectStore('storeName')");
- shouldBeEqualToString("store.name", "storeName");
}
function completeCallback()
{
shouldBeFalse("event.cancelable");
testPassed("complete event fired");
- window.completeEventFired = true;
+ transaction = evalAndLog("db.transaction(['storeName'])");
+ transaction._onabort_ = abortCallback;
+ var store = evalAndLog("store = transaction.objectStore('storeName')");
+ shouldBeEqualToString("store.name", "storeName");
}
function abortCallback()
{
- testPassed("complete event fired");
- checkForCompleteEvent();
+ testPassed("abort event fired");
+ finishJSTest();
}
-function checkForCompleteEvent()
-{
- if (completeEventFired) {
- testPassed("oncomplete event had fired");
- done();
- } else
- setTimeout(checkForCompleteEvent, 1);
-}
-
-
+var jsTestIsAsync = true;
test();
</script>
+<script src=""
</body>
</html>