| 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_factory.h" | 5 #include "content/browser/indexed_db/indexed_db_factory.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 }; | 210 }; |
| 211 | 211 |
| 212 TEST_F(IndexedDBFactoryTest, QuotaErrorOnDiskFull) { | 212 TEST_F(IndexedDBFactoryTest, QuotaErrorOnDiskFull) { |
| 213 const GURL origin("http://localhost:81"); | 213 const GURL origin("http://localhost:81"); |
| 214 | 214 |
| 215 scoped_refptr<DiskFullFactory> factory = new DiskFullFactory; | 215 scoped_refptr<DiskFullFactory> factory = new DiskFullFactory; |
| 216 scoped_refptr<LookingForQuotaErrorMockCallbacks> callbacks = | 216 scoped_refptr<LookingForQuotaErrorMockCallbacks> callbacks = |
| 217 new LookingForQuotaErrorMockCallbacks; | 217 new LookingForQuotaErrorMockCallbacks; |
| 218 scoped_refptr<IndexedDBDatabaseCallbacks> dummy_database_callbacks = | 218 scoped_refptr<IndexedDBDatabaseCallbacks> dummy_database_callbacks = |
| 219 new IndexedDBDatabaseCallbacks(NULL, 0, 0); | 219 new IndexedDBDatabaseCallbacks(NULL, 0, 0); |
| 220 const string16 name(ASCIIToUTF16("name")); | 220 const base::string16 name(ASCIIToUTF16("name")); |
| 221 factory->Open(name, | 221 factory->Open(name, |
| 222 1, /* version */ | 222 1, /* version */ |
| 223 2, /* transaction_id */ | 223 2, /* transaction_id */ |
| 224 callbacks, | 224 callbacks, |
| 225 dummy_database_callbacks, | 225 dummy_database_callbacks, |
| 226 origin, | 226 origin, |
| 227 base::FilePath(FILE_PATH_LITERAL("/dummy"))); | 227 base::FilePath(FILE_PATH_LITERAL("/dummy"))); |
| 228 } | 228 } |
| 229 | 229 |
| 230 TEST_F(IndexedDBFactoryTest, BackingStoreReleasedOnForcedClose) { | 230 TEST_F(IndexedDBFactoryTest, BackingStoreReleasedOnForcedClose) { |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 // Now simulate shutdown, which should stop the timer. | 290 // Now simulate shutdown, which should stop the timer. |
| 291 factory->ContextDestroyed(); | 291 factory->ContextDestroyed(); |
| 292 EXPECT_TRUE(store->HasOneRef()); // Local. | 292 EXPECT_TRUE(store->HasOneRef()); // Local. |
| 293 EXPECT_FALSE(store->close_timer()->IsRunning()); | 293 EXPECT_FALSE(store->close_timer()->IsRunning()); |
| 294 EXPECT_FALSE(factory->IsBackingStoreOpenForTesting(origin)); | 294 EXPECT_FALSE(factory->IsBackingStoreOpenForTesting(origin)); |
| 295 } | 295 } |
| 296 | 296 |
| 297 } // namespace | 297 } // namespace |
| 298 | 298 |
| 299 } // namespace content | 299 } // namespace content |
| OLD | NEW |