diff options
Diffstat (limited to 'content/test/data/indexeddb/database_test.js')
-rw-r--r-- | content/test/data/indexeddb/database_test.js | 34 |
1 files changed, 7 insertions, 27 deletions
diff --git a/content/test/data/indexeddb/database_test.js b/content/test/data/indexeddb/database_test.js index 840c5bd..caaa1a9 100644 --- a/content/test/data/indexeddb/database_test.js +++ b/content/test/data/indexeddb/database_test.js @@ -2,16 +2,20 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +function test() { + indexedDBTest(populateObjectStore); +} + function populateObjectStore() { + db = event.target.result; debug('Populating object store'); - deleteAllObjectStores(db); window.objectStore = db.createObjectStore('employees', {keyPath: 'id'}); shouldBe("objectStore.name", "'employees'"); shouldBe("objectStore.keyPath", "'id'"); - shouldBe('db.name', '"name"'); - shouldBe('db.version', '"1.0"'); + shouldBe('db.name', 'dbname'); + shouldBe('db.version', '1'); shouldBe('db.objectStoreNames.length', '1'); shouldBe('db.objectStoreNames[0]', '"employees"'); @@ -21,27 +25,3 @@ function populateObjectStore() done(); } - -function setVersion() -{ - debug('setVersion'); - window.db = event.target.result; - var request = db.setVersion('1.0'); - request.onsuccess = populateObjectStore; - request.onerror = unexpectedErrorCallback; -} - -function test() -{ - if ('webkitIndexedDB' in window) { - indexedDB = webkitIndexedDB; - IDBCursor = webkitIDBCursor; - IDBKeyRange = webkitIDBKeyRange; - IDBTransaction = webkitIDBTransaction; - } - - debug('Connecting to indexedDB'); - var request = indexedDB.open('name'); - request.onsuccess = setVersion; - request.onerror = unexpectedErrorCallback; -} |