4 This test tests that the transaction success callback is called in the right world.
5 <div id=
"console"></div>
7 var transactionSuccessCallbacksInvoked
= 0;
10 if ((++transactionSuccessCallbacksInvoked
== 2) && (window
.testRunner
))
11 testRunner
.notifyDone();
14 function transactionSuccessCallback1(tx
)
16 alert("FAIL: Visible in isolated world.");
20 function transactionSuccessCallback2(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
.testRunner
) {
30 testRunner
.clearAllDatabases();
31 testRunner
.dumpAsText();
32 testRunner
.waitUntilDone();
33 testRunner
.evaluateScriptInIsolatedWorld(
35 "function transactionSuccessCallback1(tx)\n" +
37 " alert(document.body.foo);\n" +
38 " window.location='javascript:done()';\n" +
40 "var db1 = openDatabase('TransactionSuccessCallbackIsolatedWorld1', '1.0', '', 1);\n" +
41 "db1.transaction(function(tx) { }, null, transactionSuccessCallback1);");
43 var db2
= openDatabase('TransactionSuccessCallbackIsolatedWorld2', '1.0', '', 1);
44 db2
.transaction(function(tx
) { }, null, transactionSuccessCallback2
);