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

Side by Side Diff: content/test/data/indexeddb/invalid_schema.js

Issue 11196029: Test for destroying leveldb directory when we detect a schema downgrade (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add some comments, improve var names Created 8 years, 2 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
OLDNEW
(Empty)
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 request = webkitIndexedDB.open('database-basics');
7 request.onsuccess = onSuccess;
8 request.onerror = unexpectedErrorCallback;
9 request.onblocked = unexpectedBlockedCallback;
10 request.onupgradeneeded = upgradeNeeded;
jsbell 2012/10/17 23:44:14 Nit: maybe put onupgradeneeded before onsuccess to
11 }
12
13 var gotUpgradeNeeded = false;
14 function upgradeNeeded() {
15 gotUpgradeNeeded = true;
16 }
17
18
jsbell 2012/10/17 23:44:14 Nit: remove one blank line
19 function onSuccess(event) {
20 db = event.target.result;
21 debug("The pre-existing leveldb has an objectStore in 'database-basics',");
22 debug("ensure that it was blown away");
23 shouldBe("db.objectStoreNames.length", "0");
24 debug("We should have gotten an upgradeneeded event because the new empty");
25 debug("database doesn't have a version.");
26 shouldBeTrue("gotUpgradeNeeded");
27 done();
28 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698