Index: content/test/data/indexeddb/open_bad_db.js |
diff --git a/content/test/data/indexeddb/open_bad_db.js b/content/test/data/indexeddb/open_bad_db.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2b360be03c7d2635f3ebc64c3fd63f45da4a6381 |
--- /dev/null |
+++ b/content/test/data/indexeddb/open_bad_db.js |
@@ -0,0 +1,27 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+function test() { |
+ request = webkitIndexedDB.open('database-basics'); |
+ request.onupgradeneeded = upgradeNeeded; |
+ request.onsuccess = onSuccess; |
+ request.onerror = unexpectedErrorCallback; |
+ request.onblocked = unexpectedBlockedCallback; |
+} |
+ |
+var gotUpgradeNeeded = false; |
+function upgradeNeeded() { |
+ gotUpgradeNeeded = true; |
+} |
+ |
+function onSuccess(event) { |
+ db = event.target.result; |
+ debug("The pre-existing leveldb has an objectStore in 'database-basics',"); |
+ debug("ensure that it was blown away"); |
+ shouldBe("db.objectStoreNames.length", "0"); |
+ debug("We should have gotten an upgradeneeded event because the new empty"); |
+ debug("database doesn't have a version."); |
+ shouldBeTrue("gotUpgradeNeeded"); |
+ done(); |
+} |