Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(341)

Side by Side Diff: LayoutTests/storage/indexeddb/deleteDatabase-event.html

Issue 235493003: deleteDatabase() success should be IDBVersionChangeEvent [Blink] (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/storage/indexeddb/deleteDatabase-event-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <script>
5 (function() {
6 var t = async_test('deleteDatabase success event type, existing DB');
7 t.step(function() {
8 var dbName = 'db' + Date.now() + '-' + Math.random();
9 var openRequest = indexedDB.open(dbName, 9);
10 openRequest.onsuccess = t.step_func(function(e) {
11 var db = openRequest.result;
12 db.close();
13
14 var deleteRequest = indexedDB.deleteDatabase(dbName);
15 deleteRequest.onsuccess = t.step_func(function(e) {
16 assert_true(e instanceof IDBVersionChangeEvent,
17 'The event must implement the IDBVersionChangeEvent interface ...');
18 assert_equals(e.oldVersion, 9,
19 'and have oldVersion set to database version...');
20 assert_equals(e.newVersion, null,
21 'and have the newVersion property set to null.');
22 t.done();
23 });
24 });
25 });
26 }());
27
28 (function() {
29 var t = async_test('deleteDatabase success event, non-exitent DB');
30 t.step(function() {
31
32 var dbName = 'db-that-does-not-exist';
33 var deleteRequest = indexedDB.deleteDatabase(dbName);
34 deleteRequest.onsuccess = t.step_func(function(e) {
35 assert_true(e instanceof IDBVersionChangeEvent,
36 'The event must implement the IDBVersionChangeEvent inte rface ...');
37 assert_equals(e.oldVersion, 0,
38 'and have oldVersion set to database version...');
39 assert_equals(e.newVersion, null,
40 'and have the newVersion property set to null.');
cmumford 2014/04/11 19:36:45 event.target.result === undefined is also part of
jsbell 2014/04/11 20:20:20 Thanks, added an assertion.
41 t.done();
42 });
43 });
44 }());
45 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/storage/indexeddb/deleteDatabase-event-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698