| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> | |
| 4 <script src="../../../http/tests/inspector/debugger-test.js"></script> | |
| 5 <script> | |
| 6 | |
| 7 function testFunction() | |
| 8 { | |
| 9 setTimeout(openDB); | |
| 10 } | |
| 11 | |
| 12 function onSuccess() | |
| 13 { | |
| 14 debugger; | |
| 15 } | |
| 16 | |
| 17 function onError() | |
| 18 { | |
| 19 console.error("FAIL: " + new Error().stack); | |
| 20 debugger; | |
| 21 } | |
| 22 | |
| 23 function openDB() | |
| 24 { | |
| 25 var dbSize = 1 * 1024 * 1024; // 1 MB | |
| 26 var db = openDatabase("async-callstack-web-sql-db", "1.0", "Test DB", dbSize
, onOpenDB); | |
| 27 db.transaction(onCreateTableSQLTransactionCallback, onError, onSuccess); | |
| 28 } | |
| 29 | |
| 30 function onOpenDB() | |
| 31 { | |
| 32 // This will be called only once when the database is created. | |
| 33 // There is no way to delete a database in WebSQL from JavaScript, | |
| 34 // so test async call stacks in this callback manually. | |
| 35 } | |
| 36 | |
| 37 function onCreateTableSQLTransactionCallback(tx) | |
| 38 { | |
| 39 debugger; | |
| 40 tx.executeSql("CREATE TABLE IF NOT EXISTS tmp(ID INTEGER PRIMARY KEY ASC, ad
ded_on DATETIME)", [], onSuccess, onError); | |
| 41 tx.executeSql("INSERT INTO tmp(added_on) VALUES (?)", [new Date()], onSucces
s, onError); | |
| 42 tx.executeSql("DROP TABLE tmp", [], onDropTable, onError); | |
| 43 } | |
| 44 | |
| 45 function onDropTable() | |
| 46 { | |
| 47 debugger; | |
| 48 } | |
| 49 | |
| 50 function test() | |
| 51 { | |
| 52 var totalDebuggerStatements = 5; | |
| 53 var maxAsyncCallStackDepth = 4; | |
| 54 InspectorTest.runAsyncCallStacksTest(totalDebuggerStatements, maxAsyncCallSt
ackDepth); | |
| 55 } | |
| 56 | |
| 57 </script> | |
| 58 </head> | |
| 59 | |
| 60 <body onload="runTest()"> | |
| 61 <input type='button' onclick='testFunction()' value='Test'/> | |
| 62 <p> | |
| 63 Tests asynchronous call stacks for Web SQL. | |
| 64 </p> | |
| 65 </body> | |
| 66 </html> | |
| OLD | NEW |