Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / js / exceptions-thrown-in-callbacks.html
blobae52d53da1d0425c383ca091ba2113265b8afc29
1 This test ensures that exceptions are handled correctly by the various callback mechanisms present in WebCore.
2 <script>
3 if (window.testRunner) {
4 testRunner.dumpAsText();
5 testRunner.waitUntilDone();
8 var db = openDatabase("exception-info-test", "1.0", "Test for exception information thrown by callbacks and timers", 1);
10 function errorObject(msg) {
11 return { message: "FAIL: message incorrectly pulled from thrown object in " + msg,
12 toString: function() {return "PASS: toString called on exception value thrown from " + msg} }
15 function eventTest() {
16 setTimeout(dbTransactionTest, 0);
17 throw errorObject("event handler");
20 function dbTransactionTest() {
21 db.transaction(function(tx) {
22 setTimeout(dbStatementTest, 0);
23 throw errorObject("sql transaction callback");
24 });
27 function dbStatementTest() {
28 db.transaction(
29 function(tx) {
30 tx.executeSql("I am bogus syntax", [], function() {
31 }, function(tx, error) {
32 setTimeout(timerTest, 0);
33 throw errorObject("sql error callback");
34 });
35 });
38 function timerTest() {
39 if (window.testRunner)
40 setTimeout("testRunner.notifyDone()", 0);
41 throw errorObject("timer");
44 window.onload = eventTest;
45 </script>