OLD | NEW |
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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 int64_t database_id_; | 175 int64_t database_id_; |
176 std::vector<Transaction::WriteDescriptor> writes_; | 176 std::vector<Transaction::WriteDescriptor> writes_; |
177 | 177 |
178 // This is modified in an overridden virtual function that is properly const | 178 // This is modified in an overridden virtual function that is properly const |
179 // in the real implementation, therefore must be mutable here. | 179 // in the real implementation, therefore must be mutable here. |
180 mutable std::vector<int64_t> removals_; | 180 mutable std::vector<int64_t> removals_; |
181 | 181 |
182 DISALLOW_COPY_AND_ASSIGN(TestableIndexedDBBackingStore); | 182 DISALLOW_COPY_AND_ASSIGN(TestableIndexedDBBackingStore); |
183 }; | 183 }; |
184 | 184 |
| 185 #ifdef CJM_DATA_PATH |
| 186 // Using IndexedDBContext instead of IndexedDBContextImpl now hides data_path(). |
| 187 |
185 class TestIDBFactory : public IndexedDBFactoryImpl { | 188 class TestIDBFactory : public IndexedDBFactoryImpl { |
186 public: | 189 public: |
187 explicit TestIDBFactory(IndexedDBContextImpl* idb_context) | 190 explicit TestIDBFactory(IndexedDBContextImpl* idb_context) |
188 : IndexedDBFactoryImpl(idb_context) {} | 191 : IndexedDBFactoryImpl(idb_context) {} |
189 | 192 |
190 scoped_refptr<TestableIndexedDBBackingStore> OpenBackingStoreForTest( | 193 scoped_refptr<TestableIndexedDBBackingStore> OpenBackingStoreForTest( |
191 const Origin& origin, | 194 const Origin& origin, |
192 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter) { | 195 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter) { |
193 IndexedDBDataLossInfo data_loss_info; | 196 IndexedDBDataLossInfo data_loss_info; |
194 bool disk_full; | 197 bool disk_full; |
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1047 | 1050 |
1048 s = backing_store_->CreateIDBDatabaseMetaData(db2_name, db2_version, &db2_id); | 1051 s = backing_store_->CreateIDBDatabaseMetaData(db2_name, db2_version, &db2_id); |
1049 EXPECT_TRUE(s.ok()); | 1052 EXPECT_TRUE(s.ok()); |
1050 EXPECT_GT(db2_id, db1_id); | 1053 EXPECT_GT(db2_id, db1_id); |
1051 | 1054 |
1052 std::vector<base::string16> names = backing_store_->GetDatabaseNames(&s); | 1055 std::vector<base::string16> names = backing_store_->GetDatabaseNames(&s); |
1053 EXPECT_TRUE(s.ok()); | 1056 EXPECT_TRUE(s.ok()); |
1054 EXPECT_EQ(names.size(), 1ULL); | 1057 EXPECT_EQ(names.size(), 1ULL); |
1055 EXPECT_EQ(names[0], db1_name); | 1058 EXPECT_EQ(names[0], db1_name); |
1056 } | 1059 } |
| 1060 #endif |
1057 | 1061 |
1058 } // namespace | 1062 } // namespace |
1059 | 1063 |
1060 } // namespace content | 1064 } // namespace content |
OLD | NEW |