| 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 "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 namespace { | 17 namespace { |
| 18 | 18 |
| 19 class IndexedDBTransactionTest : public testing::Test { | 19 class IndexedDBTransactionTest : public testing::Test { |
| 20 public: | 20 public: |
| 21 IndexedDBTransactionTest() { | 21 IndexedDBTransactionTest() { |
| 22 IndexedDBFactory* factory = NULL; | 22 IndexedDBFactory* factory = NULL; |
| 23 backing_store_ = new IndexedDBFakeBackingStore(); | 23 backing_store_ = new IndexedDBFakeBackingStore(); |
| 24 db_ = IndexedDBDatabase::Create(ASCIIToUTF16("db"), | 24 db_ = IndexedDBDatabase::Create(base::ASCIIToUTF16("db"), |
| 25 backing_store_, | 25 backing_store_, |
| 26 factory, | 26 factory, |
| 27 IndexedDBDatabase::Identifier()); | 27 IndexedDBDatabase::Identifier()); |
| 28 } | 28 } |
| 29 | 29 |
| 30 void RunPostedTasks() { message_loop_.RunUntilIdle(); } | 30 void RunPostedTasks() { message_loop_.RunUntilIdle(); } |
| 31 void DummyOperation(IndexedDBTransaction* transaction) {} | 31 void DummyOperation(IndexedDBTransaction* transaction) {} |
| 32 | 32 |
| 33 protected: | 33 protected: |
| 34 scoped_refptr<IndexedDBFakeBackingStore> backing_store_; | 34 scoped_refptr<IndexedDBFakeBackingStore> backing_store_; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 base::MessageLoop::current()->RunUntilIdle(); | 116 base::MessageLoop::current()->RunUntilIdle(); |
| 117 | 117 |
| 118 EXPECT_FALSE(observer.abort_task_called()); | 118 EXPECT_FALSE(observer.abort_task_called()); |
| 119 transaction->Commit(); | 119 transaction->Commit(); |
| 120 EXPECT_TRUE(observer.abort_task_called()); | 120 EXPECT_TRUE(observer.abort_task_called()); |
| 121 } | 121 } |
| 122 | 122 |
| 123 } // namespace | 123 } // namespace |
| 124 | 124 |
| 125 } // namespace content | 125 } // namespace content |
| OLD | NEW |