Index: content/test/data/indexeddb/corrupted_open_db_recovery.html |
diff --git a/content/test/data/indexeddb/open_bad_db.js b/content/test/data/indexeddb/corrupted_open_db_recovery.html |
similarity index 54% |
copy from content/test/data/indexeddb/open_bad_db.js |
copy to content/test/data/indexeddb/corrupted_open_db_recovery.html |
index 0ab3f000fac1ef1fec7fc28dda156c14678574ca..b1f7deed5aa838ba5ae7a297b1046048a549fa53 100644 |
--- a/content/test/data/indexeddb/open_bad_db.js |
+++ b/content/test/data/indexeddb/corrupted_open_db_recovery.html |
@@ -1,9 +1,18 @@ |
-// 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. |
+<!DOCTYPE html> |
+<html> |
+<!-- |
+ Copyright 2014 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. |
+--> |
+<head> |
+<title>IDB test that db's corrupted while open are properly handled Part 2 / 2</title> |
+<script type="text/javascript" src="common.js"></script> |
+<script> |
function test() { |
- request = webkitIndexedDB.open('database-basics'); |
+ dbname = "corrupted_open_db_detection.html"; |
+ request = webkitIndexedDB.open(dbname); |
request.onupgradeneeded = upgradeNeeded; |
request.onsuccess = onSuccess; |
request.onerror = unexpectedErrorCallback; |
@@ -14,6 +23,7 @@ var gotUpgradeNeeded = false; |
function upgradeNeeded(evt) { |
event = evt; |
shouldBe("event.dataLoss", "'total'"); |
+ shouldBeTrue('event.dataLossMessage.startsWith("IndexedDB (database was corrupt): ")'); |
gotUpgradeNeeded = true; |
} |
@@ -27,3 +37,10 @@ function onSuccess(event) { |
shouldBeTrue("gotUpgradeNeeded"); |
done(); |
} |
+ |
+</script> |
+</head> |
+<body onLoad="test()"> |
+<div id="status">Starting...</div> |
+</body> |
+</html> |