4 This test tests that the transaction error callback is called in the right world.
5 <div id="console"></div>
7 var transactionErrorCallbacksInvoked = 0;
10 if ((++transactionErrorCallbacksInvoked == 2) && (window.layoutTestController))
11 layoutTestController.notifyDone();
14 function transactionErrorCallback1(tx)
16 alert("FAIL: Visible in isolated world.");
20 function transactionErrorCallback2(tx)
22 alert(document.body.bar);
26 document.body.foo = "FAIL: document.body.foo visible in isolated world.";
27 document.body.bar = "PASS: document.body.bar visible in a callback created in this world.";
29 if (window.layoutTestController) {
30 layoutTestController.clearAllDatabases();
31 layoutTestController.dumpAsText();
32 layoutTestController.waitUntilDone();
33 layoutTestController.evaluateScriptInIsolatedWorld(
35 "function transactionErrorCallback1(tx)\n" +
37 " alert(document.body.foo);\n" +
38 " window.location='javascript:done()';\n" +
40 "var db1 = openDatabase('TransactionErrorCallbackIsolatedWorld1', '1.0', '', 1);\n" +
41 "db1.transaction(function(tx) {\n" +
42 " tx.executeSql('BAD STATEMENT', [], function(tx, data) {}, function(tx, error) { return true; });\n" +
43 "}, transactionErrorCallback1);");
45 var db2 = openDatabase('TransactionErrorCallbackIsolatedWorld2', '1.0', '', 1);
46 db2.transaction(function(tx) {
47 tx.executeSql('BAD STATEMENT', [], function(tx, data) {}, function(tx, error) { return true; });
48 }, transactionErrorCallback2);