OLD | NEW |
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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 class IndexedDBTransactionTest : public testing::Test { | 36 class IndexedDBTransactionTest : public testing::Test { |
37 public: | 37 public: |
38 IndexedDBTransactionTest() : factory_(new MockIndexedDBFactory()) { | 38 IndexedDBTransactionTest() : factory_(new MockIndexedDBFactory()) { |
39 backing_store_ = new IndexedDBFakeBackingStore(); | 39 backing_store_ = new IndexedDBFakeBackingStore(); |
40 CreateDB(); | 40 CreateDB(); |
41 } | 41 } |
42 | 42 |
43 void CreateDB() { | 43 void CreateDB() { |
44 // DB is created here instead of the constructor to workaround a | 44 // DB is created here instead of the constructor to workaround a |
45 // "peculiarity of C++". More info at | 45 // "peculiarity of C++". More info at |
46 // https://code.google.com/p/googletest/wiki/FAQ#My_compiler_complains_that_
a_constructor_(or_destructor)_cannot | 46 // https://github.com/google/googletest/blob/master/googletest/docs/FAQ.md#m
y-compiler-complains-that-a-constructor-or-destructor-cannot-return-a-value-what
s-going-on |
47 leveldb::Status s; | 47 leveldb::Status s; |
48 db_ = IndexedDBDatabase::Create(base::ASCIIToUTF16("db"), | 48 db_ = IndexedDBDatabase::Create(base::ASCIIToUTF16("db"), |
49 backing_store_.get(), | 49 backing_store_.get(), |
50 factory_.get(), | 50 factory_.get(), |
51 IndexedDBDatabase::Identifier(), | 51 IndexedDBDatabase::Identifier(), |
52 &s); | 52 &s); |
53 ASSERT_TRUE(s.ok()); | 53 ASSERT_TRUE(s.ok()); |
54 } | 54 } |
55 | 55 |
56 void RunPostedTasks() { message_loop_.RunUntilIdle(); } | 56 void RunPostedTasks() { message_loop_.RunUntilIdle(); } |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 | 363 |
364 static const blink::WebIDBTransactionMode kTestModes[] = { | 364 static const blink::WebIDBTransactionMode kTestModes[] = { |
365 blink::WebIDBTransactionModeReadOnly, blink::WebIDBTransactionModeReadWrite, | 365 blink::WebIDBTransactionModeReadOnly, blink::WebIDBTransactionModeReadWrite, |
366 blink::WebIDBTransactionModeVersionChange}; | 366 blink::WebIDBTransactionModeVersionChange}; |
367 | 367 |
368 INSTANTIATE_TEST_CASE_P(IndexedDBTransactions, | 368 INSTANTIATE_TEST_CASE_P(IndexedDBTransactions, |
369 IndexedDBTransactionTestMode, | 369 IndexedDBTransactionTestMode, |
370 ::testing::ValuesIn(kTestModes)); | 370 ::testing::ValuesIn(kTestModes)); |
371 | 371 |
372 } // namespace content | 372 } // namespace content |
OLD | NEW |