Updated Branches:
  refs/heads/master 6d4eff982 -> 14fc63719

Add an autotest for that does a sql transaction


Project: 
http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/commit/14fc6371
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/tree/14fc6371
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/diff/14fc6371

Branch: refs/heads/master
Commit: 14fc6371946d66f9855e87e927c7b69663de04b7
Parents: 0128681
Author: Andrew Grieve <agri...@chromium.org>
Authored: Wed Sep 26 23:20:01 2012 -0400
Committer: Andrew Grieve <agri...@chromium.org>
Committed: Wed Sep 26 23:20:01 2012 -0400

----------------------------------------------------------------------
 autotest/tests/storage.tests.js |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/blob/14fc6371/autotest/tests/storage.tests.js
----------------------------------------------------------------------
diff --git a/autotest/tests/storage.tests.js b/autotest/tests/storage.tests.js
index 1d1c76a..a613087 100644
--- a/autotest/tests/storage.tests.js
+++ b/autotest/tests/storage.tests.js
@@ -174,9 +174,22 @@ describe("Session Storage", function () {
             expect(window.openDatabase);
         });
 
-        it("Should open a database", function() {
-            var db = openDatabase("Database", "1.0", "HTML5 Database API 
example", 200000);
-            expect(db).toBeDefined();
+        it("Should be able to create and drop tables", function() {
+            var win = jasmine.createSpy('win');
+            var fail1 = createDoNotCallSpy('fail1');
+            var fail2 = createDoNotCallSpy('fail2');
+            var db = openDatabase("Database", "1.0", "HTML5 Database API 
example", 5*1024*1024);
+            db.transaction(function(t) {
+                t.executeSql('CREATE TABLE IF NOT EXISTS foo(id int, name 
varchar(255));');
+                t.executeSql('CREATE TABLE IF NOT EXISTS foo2(id int, name 
varchar(255));');
+            }, fail1, step2);
+            function step2() {
+              db.transaction(function(t) {
+                  t.executeSql('DROP TABLE foo;');
+                  t.executeSql('DROP TABLE foo2');
+              }, fail2, win);
+            }
+            waitsForAny(win, fail1, fail2);
         });
     });
 });

Reply via email to