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

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

Issue 313883003: Split IndexedDBFactory into virtual base + impl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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_backing_store.h" 5 #include "content/browser/indexed_db/indexed_db_backing_store.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/files/scoped_temp_dir.h" 9 #include "base/files/scoped_temp_dir.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/strings/string16.h" 12 #include "base/strings/string16.h"
13 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
14 #include "base/task_runner.h" 14 #include "base/task_runner.h"
15 #include "base/test/test_simple_task_runner.h" 15 #include "base/test/test_simple_task_runner.h"
16 #include "content/browser/indexed_db/indexed_db_context_impl.h" 16 #include "content/browser/indexed_db/indexed_db_context_impl.h"
17 #include "content/browser/indexed_db/indexed_db_factory_impl.h"
17 #include "content/browser/indexed_db/indexed_db_leveldb_coding.h" 18 #include "content/browser/indexed_db/indexed_db_leveldb_coding.h"
18 #include "content/browser/indexed_db/indexed_db_value.h" 19 #include "content/browser/indexed_db/indexed_db_value.h"
19 #include "content/public/test/mock_special_storage_policy.h" 20 #include "content/public/test/mock_special_storage_policy.h"
20 #include "net/url_request/url_request_test_util.h" 21 #include "net/url_request/url_request_test_util.h"
21 #include "testing/gtest/include/gtest/gtest.h" 22 #include "testing/gtest/include/gtest/gtest.h"
22 #include "third_party/WebKit/public/platform/WebIDBTypes.h" 23 #include "third_party/WebKit/public/platform/WebIDBTypes.h"
23 #include "webkit/browser/blob/blob_data_handle.h" 24 #include "webkit/browser/blob/blob_data_handle.h"
24 #include "webkit/browser/quota/special_storage_policy.h" 25 #include "webkit/browser/quota/special_storage_policy.h"
25 26
26 using base::ASCIIToUTF16; 27 using base::ASCIIToUTF16;
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 db.Pass(), 156 db.Pass(),
156 comparator.Pass(), 157 comparator.Pass(),
157 task_runner), 158 task_runner),
158 database_id_(0) {} 159 database_id_(0) {}
159 160
160 int64 database_id_; 161 int64 database_id_;
161 std::vector<Transaction::WriteDescriptor> writes_; 162 std::vector<Transaction::WriteDescriptor> writes_;
162 std::vector<int64> removals_; 163 std::vector<int64> removals_;
163 }; 164 };
164 165
165 class TestIDBFactory : public IndexedDBFactory { 166 class TestIDBFactory : public IndexedDBFactoryImpl {
166 public: 167 public:
167 TestIDBFactory(IndexedDBContextImpl* idb_context) 168 TestIDBFactory(IndexedDBContextImpl* idb_context)
168 : IndexedDBFactory(idb_context) {} 169 : IndexedDBFactoryImpl(idb_context) {}
169 170
170 scoped_refptr<TestableIndexedDBBackingStore> OpenBackingStoreForTest( 171 scoped_refptr<TestableIndexedDBBackingStore> OpenBackingStoreForTest(
171 const GURL& origin, 172 const GURL& origin,
172 net::URLRequestContext* url_request_context) { 173 net::URLRequestContext* url_request_context) {
173 blink::WebIDBDataLoss data_loss; 174 blink::WebIDBDataLoss data_loss;
174 std::string data_loss_reason; 175 std::string data_loss_reason;
175 bool disk_full; 176 bool disk_full;
176 scoped_refptr<IndexedDBBackingStore> backing_store = 177 scoped_refptr<IndexedDBBackingStore> backing_store =
177 OpenBackingStore(origin, 178 OpenBackingStore(origin,
178 context()->data_path(), 179 context()->data_path(),
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 EXPECT_EQ(index_name, index.name); 942 EXPECT_EQ(index_name, index.name);
942 EXPECT_EQ(index_key_path, index.key_path); 943 EXPECT_EQ(index_key_path, index.key_path);
943 EXPECT_EQ(unique, index.unique); 944 EXPECT_EQ(unique, index.unique);
944 EXPECT_EQ(multi_entry, index.multi_entry); 945 EXPECT_EQ(multi_entry, index.multi_entry);
945 } 946 }
946 } 947 }
947 948
948 } // namespace 949 } // namespace
949 950
950 } // namespace content 951 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698