| document.getElementById("console").innerHTML += message + "<br>"; |
| if (window.layoutTestController) |
| layoutTestController.notifyDone(); |
| function errorFunction(error) |
| log("Test failed - " + error.message); |
| function successFunction(message) |
| log("Transaction succeeded - " + message); |
| if (window.layoutTestController) { |
| layoutTestController.clearAllDatabases(); |
| layoutTestController.dumpAsText(); |
| layoutTestController.waitUntilDone(); |
| var database = openDatabase("SuccessCallbackDatabase", "1.0", "Test for success callback <rdar://5737692>", 1); |
| database.transaction(function(tx) { tx.executeSql("CREATE TABLE IF NOT EXISTS SuccessCallbackTest (randomData)", []); }, errorFunction, function() { successFunction("Transaction with one statement"); }); |
| database.transaction(function(tx) { }, errorFunction, function() { successFunction("Empty transaction"); }); |
| <body onload="runTest()"> |
| This test confirms that a successful transaction - both with and without a statement - receives its successCallback |