diff options
author | Martin Jones <martin.jones@nokia.com> | 2009-11-23 23:17:06 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2009-11-23 23:17:06 (GMT) |
commit | 31540e4b5177073d71b98e296ad7d59faf63b383 (patch) | |
tree | 6eaf3e50b1a351171db3d47b8e39e0ee7478bc54 /tests/auto/declarative/sql/data/readonly-error.js | |
parent | 7d93b0762aff8bcd9cb22f12ebc88beb242f2a97 (diff) | |
parent | 8d263b7cbf6b0bd17deeb8b56c90e0232057b832 (diff) | |
download | Qt-31540e4b5177073d71b98e296ad7d59faf63b383.zip Qt-31540e4b5177073d71b98e296ad7d59faf63b383.tar.gz Qt-31540e4b5177073d71b98e296ad7d59faf63b383.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'tests/auto/declarative/sql/data/readonly-error.js')
-rw-r--r-- | tests/auto/declarative/sql/data/readonly-error.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/declarative/sql/data/readonly-error.js b/tests/auto/declarative/sql/data/readonly-error.js new file mode 100644 index 0000000..ab82712 --- /dev/null +++ b/tests/auto/declarative/sql/data/readonly-error.js @@ -0,0 +1,28 @@ +function test() { + var r="transaction_not_finished"; + var db = openDatabaseSync("QmlTestDB-readonly-error", "1.0", "Test database from Qt autotests", 1000000); + + db.transaction( + function(tx) { + tx.executeSql('CREATE TABLE IF NOT EXISTS Greeting(salutation TEXT, salutee TEXT)'); + tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]); + r = "passed"; + } + ); + + try { + db.readTransaction( + function(tx) { + tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]); + r = "FAILED"; + } + ); + } catch (err) { + if (err.message == "Read-only Transaction") + r = "passed"; + else + r = "WRONG ERROR="+err.message; + } + + return r; +} |