Bug 383619 - Get xpcshell tests for mozStorage (windows orange fix). r=rcampbell
authorsdwilsh@shawnwilsher.com
Tue, 12 Jun 2007 09:28:27 -0700
changeset 2296 cd040600132e63b9b505aa2387c319bcb95c3fc4
parent 2295 fdbcf68b6874ab3fd150a8909646b77728faf3ff
child 2297 d4b8e9d7ead35874a78bce9d34bd997bbbbe0bae
push idunknown
push userunknown
push dateunknown
reviewersrcampbell
bugs383619
milestone1.9a6pre
Bug 383619 - Get xpcshell tests for mozStorage (windows orange fix). r=rcampbell
storage/test/Makefile.in
storage/test/unit/head_storage.js
--- a/storage/test/Makefile.in
+++ b/storage/test/Makefile.in
@@ -16,16 +16,17 @@
 #
 # The Initial Developer of the Original Code is
 #   Oracle Corporation
 # Portions created by the Initial Developer are Copyright (C) 2004
 # the Initial Developer. All Rights Reserved.
 #
 # Contributor(s):
 #   Vladimir Vukicevic <vladimir.vukicevic@oracle.com>
+#   Shawn Wilsher <me@shawnwilsher.com>
 #
 # Alternatively, the contents of this file may be used under the terms of
 # either of the GNU General Public License Version 2 or later (the "GPL"),
 # or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 # in which case the provisions of the GPL or the LGPL are applicable instead
 # of those above. If you wish to allow use of your version of this file only
 # under the terms of either the GPL or the LGPL, and not to allow others to
 # use your version of this file under the terms of the MPL, indicate your
@@ -40,16 +41,20 @@ DEPTH		= ../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 PROGRAM = teststorage1$(BIN_SUFFIX)
 
+MODULE = test_storage
+
+XPCSHELL_TESTS = unit
+
 CPPSRCS = storage1.cpp
 
 REQUIRES = \
 	xpcom \
 	string \
 	storage \
 	storagecomps \
 	$(NULL)
--- a/storage/test/unit/head_storage.js
+++ b/storage/test/unit/head_storage.js
@@ -48,17 +48,18 @@ function getTestDB()
   db.append("test_storage.sqlite");
   return db;
 }
 
 function cleanup()
 {
   // removing test db
   var dbFile = getTestDB();
-  if (dbFile.exists()) dbFile.remove(false);
+  if (dbFile.exists())
+    try { dbFile.remove(true); } catch(e) { /* stupid windows box */ }
 }
 
 function getService()
 {
   return Cc["@mozilla.org/storage/service;1"].getService(Ci.mozIStorageService);
 }
 
 function getOpenedDatabase()