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_database.h" | 5 #include "content/browser/indexed_db/indexed_db_database.h" |
6 | 6 |
7 #include <gtest/gtest.h> | 7 #include <gtest/gtest.h> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 IndexedDBDatabaseMetadata::DEFAULT_INT_VERSION); | 130 IndexedDBDatabaseMetadata::DEFAULT_INT_VERSION); |
131 | 131 |
132 EXPECT_FALSE(backing_store->HasOneRef()); // local and connection | 132 EXPECT_FALSE(backing_store->HasOneRef()); // local and connection |
133 | 133 |
134 db->Close(connection1); | 134 db->Close(connection1); |
135 | 135 |
136 EXPECT_FALSE(backing_store->HasOneRef()); // local and connection | 136 EXPECT_FALSE(backing_store->HasOneRef()); // local and connection |
137 | 137 |
138 db->Close(connection2); | 138 db->Close(connection2); |
139 EXPECT_TRUE(backing_store->HasOneRef()); | 139 EXPECT_TRUE(backing_store->HasOneRef()); |
140 EXPECT_FALSE(db->BackingStore()); | 140 EXPECT_FALSE(db->BackingStore().get()); |
141 | 141 |
142 db = NULL; | 142 db = NULL; |
143 } | 143 } |
144 | 144 |
145 class MockIDBDatabaseCallbacks : public IndexedDBDatabaseCallbacksWrapper { | 145 class MockIDBDatabaseCallbacks : public IndexedDBDatabaseCallbacksWrapper { |
146 public: | 146 public: |
147 static scoped_refptr<MockIDBDatabaseCallbacks> Create() { | 147 static scoped_refptr<MockIDBDatabaseCallbacks> Create() { |
148 return make_scoped_refptr(new MockIDBDatabaseCallbacks()); | 148 return make_scoped_refptr(new MockIDBDatabaseCallbacks()); |
149 } | 149 } |
150 virtual void OnVersionChange(int64 old_version, int64 new_version) OVERRIDE {} | 150 virtual void OnVersionChange(int64 old_version, int64 new_version) OVERRIDE {} |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 const std::vector<int64> scope; | 191 const std::vector<int64> scope; |
192 web_database.createTransaction( | 192 web_database.createTransaction( |
193 transaction_id, 0, scope, indexed_db::TRANSACTION_READ_ONLY); | 193 transaction_id, 0, scope, indexed_db::TRANSACTION_READ_ONLY); |
194 | 194 |
195 web_database.forceClose(); | 195 web_database.forceClose(); |
196 | 196 |
197 EXPECT_TRUE(backing_store->HasOneRef()); // local | 197 EXPECT_TRUE(backing_store->HasOneRef()); // local |
198 } | 198 } |
199 | 199 |
200 } // namespace content | 200 } // namespace content |
OLD | NEW |