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

Unified Diff: content/test/data/indexeddb/corrupted_open_db_recovery.html

Issue 197333009: Handling LevelDB errors encountered after open. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reverted two unecessary changes Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
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>
« no previous file with comments | « content/test/data/indexeddb/corrupted_open_db_detection.html ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698