Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / storage / websql / executesql-accepts-only-one-statement.html
blob9cc68634f17db3071f51f6f99ee6761bed38c007
1 <html>
2 <head>
3 <script>
5 var TOTAL_STATEMENTS = 8;
6 var statements = 0;
7 var db = null;
9 function log(message)
11 document.body.innerText += message + "\n";
14 function terminateTest()
16 if (window.testRunner)
17 testRunner.notifyDone();
20 function executeStatement(expectedToPass, statement)
22 db.transaction(function(tx) {
23 tx.executeSql(statement, [],
24 function(tx, data) {
25 if (!expectedToPass) {
26 log("Statement " + statement + " was expected to fail, but passed.");
27 terminateTest();
29 if (++statements == TOTAL_STATEMENTS) {
30 log("Test passed.");
31 terminateTest();
33 }, function(tx, error) {
34 if (expectedToPass) {
35 log("Statement " + statement + " was expected to pass, but failed.");
36 terminateTest();
38 if (++statements == TOTAL_STATEMENTS) {
39 log("Test passed.");
40 terminateTest();
42 });
43 });
46 function runTest()
48 if (window.testRunner) {
49 testRunner.clearAllDatabases();
50 testRunner.dumpAsText();
51 testRunner.waitUntilDone();
54 db = openDatabase("ExecuteSQLAcceptsOnlyOneStatementTest", "1.0", "", 1);
55 db.transaction(function(tx) {
56 tx.executeSql("CREATE TABLE IF NOT EXISTS Test (Foo INT)");
57 }, function(error) {
58 log("Test failed: " + error.message);
59 terminateTest();
60 }, function() {
61 executeStatement(true, "INSERT INTO Test VALUES (1)");
62 executeStatement(true, "INSERT INTO Test VALUES (2);");
63 executeStatement(true, " INSERT INTO Test VALUES (3) ");
64 executeStatement(true, " INSERT INTO Test VALUES (4); ");
65 executeStatement(true, "INSERT INTO Test VALUES (5) ;");
66 executeStatement(false, "INSERT INTO Test VALUES (6); garbage");
67 executeStatement(false, "INSERT INTO Test VALUES (7); INSERT INTO Test VALUES (8)");
68 executeStatement(false, " INSERT INTO Test VALUES (9); INSERT INTO Test VALUES (10); ");
69 });
72 </script>
73 </head>
74 <body onload="runTest();">
75 This test tests that executeSql() fails when called with a string that has more than one valid statement in it.<br>
76 </body>
77 </body>
78 </html>