Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / sources / debugger-async / async-callstack-web-sql.html
blob2b282e364ef138845c918c98fac0012a388c5b93
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>
7 function testFunction()
9 setTimeout(openDB);
12 function onSuccess()
14 debugger;
17 function onError()
19 console.error("FAIL: " + new Error().stack);
20 debugger;
23 function openDB()
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);
30 function onOpenDB()
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)
39 debugger;
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()
47 debugger;
50 function test()
52 var totalDebuggerStatements = 5;
53 var maxAsyncCallStackDepth = 4;
54 InspectorTest.runAsyncCallStacksTest(totalDebuggerStatements, maxAsyncCallStackDepth);
57 </script>
58 </head>
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>