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

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

Issue 2370643004: Port messages sent by WebIDBFactoryImpl to Mojo. (Closed)
Patch Set: Address last nits and fix leaks in unit tests. Created 4 years, 2 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 <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"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/message_loop/message_loop.h"
13 #include "base/run_loop.h" 12 #include "base/run_loop.h"
14 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
15 #include "content/browser/indexed_db/indexed_db_connection.h" 14 #include "content/browser/indexed_db/indexed_db_connection.h"
16 #include "content/browser/indexed_db/indexed_db_fake_backing_store.h" 15 #include "content/browser/indexed_db/indexed_db_fake_backing_store.h"
17 #include "content/browser/indexed_db/indexed_db_observer.h" 16 #include "content/browser/indexed_db/indexed_db_observer.h"
18 #include "content/browser/indexed_db/mock_indexed_db_database_callbacks.h" 17 #include "content/browser/indexed_db/mock_indexed_db_database_callbacks.h"
19 #include "content/browser/indexed_db/mock_indexed_db_factory.h" 18 #include "content/browser/indexed_db/mock_indexed_db_factory.h"
19 #include "content/public/test/test_browser_thread_bundle.h"
20 #include "testing/gtest/include/gtest/gtest.h" 20 #include "testing/gtest/include/gtest/gtest.h"
21 21
22 namespace content { 22 namespace content {
23 23
24 class AbortObserver { 24 class AbortObserver {
25 public: 25 public:
26 AbortObserver() : abort_task_called_(false) {} 26 AbortObserver() : abort_task_called_(false) {}
27 27
28 void AbortTask(IndexedDBTransaction* transaction) { 28 void AbortTask(IndexedDBTransaction* transaction) {
29 abort_task_called_ = true; 29 abort_task_called_ = true;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 IndexedDBTransaction* transaction) { 62 IndexedDBTransaction* transaction) {
63 transaction->ScheduleAbortTask( 63 transaction->ScheduleAbortTask(
64 base::Bind(&AbortObserver::AbortTask, base::Unretained(observer))); 64 base::Bind(&AbortObserver::AbortTask, base::Unretained(observer)));
65 } 65 }
66 66
67 protected: 67 protected:
68 scoped_refptr<IndexedDBFakeBackingStore> backing_store_; 68 scoped_refptr<IndexedDBFakeBackingStore> backing_store_;
69 scoped_refptr<IndexedDBDatabase> db_; 69 scoped_refptr<IndexedDBDatabase> db_;
70 70
71 private: 71 private:
72 base::MessageLoop message_loop_;
73 scoped_refptr<MockIndexedDBFactory> factory_; 72 scoped_refptr<MockIndexedDBFactory> factory_;
73 TestBrowserThreadBundle thread_bundle_;
74 74
75 DISALLOW_COPY_AND_ASSIGN(IndexedDBTransactionTest); 75 DISALLOW_COPY_AND_ASSIGN(IndexedDBTransactionTest);
76 }; 76 };
77 77
78 class IndexedDBTransactionTestMode 78 class IndexedDBTransactionTestMode
79 : public IndexedDBTransactionTest, 79 : public IndexedDBTransactionTest,
80 public testing::WithParamInterface<blink::WebIDBTransactionMode> { 80 public testing::WithParamInterface<blink::WebIDBTransactionMode> {
81 public: 81 public:
82 IndexedDBTransactionTestMode() {} 82 IndexedDBTransactionTestMode() {}
83 private: 83 private:
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 407
408 static const blink::WebIDBTransactionMode kTestModes[] = { 408 static const blink::WebIDBTransactionMode kTestModes[] = {
409 blink::WebIDBTransactionModeReadOnly, blink::WebIDBTransactionModeReadWrite, 409 blink::WebIDBTransactionModeReadOnly, blink::WebIDBTransactionModeReadWrite,
410 blink::WebIDBTransactionModeVersionChange}; 410 blink::WebIDBTransactionModeVersionChange};
411 411
412 INSTANTIATE_TEST_CASE_P(IndexedDBTransactions, 412 INSTANTIATE_TEST_CASE_P(IndexedDBTransactions,
413 IndexedDBTransactionTestMode, 413 IndexedDBTransactionTestMode,
414 ::testing::ValuesIn(kTestModes)); 414 ::testing::ValuesIn(kTestModes));
415 415
416 } // namespace content 416 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/indexed_db/indexed_db_metadata.cc ('k') | content/browser/indexed_db/mock_indexed_db_database_callbacks.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698