Return-Path: X-Original-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6B4A1DC5D for ; Thu, 27 Sep 2012 03:20:52 +0000 (UTC) Received: (qmail 76502 invoked by uid 500); 27 Sep 2012 03:20:52 -0000 Delivered-To: apmail-incubator-callback-commits-archive@incubator.apache.org Received: (qmail 76312 invoked by uid 500); 27 Sep 2012 03:20:50 -0000 Mailing-List: contact callback-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-commits@incubator.apache.org Received: (qmail 76218 invoked by uid 99); 27 Sep 2012 03:20:48 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Sep 2012 03:20:48 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 35BC0392DC; Thu, 27 Sep 2012 03:20:48 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: agrieve@apache.org To: callback-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [1/2] spec commit: Add an autotest for that does a sql transaction Message-Id: <20120927032048.35BC0392DC@tyr.zones.apache.org> Date: Thu, 27 Sep 2012 03:20:48 +0000 (UTC) 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 Authored: Wed Sep 26 23:20:01 2012 -0400 Committer: Andrew Grieve 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); }); }); });