| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 // 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 // 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 |
| 48 leveldb::Status s; | 48 leveldb::Status s; |
| 49 db_ = IndexedDBDatabase::Create(base::ASCIIToUTF16("db"), | 49 db_ = IndexedDBDatabase::Create(base::ASCIIToUTF16("db"), |
| 50 backing_store_.get(), | 50 backing_store_.get(), |
| 51 factory_.get(), | 51 factory_.get(), |
| 52 IndexedDBDatabase::Identifier(), | 52 IndexedDBDatabase::Identifier(), |
| 53 &s); | 53 &s); |
| 54 ASSERT_TRUE(s.ok()); | 54 ASSERT_TRUE(s.ok()); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void RunPostedTasks() { message_loop_.RunUntilIdle(); } | 57 void RunPostedTasks() { base::RunLoop().RunUntilIdle(); } |
| 58 void DummyOperation(IndexedDBTransaction* transaction) {} | 58 void DummyOperation(IndexedDBTransaction* transaction) {} |
| 59 void AbortableOperation(AbortObserver* observer, | 59 void AbortableOperation(AbortObserver* observer, |
| 60 IndexedDBTransaction* transaction) { | 60 IndexedDBTransaction* transaction) { |
| 61 transaction->ScheduleAbortTask( | 61 transaction->ScheduleAbortTask( |
| 62 base::Bind(&AbortObserver::AbortTask, base::Unretained(observer))); | 62 base::Bind(&AbortObserver::AbortTask, base::Unretained(observer))); |
| 63 } | 63 } |
| 64 | 64 |
| 65 protected: | 65 protected: |
| 66 scoped_refptr<IndexedDBFakeBackingStore> backing_store_; | 66 scoped_refptr<IndexedDBFakeBackingStore> backing_store_; |
| 67 scoped_refptr<IndexedDBDatabase> db_; | 67 scoped_refptr<IndexedDBDatabase> db_; |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 | 364 |
| 365 static const blink::WebIDBTransactionMode kTestModes[] = { | 365 static const blink::WebIDBTransactionMode kTestModes[] = { |
| 366 blink::WebIDBTransactionModeReadOnly, blink::WebIDBTransactionModeReadWrite, | 366 blink::WebIDBTransactionModeReadOnly, blink::WebIDBTransactionModeReadWrite, |
| 367 blink::WebIDBTransactionModeVersionChange}; | 367 blink::WebIDBTransactionModeVersionChange}; |
| 368 | 368 |
| 369 INSTANTIATE_TEST_CASE_P(IndexedDBTransactions, | 369 INSTANTIATE_TEST_CASE_P(IndexedDBTransactions, |
| 370 IndexedDBTransactionTestMode, | 370 IndexedDBTransactionTestMode, |
| 371 ::testing::ValuesIn(kTestModes)); | 371 ::testing::ValuesIn(kTestModes)); |
| 372 | 372 |
| 373 } // namespace content | 373 } // namespace content |
| OLD | NEW |