From dcc8cf2e65d1aa555cce12431a16547e66b469ee Mon Sep 17 00:00:00 2001 From: Steve Block Date: Tue, 27 Apr 2010 16:31:00 +0100 Subject: Merge webkit.org at r58033 : Initial merge by git Change-Id: If006c38561af287c50cd578d251629b51e4d8cd1 --- .../storage/database-lock-after-reload.html | 34 ++++---- ...cutesql-accepts-only-one-statement-expected.txt | 3 + .../executesql-accepts-only-one-statement.html | 78 +++++++++++++++++++ .../open-database-creation-callback-expected.txt | 2 + ...e-creation-callback-isolated-world-expected.txt | 4 + ...-database-creation-callback-isolated-world.html | 46 +++++++++++ .../storage/open-database-creation-callback.html | 90 ++++++++++++++++++++++ .../storage/open-database-over-quota-expected.txt | 2 + LayoutTests/storage/open-database-over-quota.html | 24 ++++++ .../resources/database-lock-after-reload-2.html | 18 ++--- .../storage/statement-error-callback-expected.txt | 5 +- ...ment-error-callback-isolated-world-expected.txt | 4 + .../statement-error-callback-isolated-world.html | 52 +++++++++++++ LayoutTests/storage/statement-error-callback.html | 81 +++++++++---------- ...nt-success-callback-isolated-world-expected.txt | 4 + .../statement-success-callback-isolated-world.html | 52 +++++++++++++ ...ransaction-callback-isolated-world-expected.txt | 4 + .../transaction-callback-isolated-world.html | 48 ++++++++++++ ...tion-error-callback-isolated-world-expected.txt | 4 + .../transaction-error-callback-isolated-world.html | 52 +++++++++++++ 20 files changed, 534 insertions(+), 73 deletions(-) create mode 100644 LayoutTests/storage/executesql-accepts-only-one-statement-expected.txt create mode 100644 LayoutTests/storage/executesql-accepts-only-one-statement.html create mode 100644 LayoutTests/storage/open-database-creation-callback-expected.txt create mode 100644 LayoutTests/storage/open-database-creation-callback-isolated-world-expected.txt create mode 100644 LayoutTests/storage/open-database-creation-callback-isolated-world.html create mode 100644 LayoutTests/storage/open-database-creation-callback.html create mode 100644 LayoutTests/storage/open-database-over-quota-expected.txt create mode 100644 LayoutTests/storage/open-database-over-quota.html create mode 100644 LayoutTests/storage/statement-error-callback-isolated-world-expected.txt create mode 100644 LayoutTests/storage/statement-error-callback-isolated-world.html create mode 100644 LayoutTests/storage/statement-success-callback-isolated-world-expected.txt create mode 100644 LayoutTests/storage/statement-success-callback-isolated-world.html create mode 100644 LayoutTests/storage/transaction-callback-isolated-world-expected.txt create mode 100644 LayoutTests/storage/transaction-callback-isolated-world.html create mode 100644 LayoutTests/storage/transaction-error-callback-isolated-world-expected.txt create mode 100644 LayoutTests/storage/transaction-error-callback-isolated-world.html (limited to 'LayoutTests/storage') diff --git a/LayoutTests/storage/database-lock-after-reload.html b/LayoutTests/storage/database-lock-after-reload.html index 8bdaddc..5b5989f 100644 --- a/LayoutTests/storage/database-lock-after-reload.html +++ b/LayoutTests/storage/database-lock-after-reload.html @@ -1,8 +1,6 @@ diff --git a/LayoutTests/storage/executesql-accepts-only-one-statement-expected.txt b/LayoutTests/storage/executesql-accepts-only-one-statement-expected.txt new file mode 100644 index 0000000..b95ceee --- /dev/null +++ b/LayoutTests/storage/executesql-accepts-only-one-statement-expected.txt @@ -0,0 +1,3 @@ +This test tests that executeSql() fails when called with a string that has more than one valid statement in it. +Test passed. + diff --git a/LayoutTests/storage/executesql-accepts-only-one-statement.html b/LayoutTests/storage/executesql-accepts-only-one-statement.html new file mode 100644 index 0000000..a3860c8 --- /dev/null +++ b/LayoutTests/storage/executesql-accepts-only-one-statement.html @@ -0,0 +1,78 @@ + + + + + +This test tests that executeSql() fails when called with a string that has more than one valid statement in it.
+ + + diff --git a/LayoutTests/storage/open-database-creation-callback-expected.txt b/LayoutTests/storage/open-database-creation-callback-expected.txt new file mode 100644 index 0000000..d86ab72 --- /dev/null +++ b/LayoutTests/storage/open-database-creation-callback-expected.txt @@ -0,0 +1,2 @@ +This test tests openDatabase()'s creation callback. + diff --git a/LayoutTests/storage/open-database-creation-callback-isolated-world-expected.txt b/LayoutTests/storage/open-database-creation-callback-isolated-world-expected.txt new file mode 100644 index 0000000..fa96a67 --- /dev/null +++ b/LayoutTests/storage/open-database-creation-callback-isolated-world-expected.txt @@ -0,0 +1,4 @@ +ALERT: undefined +ALERT: PASS: document.body.bar visible in a callback created in this world. +This test tests that the openDatabase() creation callback is called in the right world. + diff --git a/LayoutTests/storage/open-database-creation-callback-isolated-world.html b/LayoutTests/storage/open-database-creation-callback-isolated-world.html new file mode 100644 index 0000000..98a4664 --- /dev/null +++ b/LayoutTests/storage/open-database-creation-callback-isolated-world.html @@ -0,0 +1,46 @@ + + + +This test tests that the openDatabase() creation callback is called in the right world. +
+ + + diff --git a/LayoutTests/storage/open-database-creation-callback.html b/LayoutTests/storage/open-database-creation-callback.html new file mode 100644 index 0000000..ac24942 --- /dev/null +++ b/LayoutTests/storage/open-database-creation-callback.html @@ -0,0 +1,90 @@ + + + + + + +This test tests openDatabase()'s creation callback. +
+
+ + + diff --git a/LayoutTests/storage/open-database-over-quota-expected.txt b/LayoutTests/storage/open-database-over-quota-expected.txt new file mode 100644 index 0000000..d0c15e4 --- /dev/null +++ b/LayoutTests/storage/open-database-over-quota-expected.txt @@ -0,0 +1,2 @@ +This tests that calling openDatabase with a size over 5MB doesn't assert on debug builds. +PASS diff --git a/LayoutTests/storage/open-database-over-quota.html b/LayoutTests/storage/open-database-over-quota.html new file mode 100644 index 0000000..2a9264d --- /dev/null +++ b/LayoutTests/storage/open-database-over-quota.html @@ -0,0 +1,24 @@ + + + + + +
This tests that calling openDatabase with a size over 5MB doesn't assert on debug builds. +
+FAIL: We shouldn't have been able to open the database. +
+ + diff --git a/LayoutTests/storage/resources/database-lock-after-reload-2.html b/LayoutTests/storage/resources/database-lock-after-reload-2.html index d73a0df..6e0f09c 100644 --- a/LayoutTests/storage/resources/database-lock-after-reload-2.html +++ b/LayoutTests/storage/resources/database-lock-after-reload-2.html @@ -1,8 +1,6 @@ + + diff --git a/LayoutTests/storage/statement-error-callback.html b/LayoutTests/storage/statement-error-callback.html index 060a881..6db836d 100644 --- a/LayoutTests/storage/statement-error-callback.html +++ b/LayoutTests/storage/statement-error-callback.html @@ -15,37 +15,42 @@ function finishTest() } var txCallbackCount = 0; -var NUMBER_OF_TRANSACTIONS = 7; +var NUMBER_OF_TRANSACTIONS = 10; var database; -function transactionErrorFunction(error) -{ - log("PASS - the transaction error callback was invoked."); - if (++txCallbackCount == NUMBER_OF_TRANSACTIONS) - finishTest(); -} - -function transactionSuccessFunction(message) -{ - log("FAIL - the transaction success callback should not be invoked."); - if (++txCallbackCount == NUMBER_OF_TRANSACTIONS) - finishTest(); -} - -function runTransactionExpectedToFail(statementErrorCallback) +function runTransaction(expectedToFail, statementErrorCallback) { database.transaction(function(tx) { - tx.executeSql("CREATE TABLE IF NOT EXISTS StatementErrorCallbackTest (randomData)"); - tx.executeSql("INSERT INTO StatementErrorCallbackTest (randomData) VALUES (?)", ['test']); + tx.executeSql("CREATE TABLE IF NOT EXISTS TestTable (RandomData TEXT)"); + tx.executeSql("INSERT INTO TestTable VALUES (?)", ['test']); tx.executeSql("THIS STATEMENT WILL FAIL", [], function(tx, data) { log("FAIL - this statement should have failed"); finishTest(); }, statementErrorCallback); - tx.executeSql("INSERT INTO StatementErrorCallbackTest (randomData) VALUES (?)", ['test1'], - function(error) { log("FAIL - This statement should not have been executed"); }, - function() { log("FAIL - This statement should not have been executed"); }); - }, transactionErrorFunction, transactionSuccessFunction); + tx.executeSql("INSERT INTO TestTable VALUES (?)", ['test1'], + function(error) { + if (expectedToFail) + log("FAIL - This statement should not have been executed"); + }, function() { + if (expectedToFail) + log("FAIL - This statement should not have been executed"); + }); + }, function(error) { + if (expectedToFail) + log("PASS - the transaction error callback was invoked."); + else + log("FAIL - the transaction error callback should not have been invoked."); + if (++txCallbackCount == NUMBER_OF_TRANSACTIONS) + finishTest(); + }, function() { + if (expectedToFail) + log("FAIL - the transaction success callback should not have been invoked."); + else + log("PASS - the transaction success callback was invoked."); + if (++txCallbackCount == NUMBER_OF_TRANSACTIONS) + finishTest(); + }); } function runTest() @@ -56,28 +61,18 @@ function runTest() layoutTestController.waitUntilDone(); } - database = openDatabase("bug-28872", "1.0", "statement error callback test", 1024); - database.transaction(function(tx) { - tx.executeSql("CREATE TABLE IF NOT EXISTS StatementErrorCallbackTest (randomData)"); - tx.executeSql("INSERT INTO StatementErrorCallbackTest (randomData) VALUES (?)", ['test']); - tx.executeSql("THIS STATEMENT WILL FAIL", [], - function(tx, data) { - log("FAIL - this statement should have failed"); - finishTest(); - }, function(tx, error) { return false; }); - tx.executeSql("INSERT INTO StatementErrorCallbackTest (randomData) VALUES (?)", ['test1'], - function(tx, data) { }, - function(tx, error) { log("FAIL - This statement should not have caused an error"); }); - }, function(error) { log("FAIL - The transaction error callback should not have been invoked"); }, - function() { }); + database = openDatabase("StatementErrorCallbackTest", "1.0", "statement error callback test", 1024); - runTransactionExpectedToFail(function(error) { return true; }); - runTransactionExpectedToFail(function(error) { throw "Exception in statement error callback"; return false; }); - runTransactionExpectedToFail(function(error) {}); - runTransactionExpectedToFail(function(error) { return null; }); - runTransactionExpectedToFail(function(error) { return "some string"; }); - runTransactionExpectedToFail(function(error) { return 1234; }); - runTransactionExpectedToFail(function(error) { return {a: 2, b: "abc"}; }); + runTransaction(true, function(error) { return true; }); + runTransaction(true, function(error) { throw "Exception in statement error callback"; return false; }); + runTransaction(true, function(error) { return "some string"; }); + runTransaction(true, function(error) { return 1234; }); + runTransaction(true, function(error) { return {a: 2, b: "abc"}; }); + runTransaction(true, function(error) { return "false"; }); + runTransaction(false, function(error) {}); + runTransaction(false, function(error) { return false; }); + runTransaction(false, function(error) { return 0; }); + runTransaction(false, function(error) { return null; }); } diff --git a/LayoutTests/storage/statement-success-callback-isolated-world-expected.txt b/LayoutTests/storage/statement-success-callback-isolated-world-expected.txt new file mode 100644 index 0000000..2ef027d --- /dev/null +++ b/LayoutTests/storage/statement-success-callback-isolated-world-expected.txt @@ -0,0 +1,4 @@ +ALERT: undefined +ALERT: PASS: document.body.bar visible in a callback created in this world. +This test tests that the statement success callback is called in the right world. + diff --git a/LayoutTests/storage/statement-success-callback-isolated-world.html b/LayoutTests/storage/statement-success-callback-isolated-world.html new file mode 100644 index 0000000..4fac754 --- /dev/null +++ b/LayoutTests/storage/statement-success-callback-isolated-world.html @@ -0,0 +1,52 @@ + + + +This test tests that the statement success callback is called in the right world. +
+ + + diff --git a/LayoutTests/storage/transaction-callback-isolated-world-expected.txt b/LayoutTests/storage/transaction-callback-isolated-world-expected.txt new file mode 100644 index 0000000..27f474f --- /dev/null +++ b/LayoutTests/storage/transaction-callback-isolated-world-expected.txt @@ -0,0 +1,4 @@ +ALERT: undefined +ALERT: PASS: document.body.bar visible in a callback created in this world. +This test tests that the transaction callback is called in the right world. + diff --git a/LayoutTests/storage/transaction-callback-isolated-world.html b/LayoutTests/storage/transaction-callback-isolated-world.html new file mode 100644 index 0000000..6825d70 --- /dev/null +++ b/LayoutTests/storage/transaction-callback-isolated-world.html @@ -0,0 +1,48 @@ + + + +This test tests that the transaction callback is called in the right world. +
+ + + diff --git a/LayoutTests/storage/transaction-error-callback-isolated-world-expected.txt b/LayoutTests/storage/transaction-error-callback-isolated-world-expected.txt new file mode 100644 index 0000000..da15396 --- /dev/null +++ b/LayoutTests/storage/transaction-error-callback-isolated-world-expected.txt @@ -0,0 +1,4 @@ +ALERT: undefined +ALERT: PASS: document.body.bar visible in a callback created in this world. +This test tests that the transaction error callback is called in the right world. + diff --git a/LayoutTests/storage/transaction-error-callback-isolated-world.html b/LayoutTests/storage/transaction-error-callback-isolated-world.html new file mode 100644 index 0000000..521894d --- /dev/null +++ b/LayoutTests/storage/transaction-error-callback-isolated-world.html @@ -0,0 +1,52 @@ + + + +This test tests that the transaction error callback is called in the right world. +
+ + + -- cgit v1.1