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

Side by Side Diff: content/browser/indexed_db/indexed_db_transaction_unittest.cc

Issue 237143006: Make iterating over a corrupted IndexedDB fail. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/indexed_db/indexed_db_transaction.h" 5 #include "content/browser/indexed_db/indexed_db_transaction.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
11 #include "content/browser/indexed_db/indexed_db_fake_backing_store.h" 11 #include "content/browser/indexed_db/indexed_db_fake_backing_store.h"
12 #include "content/browser/indexed_db/mock_indexed_db_database_callbacks.h" 12 #include "content/browser/indexed_db/mock_indexed_db_database_callbacks.h"
13 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
14 14
15 namespace content { 15 namespace content {
16 16
17 class IndexedDBTransactionTest : public testing::Test { 17 class IndexedDBTransactionTest : public testing::Test {
18 public: 18 public:
19 IndexedDBTransactionTest() { 19 IndexedDBTransactionTest() {
20 IndexedDBFactory* factory = NULL; 20 IndexedDBFactory* factory = NULL;
21 backing_store_ = new IndexedDBFakeBackingStore(); 21 backing_store_ = new IndexedDBFakeBackingStore();
22 leveldb::Status s;
22 db_ = IndexedDBDatabase::Create(base::ASCIIToUTF16("db"), 23 db_ = IndexedDBDatabase::Create(base::ASCIIToUTF16("db"),
23 backing_store_, 24 backing_store_,
24 factory, 25 factory,
25 IndexedDBDatabase::Identifier()); 26 IndexedDBDatabase::Identifier(),
27 s);
26 } 28 }
27 29
28 void RunPostedTasks() { message_loop_.RunUntilIdle(); } 30 void RunPostedTasks() { message_loop_.RunUntilIdle(); }
29 void DummyOperation(IndexedDBTransaction* transaction) {} 31 void DummyOperation(IndexedDBTransaction* transaction) {}
30 32
31 protected: 33 protected:
32 scoped_refptr<IndexedDBFakeBackingStore> backing_store_; 34 scoped_refptr<IndexedDBFakeBackingStore> backing_store_;
33 scoped_refptr<IndexedDBDatabase> db_; 35 scoped_refptr<IndexedDBDatabase> db_;
34 36
35 private: 37 private:
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 indexed_db::TRANSACTION_READ_ONLY, 285 indexed_db::TRANSACTION_READ_ONLY,
284 indexed_db::TRANSACTION_READ_WRITE, 286 indexed_db::TRANSACTION_READ_WRITE,
285 indexed_db::TRANSACTION_VERSION_CHANGE 287 indexed_db::TRANSACTION_VERSION_CHANGE
286 }; 288 };
287 289
288 INSTANTIATE_TEST_CASE_P(IndexedDBTransactions, 290 INSTANTIATE_TEST_CASE_P(IndexedDBTransactions,
289 IndexedDBTransactionTestMode, 291 IndexedDBTransactionTestMode,
290 ::testing::ValuesIn(kTestModes)); 292 ::testing::ValuesIn(kTestModes));
291 293
292 } // namespace content 294 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698