Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / storage / websql / success-callback.html
blob724b0c33c5376a44b90e94744d9d266c109acbec
1 <html>
2 <head>
3 <script>
5 function log(message)
7 document.getElementById("console").innerHTML += message + "<br>";
10 function finishTest()
12 log("Test Complete");
13 if (window.testRunner)
14 testRunner.notifyDone();
17 function errorFunction(error)
19 log("Test failed - " + error.message);
20 finishTest();
23 var successCount = 0;
25 function successFunction(message)
27 log("Transaction succeeded - " + message);
28 if (++successCount == 2)
29 finishTest();
32 function runTest()
34 if (window.testRunner) {
35 testRunner.clearAllDatabases();
36 testRunner.dumpAsText();
37 testRunner.waitUntilDone();
40 var database = openDatabase("SuccessCallbackDatabase", "1.0", "Test for success callback <rdar://5737692>", 1);
41 database.transaction(function(tx) { tx.executeSql("CREATE TABLE IF NOT EXISTS SuccessCallbackTest (randomData)", []); }, errorFunction, function() { successFunction("Transaction with one statement"); });
42 database.transaction(function(tx) { }, errorFunction, function() { successFunction("Empty transaction"); });
45 </script>
46 </head>
48 <body onload="runTest()">
49 This test confirms that a successful transaction - both with and without a statement - receives its successCallback
50 <pre id="console">
51 </pre>
52 </body>
54 </html>