3 <script src=
"../../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"../../../http/tests/inspector/debugger-test.js"></script>
7 function testFunction()
19 console
.error("FAIL: " + new Error().stack
);
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
);
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.
37 function onCreateTableSQLTransactionCallback(tx
)
40 tx
.executeSql("CREATE TABLE IF NOT EXISTS tmp(ID INTEGER PRIMARY KEY ASC, added_on DATETIME)", [], onSuccess
, onError
);
41 tx
.executeSql("INSERT INTO tmp(added_on) VALUES (?)", [new Date()], onSuccess
, onError
);
42 tx
.executeSql("DROP TABLE tmp", [], onDropTable
, onError
);
45 function onDropTable()
52 var totalDebuggerStatements
= 5;
53 var maxAsyncCallStackDepth
= 4;
54 InspectorTest
.runAsyncCallStacksTest(totalDebuggerStatements
, maxAsyncCallStackDepth
);
60 <body onload=
"runTest()">
61 <input type='button' onclick='testFunction()' value='Test'
/>
63 Tests asynchronous call stacks for Web SQL.