Home | History | Annotate | Download | only in indexeddb
      1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 function test() {
      6   indexedDBTest(populateObjectStore);
      7 }
      8 
      9 function populateObjectStore()
     10 {
     11   db = event.target.result;
     12   debug('Populating object store');
     13   window.objectStore = db.createObjectStore('employees', {keyPath: 'id'});
     14   shouldBe("objectStore.name", "'employees'");
     15   shouldBe("objectStore.keyPath", "'id'");
     16 
     17   shouldBe('db.name', 'dbname');
     18   shouldBe('db.version', '1');
     19   shouldBe('db.objectStoreNames.length', '1');
     20   shouldBe('db.objectStoreNames[0]', '"employees"');
     21 
     22   debug('Deleting an object store.');
     23   db.deleteObjectStore('employees');
     24   shouldBe('db.objectStoreNames.length', '0');
     25 
     26   done();
     27 }
     28