OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <body> | 3 <body> |
4 This test tests that the statement error callback is called in the right world. | 4 This test tests that the statement error callback is called in the right world. |
5 <div id="console"></div> | 5 <div id="console"></div> |
6 <script> | 6 <script> |
7 var statementErrorCallbacksInvoked = 0; | 7 var statementErrorCallbacksInvoked = 0; |
8 function done() | 8 function done() |
9 { | 9 { |
10 if ((++statementErrorCallbacksInvoked == 2) && (window.testRunner)) | 10 if ((++statementErrorCallbacksInvoked == 2) && (window.testRunner)) |
(...skipping 13 matching lines...) Expand all Loading... |
24 } | 24 } |
25 | 25 |
26 document.body.foo = "FAIL: document.body.foo visible in isolated world."; | 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 th
is world."; | 27 document.body.bar = "PASS: document.body.bar visible in a callback created in th
is world."; |
28 | 28 |
29 if (window.testRunner) { | 29 if (window.testRunner) { |
30 testRunner.clearAllDatabases(); | 30 testRunner.clearAllDatabases(); |
31 testRunner.dumpAsText(); | 31 testRunner.dumpAsText(); |
32 testRunner.waitUntilDone(); | 32 testRunner.waitUntilDone(); |
33 testRunner.evaluateScriptInIsolatedWorld( | 33 testRunner.evaluateScriptInIsolatedWorld( |
34 0, | 34 1, |
35 "function statementErrorCallback1(tx, error)\n" + | 35 "function statementErrorCallback1(tx, error)\n" + |
36 "{\n" + | 36 "{\n" + |
37 " alert(document.body.foo);\n" + | 37 " alert(document.body.foo);\n" + |
38 " window.location='javascript:done()';\n" + | 38 " window.location='javascript:done()';\n" + |
39 "}\n" + | 39 "}\n" + |
40 "var db1 = openDatabase('StatementErrorCallbackIsolatedWorld1', '1.0', '
', 1);\n" + | 40 "var db1 = openDatabase('StatementErrorCallbackIsolatedWorld1', '1.0', '
', 1);\n" + |
41 "db1.transaction(function(tx) {\n" + | 41 "db1.transaction(function(tx) {\n" + |
42 " tx.executeSql('BAD STATEMENT', [], function(tx, data) {}, statement
ErrorCallback1);\n" + | 42 " tx.executeSql('BAD STATEMENT', [], function(tx, data) {}, statement
ErrorCallback1);\n" + |
43 "});"); | 43 "});"); |
44 | 44 |
45 var db2 = openDatabase('StatementErrorCallbackIsolatedWorld2', '1.0', '', 1)
; | 45 var db2 = openDatabase('StatementErrorCallbackIsolatedWorld2', '1.0', '', 1)
; |
46 db2.transaction(function(tx) { | 46 db2.transaction(function(tx) { |
47 tx.executeSql('BAD STATEMENT', [], function(tx, data) {}, statementError
Callback2); | 47 tx.executeSql('BAD STATEMENT', [], function(tx, data) {}, statementError
Callback2); |
48 }); | 48 }); |
49 } | 49 } |
50 </script> | 50 </script> |
51 </body> | 51 </body> |
52 </html> | 52 </html> |
OLD | NEW |