2 <title>IndexedDB: Deleting an object store with a new index should complete
</title>
3 <script src=
"../../resources/testharness.js"></script>
4 <script src=
"../../resources/testharnessreport.js"></script>
6 var t
= async_test('Deleting an object store with a new index should complete');
8 var dbName
= 'db' + location
.pathname
;
9 var deleteRequest
= indexedDB
.deleteDatabase(dbName
);
10 deleteRequest
.onsuccess
= t
.step_func(function() {
11 var openRequest
= indexedDB
.open(dbName
);
12 openRequest
.onupgradeneeded
= t
.step_func(function(e
) {
13 var db
= openRequest
.result
;
14 var store
= db
.createObjectStore('store');
15 store
.put('value', 'key');
16 store
.createIndex('index', 'keyPath');
17 assert_array_equals(db
.objectStoreNames
, ['store'], 'One store should be present.');
18 assert_array_equals(store
.indexNames
, ['index'], 'One index should be present.');
19 db
.deleteObjectStore('store');
20 assert_array_equals(db
.objectStoreNames
, [], 'No stores should be present.');
22 openRequest
.onsuccess
= t
.step_func(function(e
) {
23 var db
= openRequest
.result
;
24 assert_array_equals(db
.objectStoreNames
, [], 'No stores should be present.');