diff options
Diffstat (limited to 'LayoutTests/storage/null-callbacks.html')
-rw-r--r-- | LayoutTests/storage/null-callbacks.html | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/LayoutTests/storage/null-callbacks.html b/LayoutTests/storage/null-callbacks.html new file mode 100644 index 0000000..4ca0e1c --- /dev/null +++ b/LayoutTests/storage/null-callbacks.html @@ -0,0 +1,46 @@ +<html> +<head> +<script> +function finishTest() +{ + if (window.layoutTestController) + layoutTestController.notifyDone(); +} + +function runTest() +{ + if (window.layoutTestController) { + layoutTestController.clearAllDatabases(); + layoutTestController.dumpAsText(); + layoutTestController.waitUntilDone(); + } + + try { + var db = openDatabase("NullCallbacks", "1.0", "Test for null callbacks.", 1); + db.transaction(function(tx) { + tx.executeSql("CREATE TABLE IF NOT EXISTS Test (Foo INT)", null); + tx.executeSql("INSERT INTO Test VALUES (?)", [1], null, null); + tx.executeSql("INSERT INTO Test VALUES (?)", [2], null); + tx.executeSql("INSERT INTO Test VALUES (3)", null, null, null); + tx.executeSql("INSERT INTO Test VALUES (?)", [4], null, + function(tx, error) {}); + }, null, null); + + db.transaction(function(tx) { + tx.executeSql("INSERT INTO Test VALUES (?)", [5]); + }, null, function() { finishTest(); }); + } catch(err) { + document.getElementById("console").innerHTML = "FAIL"; + finishTest(); + } +} + +</script> +</head> + +<body onload="runTest()"> +This test checks that 'null' can be used wherever we expect an optional callback. +<pre id="console">PASS</pre> +</body> + +</html> |