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

Unified Diff: content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.cc

Issue 932143003: IndexedDB: Report QuotaExceededError when commit fails due to disk full (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move IndexedDBDatabaseError impl to cc file Created 5 years, 10 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/browser/indexed_db/mock_browsertest_indexed_db_class_factory.cc
diff --git a/content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.cc b/content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.cc
index b44742943e05b7eb7d0e2245e50ea8533fb1cf4e..5cade12b5f8dc500902425db6a1e79dda3b82152 100644
--- a/content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.cc
+++ b/content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.cc
@@ -8,6 +8,7 @@
#include "content/browser/indexed_db/leveldb/leveldb_iterator_impl.h"
#include "content/browser/indexed_db/leveldb/leveldb_transaction.h"
#include "content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.h"
+#include "third_party/leveldatabase/env_chromium.h"
#include "third_party/leveldatabase/src/include/leveldb/status.h"
namespace {
@@ -64,10 +65,18 @@ class LevelDBTestTransaction : public LevelDBTransaction {
}
leveldb::Status Commit() override {
- if (fail_method_ != FAIL_METHOD_COMMIT ||
+ if ((fail_method_ != FAIL_METHOD_COMMIT &&
+ fail_method_ != FAIL_METHOD_COMMIT_DISK_FULL) ||
++current_call_num_ != fail_on_call_num_)
return LevelDBTransaction::Commit();
+ // TODO(jsbell): Consider parameterizing the failure mode.
+ if (fail_method_ == FAIL_METHOD_COMMIT_DISK_FULL) {
+ return leveldb_env::MakeIOError("dummy filename", "Disk Full",
+ leveldb_env::kWritableFileAppend,
+ base::File::FILE_ERROR_NO_SPACE);
+ }
+
return leveldb::Status::Corruption("Corrupted for the test");
}
« no previous file with comments | « content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698