Bug 692632 - 'IndexedDB: support empty objectstore/index names'. r=sicking.
authorBen Turner <bent.mozilla@gmail.com>
Mon, 07 Nov 2011 15:37:16 -0800
changeset 79918 f4041047f76f0e244922f5af182589921722de76
parent 79917 ed355562ff562ee5f3cc45e9954621bc29ad539d
child 79919 b7baa7788c391417a1a4b47ea43a189d7696018a
push id21440
push userbturner@mozilla.com
push dateMon, 07 Nov 2011 23:43:07 +0000
treeherdermozilla-central@b7baa7788c39 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssicking
bugs692632
milestone10.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 692632 - 'IndexedDB: support empty objectstore/index names'. r=sicking.
dom/indexedDB/DatabaseInfo.cpp
dom/indexedDB/IDBDatabase.cpp
dom/indexedDB/IDBFactory.cpp
dom/indexedDB/IDBObjectStore.cpp
dom/indexedDB/IDBTransaction.cpp
dom/indexedDB/nsIIDBDatabase.idl
dom/indexedDB/nsIIDBFactory.idl
dom/indexedDB/nsIIDBObjectStore.idl
dom/indexedDB/nsIIDBTransaction.idl
dom/indexedDB/test/test_create_index.html
dom/indexedDB/test/test_create_objectStore.html
dom/indexedDB/test/test_index_object_cursors.html
dom/indexedDB/test/test_open_empty_db.html
--- a/dom/indexedDB/DatabaseInfo.cpp
+++ b/dom/indexedDB/DatabaseInfo.cpp
@@ -240,17 +240,16 @@ DatabaseInfo::ContainsStoreName(const ns
 
 // static
 bool
 ObjectStoreInfo::Get(nsIAtom* aDatabaseId,
                      const nsAString& aName,
                      ObjectStoreInfo** aInfo)
 {
   NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
-  NS_ASSERTION(!aName.IsEmpty(), "Empty object store name!");
 
   if (gDatabaseHash) {
     DatabaseInfoHash* hash;
     if (gDatabaseHash->Get(aDatabaseId, &hash)) {
       if (hash->objectStoreHash) {
         return !!hash->objectStoreHash->Get(aName, aInfo);
       }
     }
--- a/dom/indexedDB/IDBDatabase.cpp
+++ b/dom/indexedDB/IDBDatabase.cpp
@@ -470,21 +470,16 @@ IDBDatabase::GetObjectStoreNames(nsIDOMD
 NS_IMETHODIMP
 IDBDatabase::CreateObjectStore(const nsAString& aName,
                                const jsval& aOptions,
                                JSContext* aCx,
                                nsIIDBObjectStore** _retval)
 {
   NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
 
-  if (aName.IsEmpty()) {
-    // XXX Update spec for a real error code here.
-    return NS_ERROR_DOM_INDEXEDDB_NON_TRANSIENT_ERR;
-  }
-
   IDBTransaction* transaction = AsyncConnectionHelper::GetCurrentTransaction();
 
   if (!transaction ||
       transaction->Mode() != nsIIDBTransaction::VERSION_CHANGE) {
     return NS_ERROR_DOM_INDEXEDDB_NOT_ALLOWED_ERR;
   }
 
   DatabaseInfo* databaseInfo;
--- a/dom/indexedDB/IDBFactory.cpp
+++ b/dom/indexedDB/IDBFactory.cpp
@@ -393,20 +393,16 @@ IDBFactory::Open(const nsAString& aName,
   if (XRE_GetProcessType() == GeckoProcessType_Content) {
     // Force ContentChild to cache the path from the parent, so that
     // we do not end up in a side thread that asks for the path (which
     // would make ContentChild try to send a message in a thread other
     // than the main one).
     ContentChild::GetSingleton()->GetIndexedDBPath();
   }
 
-  if (aName.IsEmpty()) {
-    return NS_ERROR_DOM_INDEXEDDB_NON_TRANSIENT_ERR;
-  }
-
   nsCOMPtr<nsPIDOMWindow> window = do_QueryReferent(mWindow);
   NS_ENSURE_TRUE(window, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
 
   nsCOMPtr<nsIScriptGlobalObject> sgo = do_QueryInterface(window);
   NS_ENSURE_TRUE(sgo, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
 
   nsIScriptContext* context = sgo->GetContext();
   NS_ENSURE_TRUE(context, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
--- a/dom/indexedDB/IDBObjectStore.cpp
+++ b/dom/indexedDB/IDBObjectStore.cpp
@@ -1260,17 +1260,17 @@ NS_IMETHODIMP
 IDBObjectStore::CreateIndex(const nsAString& aName,
                             const nsAString& aKeyPath,
                             const jsval& aOptions,
                             JSContext* aCx,
                             nsIIDBIndex** _retval)
 {
   NS_PRECONDITION(NS_IsMainThread(), "Wrong thread!");
 
-  if (aName.IsEmpty() || aKeyPath.IsEmpty()) {
+  if (aKeyPath.IsEmpty()) {
     return NS_ERROR_DOM_INDEXEDDB_NON_TRANSIENT_ERR;
   }
 
   IDBTransaction* transaction = AsyncConnectionHelper::GetCurrentTransaction();
 
   if (!transaction ||
       transaction != mTransaction ||
       mTransaction->Mode() != nsIIDBTransaction::VERSION_CHANGE) {
@@ -1394,20 +1394,16 @@ IDBObjectStore::Index(const nsAString& a
                       nsIIDBIndex** _retval)
 {
   NS_PRECONDITION(NS_IsMainThread(), "Wrong thread!");
 
   if (!mTransaction->IsOpen()) {
     return NS_ERROR_DOM_INDEXEDDB_TRANSACTION_INACTIVE_ERR;
   }
 
-  if (aName.IsEmpty()) {
-    return NS_ERROR_DOM_INDEXEDDB_NON_TRANSIENT_ERR;
-  }
-
   ObjectStoreInfo* info;
   if (!ObjectStoreInfo::Get(mTransaction->Database()->Id(), mName, &info)) {
     NS_ERROR("This should never fail!");
   }
 
   IndexInfo* indexInfo = nsnull;
   PRUint32 indexCount = info->indexes.Length();
   for (PRUint32 index = 0; index < indexCount; index++) {
@@ -1444,20 +1440,16 @@ IDBObjectStore::Index(const nsAString& a
   return NS_OK;
 }
 
 NS_IMETHODIMP
 IDBObjectStore::DeleteIndex(const nsAString& aName)
 {
   NS_PRECONDITION(NS_IsMainThread(), "Wrong thread!");
 
-  if (aName.IsEmpty()) {
-    return NS_ERROR_DOM_INDEXEDDB_NON_TRANSIENT_ERR;
-  }
-
   IDBTransaction* transaction = AsyncConnectionHelper::GetCurrentTransaction();
 
   if (!transaction ||
       transaction != mTransaction ||
       mTransaction->Mode() != nsIIDBTransaction::VERSION_CHANGE) {
     return NS_ERROR_DOM_INDEXEDDB_NOT_ALLOWED_ERR;
   }
 
--- a/dom/indexedDB/IDBTransaction.cpp
+++ b/dom/indexedDB/IDBTransaction.cpp
@@ -487,17 +487,16 @@ IDBTransaction::IsOpen() const
   return false;
 }
 
 already_AddRefed<IDBObjectStore>
 IDBTransaction::GetOrCreateObjectStore(const nsAString& aName,
                                        ObjectStoreInfo* aObjectStoreInfo)
 {
   NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
-  NS_ASSERTION(!aName.IsEmpty(), "Empty name!");
   NS_ASSERTION(aObjectStoreInfo, "Null pointer!");
 
   nsRefPtr<IDBObjectStore> retval;
 
   for (PRUint32 index = 0; index < mCreatedObjectStores.Length(); index++) {
     nsRefPtr<IDBObjectStore>& objectStore = mCreatedObjectStores[index];
     if (objectStore->Name() == aName) {
       retval = objectStore;
--- a/dom/indexedDB/nsIIDBDatabase.idl
+++ b/dom/indexedDB/nsIIDBDatabase.idl
@@ -45,17 +45,17 @@ interface nsIIDBTransaction;
 interface nsIDOMDOMStringList;
 interface nsIDOMEventListener;
 
 /**
  * IDBDatabase interface.  See
  * http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBDatabase
  * for more information.
  */
-[scriptable, builtinclass, uuid(ddc9dd43-704f-45da-bb91-20f4b3103117)]
+[scriptable, builtinclass, uuid(7ad626df-3328-476f-ba10-8ccec4924340)]
 interface nsIIDBDatabase : nsISupports
 {
   readonly attribute DOMString name;
 
   readonly attribute unsigned long long version;
 
   readonly attribute nsIDOMDOMStringList objectStoreNames;
 
@@ -64,21 +64,21 @@ interface nsIIDBDatabase : nsISupports
    *   - keyPath (string):
    *       Specifies key path on objects in the objectStore. Defaults to no key
    *       path.
    *   - autoIncrement (boolean):
    *       Specifies if the objectStore has a key generator. Defaults to false.
    */
   [implicit_jscontext]
   nsIIDBObjectStore
-  createObjectStore(in AString name,
+  createObjectStore([Null(Stringify)] in DOMString name,
                     [optional /* none */] in jsval options);
 
   void
-  deleteObjectStore(in AString name);
+  deleteObjectStore([Null(Stringify)] in DOMString name);
 
   [optional_argc, implicit_jscontext]
   nsIIDBTransaction
   transaction(in jsval storeNames, // js array of strings
               [optional /* READ_ONLY */] in unsigned short mode);
 
   void
   close();
--- a/dom/indexedDB/nsIIDBFactory.idl
+++ b/dom/indexedDB/nsIIDBFactory.idl
@@ -43,16 +43,16 @@
 interface nsIIDBKeyRange;
 interface nsIIDBOpenDBRequest;
 
 /**
  * Interface that defines the indexedDB property on a window.  See
  * http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBFactory
  * for more information.
  */
-[scriptable, builtinclass, uuid(d2889b8f-662a-42d3-8a8f-ac5179b9d5b0)]
+[scriptable, builtinclass, uuid(aaf95f14-f858-4f86-9369-79bf3c06b6c8)]
 interface nsIIDBFactory : nsISupports
 {
   [implicit_jscontext, optional_argc]
   nsIIDBOpenDBRequest
-  open(in AString name,
+  open([Null(Stringify)] in DOMString name,
        [optional] in long long version);
 };
--- a/dom/indexedDB/nsIIDBObjectStore.idl
+++ b/dom/indexedDB/nsIIDBObjectStore.idl
@@ -45,17 +45,17 @@ interface nsIIDBRequest;
 interface nsIIDBTransaction;
 interface nsIDOMDOMStringList;
 
 /**
  * nsIIDBObjectStore interface.  See
  * http://dev.w3.org/2006/webapi/WebSimpleDB/#idl-def-nsIIDBObjectStore
  * for more information.
  */
-[scriptable, builtinclass, uuid(d25dff2f-81ad-4531-bcbe-e85c8a19f11a)]
+[scriptable, builtinclass, uuid(adc6a1e2-9fd7-4d28-a7f9-9c653313124b)]
 interface nsIIDBObjectStore : nsISupports
 {
   readonly attribute DOMString name;
 
   readonly attribute DOMString keyPath;
 
   readonly attribute nsIDOMDOMStringList indexNames;
 
@@ -103,24 +103,24 @@ interface nsIIDBObjectStore : nsISupport
   /**
    * Optional arguments:
    *   - unique (boolean):
    *       Specifies whether values in the index must be unique. Defaults to
    *       false.
    */
   [implicit_jscontext]
   nsIIDBIndex
-  createIndex(in AString name,
-              in AString keyPath,
+  createIndex([Null(Stringify)] in DOMString name,
+              [Null(Stringify)] in DOMString keyPath,
               [optional /* none */] in jsval options);
 
   // Returns object immediately
   nsIIDBIndex
-  index(in AString name);
+  index([Null(Stringify)] in DOMString name);
 
   void
-  deleteIndex(in AString name);
+  deleteIndex([Null(Stringify)] in DOMString name);
 
   // Accepts null, a key value, or a nsIIDBKeyRange object.
   [implicit_jscontext, optional_argc]
   nsIIDBRequest
   count([optional] in jsval key);
 };
--- a/dom/indexedDB/nsIIDBTransaction.idl
+++ b/dom/indexedDB/nsIIDBTransaction.idl
@@ -45,17 +45,17 @@ interface nsIIDBRequest;
 interface nsIIDBDatabase;
 interface nsIDOMDOMStringList;
 
 /**
  * IDBDTransaction interface.  See
  * http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBTransaction
  * for more information.
  */
-[scriptable, builtinclass, uuid(13e551a1-1a58-42ec-b0bd-7102ec0f64d6)]
+[scriptable, builtinclass, uuid(4f25832d-de40-4c0b-a176-358d94384b19)]
 interface nsIIDBTransaction : nsISupports
 {
   readonly attribute nsIIDBDatabase db;
 
   const unsigned short INITIAL = 0;
   const unsigned short LOADING = 1;
   const unsigned short COMMITTING = 2;
   const unsigned short DONE = 3;
@@ -64,17 +64,17 @@ interface nsIIDBTransaction : nsISupport
   const unsigned short READ_ONLY = 0;
   const unsigned short READ_WRITE = 1;
   const unsigned short VERSION_CHANGE = 2;
   readonly attribute unsigned short mode;
 
   readonly attribute nsIDOMDOMStringList objectStoreNames;
 
   nsIIDBObjectStore
-  objectStore(in AString name);
+  objectStore([Null(Stringify)] in DOMString name);
 
   // Don't commit the transaction.
   void abort();
 
   attribute nsIDOMEventListener onerror;
 
   // Event listener that fires when the transaction is completed
   // successfully. Receives an Event.
--- a/dom/indexedDB/test/test_create_index.html
+++ b/dom/indexedDB/test/test_create_index.html
@@ -20,47 +20,33 @@
       const objectStoreInfo = [
         { name: "a", options: { keyPath: "id", autoIncrement: true } },
         { name: "b", options: { keyPath: "id", autoIncrement: false } },
       ];
       const indexInfo = [
         { name: "1", keyPath: "unique_value", options: { unique: true } },
         { name: "2", keyPath: "value", options: { unique: false } },
         { name: "3", keyPath: "value", options: { unique: false } },
+        { name: "", keyPath: "value", options: { unique: false } },
+        { name: null, keyPath: "value", options: { unique: false } },
+        { name: undefined, keyPath: "value", options: { unique: false } },
       ];
 
       let request = mozIndexedDB.open(name, 1, description);
       request.onerror = errorHandler;
       request.onupgradeneeded = grabEventAndContinueHandler;
       let event = yield;
       let db = event.target.result;
 
       for (let i = 0; i < objectStoreInfo.length; i++) {
         let info = objectStoreInfo[i];
         let objectStore = info.hasOwnProperty("options") ?
                           db.createObjectStore(info.name, info.options) :
                           db.createObjectStore(info.name);
 
-        // Test basic failure conditions.
-        try {
-          request = objectStore.createIndex(null, null);
-          ok(false, "createIndex with null name should throw");
-        }
-        catch(e) {
-          ok(true, "createIndex with null name should throw");
-        }
-
-        try {
-          request = objectStore.createIndex("", "");
-          ok(false, "createIndex with empty name should throw");
-        }
-        catch(e) {
-          ok(true, "createIndex with empty name should throw");
-        }
-
         try {
           request = objectStore.createIndex("Hola");
           ok(false, "createIndex with no keyPath should throw");
         }
         catch(e) {
           ok(true, "createIndex with no keyPath should throw");
         }
 
@@ -85,25 +71,33 @@
         for (let j = 0; j < indexInfo.length; j++) {
           let info = indexInfo[j];
           let count = objectStore.indexNames.length;
           let index = info.hasOwnProperty("options") ?
                       objectStore.createIndex(info.name, info.keyPath,
                                               info.options) :
                       objectStore.createIndex(info.name, info.keyPath);
 
-          is(index.name, info.name, "correct name");
+          let name = info.name;
+          if (name === null) {
+            name = "null";
+          }
+          else if (name === undefined) {
+            name = "undefined";
+          }
+
+          is(index.name, name, "correct name");
           is(index.keyPath, info.keyPath, "correct keyPath");
           is(index.unique, info.options.unique, "correct uniqueness");
 
           is(objectStore.indexNames.length, count + 1,
              "indexNames grew in size");
           let found = false;
           for (let k = 0; k < objectStore.indexNames.length; k++) {
-            if (objectStore.indexNames.item(k) == info.name) {
+            if (objectStore.indexNames.item(k) == name) {
               found = true;
               break;
             }
           }
           ok(found, "Name is on objectStore.indexNames");
 
           ok(event.target.transaction, "event has a transaction");
           ok(event.target.transaction.db === db,
--- a/dom/indexedDB/test/test_create_objectStore.html
+++ b/dom/indexedDB/test/test_create_objectStore.html
@@ -23,46 +23,33 @@
         { name: "3", options: { keyPath: "", autoIncrement: false } },
         { name: "4", options: { keyPath: "" } },
         { name: "5", options: { keyPath: "foo" } },
         { name: "6" },
         { name: "7", options: null },
         { name: "8", options: { autoIncrement: true } },
         { name: "9", options: { autoIncrement: false } },
         { name: "10", options: { keyPath: "foo", autoIncrement: false } },
-        { name: "11", options: { keyPath: "foo", autoIncrement: true } }
+        { name: "11", options: { keyPath: "foo", autoIncrement: true } },
+        { name: "" },
+        { name: null },
+        { name: undefined }
       ];
 
       let request = mozIndexedDB.open(name, 1, description);
       request.onerror = errorHandler;
       request.onupgradeneeded = grabEventAndContinueHandler;
       let event = yield;
 
       let db = event.target.result;
 
       let count = db.objectStoreNames.length;
       is(count, 0, "correct objectStoreNames length");
 
       try {
-        db.createObjectStore(null);
-        ok(false, "createObjectStore with null name should throw");
-      }
-      catch(e) {
-        ok(true, "createObjectStore with null name should throw");
-      }
-
-      try {
-        db.createObjectStore("");
-        ok(false, "createObjectStore with empty name should throw");
-      }
-      catch(e) {
-        ok(true, "createObjectStore with empty name should throw");
-      }
-
-      try {
         db.createObjectStore("foo", "bar");
         ok(false, "createObjectStore with bad options should throw");
       }
       catch(e) {
         ok(true, "createObjectStore with bad options");
       }
 
       try {
@@ -79,43 +66,51 @@
 
         let objectStore = info.hasOwnProperty("options") ?
                           db.createObjectStore(info.name, info.options) :
                           db.createObjectStore(info.name);
 
         is(db.objectStoreNames.length, index + 1,
            "updated objectStoreNames list");
 
+        let name = info.name;
+        if (name === null) {
+          name = "null";
+        }
+        else if (name === undefined) {
+          name = "undefined";
+        }
+
         let found = false;
         for (let i = 0; i <= index; i++) {
-          if (db.objectStoreNames.item(i) == info.name) {
+          if (db.objectStoreNames.item(i) == name) {
             found = true;
             break;
           }
         }
         is(found, true, "objectStoreNames contains name");
 
-        is(objectStore.name, info.name, "Bad name");
+        is(objectStore.name, name, "Bad name");
         is(objectStore.keyPath, info.options && info.options.keyPath ?
                                 info.options.keyPath : "",
            "Bad keyPath");
         if(objectStore.indexNames.length, 0, "Bad indexNames");
 
         ok(event.target.transaction, "event has a transaction");
         ok(event.target.transaction.db === db, "transaction has the right db");
         is(event.target.transaction.readyState, nsIIDBTransaction.LOADING,
            "transaction has the correct readyState");
         is(event.target.transaction.mode, nsIIDBTransaction.VERSION_CHANGE,
            "transaction has the correct mode");
         is(event.target.transaction.objectStoreNames.length, index + 1,
            "transaction has correct objectStoreNames list");
         found = false;
         for (let j = 0; j < event.target.transaction.objectStoreNames.length;
              j++) {
-          if (event.target.transaction.objectStoreNames.item(j) == info.name) {
+          if (event.target.transaction.objectStoreNames.item(j) == name) {
             found = true;
             break;
           }
         }
         is(found, true, "transaction has correct objectStoreNames list");
       }
 
       finishTest();
--- a/dom/indexedDB/test/test_index_object_cursors.html
+++ b/dom/indexedDB/test/test_index_object_cursors.html
@@ -8,25 +8,25 @@
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
     function testSteps()
     {
       const objectStoreData = [
-        { name: "3", options: { keyPath: "id", autoIncrement: true } },
-        { name: "1", options: { keyPath: "ss" } },
-        { name: "2", options: { } },
+        { name: "", options: { keyPath: "id", autoIncrement: true } },
+        { name: null, options: { keyPath: "ss" } },
+        { name: undefined, options: { } },
         { name: "4", options: { autoIncrement: true } },
       ];
 
       const indexData = [
-        { name: "name", keyPath: "name", options: { unique: true } },
-        { name: "height", keyPath: "height", options: { } }
+        { name: "", keyPath: "name", options: { unique: true } },
+        { name: null, keyPath: "height", options: { } }
       ];
 
       const data = [
         { ss: "237-23-7732", name: "Ann", height: 60 },
         { ss: "237-23-7733", name: "Bob", height: 65 }
       ];
 
       let request = mozIndexedDB.open(window.location.pathname, 1);
@@ -82,17 +82,18 @@
 
           index.openCursor().onsuccess = function(event) {
             let cursor = event.target.result;
             if (!cursor) {
               continueToNextStep();
               return;
             }
 
-            is(cursor.key, data[keyIndex][indexName], "Good key");
+            is(cursor.key, data[keyIndex][indexData[indexIndex].keyPath],
+               "Good key");
             is(cursor.value.ss, data[keyIndex].ss, "Correct ss");
             is(cursor.value.name, data[keyIndex].name, "Correct name");
             is(cursor.value.height, data[keyIndex].height, "Correct height");
 
             if (!keyIndex) {
               let obj = cursor.value;
               obj.updated = true;
 
--- a/dom/indexedDB/test/test_open_empty_db.html
+++ b/dom/indexedDB/test/test_open_empty_db.html
@@ -7,55 +7,48 @@
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript;version=1.7">
     function testSteps()
     {
-      const name = window.location.pathname;
-      const description = "My Test Database";
+      const names = [
+        "",
+        null,
+        undefined,
+        window.location.pathname
+      ];
 
-      let request;
+      const version = 1;
+
+      for each (let name in names) {
+        let request = mozIndexedDB.open(name, version);
+        request.onerror = errorHandler;
+        request.onsuccess = grabEventAndContinueHandler;
+        let event = yield;
 
-      try {
-        request = mozIndexedDB.open("", 1);
-        ok(false, "Open with empty name should have thrown!");
-      }
-      catch(e) {
-        is(e instanceof IDBDatabaseException, true, "Got IDBDatabaseException");
-        is(e.code, IDBDatabaseException.NON_TRANSIENT_ERR, "Good error code");
-        is(request, undefined, "Shouldn't be set to anything");
-      }
+        if (name === null) {
+          name = "null";
+        }
+        else if (name === undefined) {
+          name = "undefined";
+        }
 
-      try {
-        request = mozIndexedDB.open(null, 1);
-        ok(false, "Open with null name should have thrown!");
+        let db = event.target.result;
+        is(db.name, name, "Bad name");
+        is(db.version, version, "Bad version");
+        is(db.objectStoreNames.length, 0, "Bad objectStores list");
+
+        is(db.name, request.result.name, "Bad name");
+        is(db.version, request.result.version, "Bad version");
+        is(db.objectStoreNames.length, request.result.objectStoreNames.length,
+           "Bad objectStores list");
       }
-      catch(e) {
-        is(e instanceof IDBDatabaseException, true, "Got IDBDatabaseException");
-        is(e.code, IDBDatabaseException.NON_TRANSIENT_ERR, "Good error code");
-        is(request, undefined, "Shouldn't be set to anything");
-      }
-
-      request = mozIndexedDB.open(name, 1, description);
-      request.onerror = errorHandler;
-      request.onsuccess = grabEventAndContinueHandler;
-      let event = yield;
-
-      let db = event.target.result;
-      is(db.name, name, "Bad name");
-      is(db.version, 1, "Bad version");
-      is(db.objectStoreNames.length, 0, "Bad objectStores list");
-
-      is(db.name, request.result.name, "Bad name");
-      is(db.version, request.result.version, "Bad version");
-      is(db.objectStoreNames.length, request.result.objectStoreNames.length,
-         "Bad objectStores list");
 
       finishTest();
       yield;
     }
   </script>
   <script type="text/javascript;version=1.7" src="helpers.js"></script>
 
 </head>