Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / ManualTests / database-threading-stress-test.html
blobf22610ca2f5177d4a0694b05c31861cb236b3738
1 <!doctype html>
2 <html>
3 <head>
5 <style>
6 pre { padding: 5px; border: 1px solid black; }
7 </style>
9 <script>
10 var db;
12 try {
13 if (window.openDatabase) {
14 db = openDatabase("StressTest1", "1.0", "Database Stress Test", 200000);
15 if (!db)
16 alert("Failed to open the database on disk. This is probably because the version was bad or there is not enough space left in this domain's quota");
17 } else
18 alert("Couldn't open the database.");
19 } catch(err) { }
21 var highestId = 0;
22 var allData = new Array();
24 function newData()
26 var id = ++highestId;
27 allData.push(id);
28 db.transaction(function (tx)
30 tx.executeSql("INSERT INTO FillerData (id, filler) VALUES (?, randomblob(1024))", [id]);
31 });
34 function testOpen()
36 for (var i = 0; i < 4; i++) {
37 newData();
40 setTimeout("testClose();", 0);
43 function testClose()
45 db.transaction(function(tx)
47 for (var i = 0; i < allData.length; i++)
48 tx.executeSql("DELETE FROM FillerData WHERE id = ?", [allData[i]]);
50 allData = new Array();
51 });
52 setTimeout("testOpen();", 0);
55 function updateTransactionCount()
57 document.getElementById("transactionCount").innerHTML = "Current Transaction Count: " + highestId;
58 setTimeout("updateTransactionCount();", 1000);
61 function loaded()
63 db.transaction(function(tx) {
64 tx.executeSql("SELECT COUNT(*) FROM FillerData", [], function(result) { }, function(tx, error) {
65 tx.executeSql("CREATE TABLE FillerData (id REAL UNIQUE, filler)", [], function(result) {
66 });
67 });
68 });
70 setTimeout("testOpen();", 0);
71 setTimeout("updateTransactionCount();", 1000);
74 addEventListener('load', loaded, false);
75 </script>
76 </head>
78 <body>
79 This test stresses the database threading code by constantly opening transactions to the test database at a fast rate.<br>
80 See radar 5729446 for more details.<br>
81 <pre id="transactionCount">Current Transaction Count: 0</pre>
83 </body>
84 </html>