Chromium Code Reviews| 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..f6b058ebb7ffba16fccee1a88bdf0b968e0d4517 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,20 @@ 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. |
|
jsbell
2015/02/19 19:05:44
Maybe as a follow-up?
|
| + 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"); |
| } |