2 <title>IndexedDB: Verify deleteDatabase success event</title>
3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script>
7 var t = async_test('deleteDatabase success event type, existing DB');
9 var dbName = 'db' + location.pathname;
10 var openRequest = indexedDB.open(dbName, 9);
11 openRequest.onsuccess = t.step_func(function(e) {
12 var db = openRequest.result;
15 var deleteRequest = indexedDB.deleteDatabase(dbName);
16 deleteRequest.onsuccess = t.step_func(function(e) {
17 assert_equals(deleteRequest.result, undefined,
18 '...the implementation must set the result of the request to undefined...');
19 assert_true(e instanceof IDBVersionChangeEvent,
20 'The event must implement the IDBVersionChangeEvent interface ...');
21 assert_equals(e.oldVersion, 9,
22 'and have oldVersion set to database version...');
23 assert_equals(e.newVersion, null,
24 'and have the newVersion property set to null.');
32 var t = async_test('deleteDatabase success event, non-existent DB');
35 var dbName = 'db' + location.pathname + '-does-not-exist';
36 var deleteRequest = indexedDB.deleteDatabase(dbName);
37 deleteRequest.onsuccess = t.step_func(function(e) {
38 assert_equals(deleteRequest.result, undefined,
39 '...the implementation must set the result of the request to undefined...');
40 assert_true(e instanceof IDBVersionChangeEvent,
41 'The event must implement the IDBVersionChangeEvent interface ...');
42 assert_equals(e.oldVersion, 0,
43 'and have oldVersion set to database version...');
44 assert_equals(e.newVersion, null,
45 'and have the newVersion property set to null.');