| 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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 GURL origin("http://localhost:81"); | 357 GURL origin("http://localhost:81"); |
| 358 | 358 |
| 359 base::ScopedTempDir temp_directory; | 359 base::ScopedTempDir temp_directory; |
| 360 ASSERT_TRUE(temp_directory.CreateUniqueTempDir()); | 360 ASSERT_TRUE(temp_directory.CreateUniqueTempDir()); |
| 361 | 361 |
| 362 EXPECT_FALSE(factory()->IsBackingStoreOpen(origin)); | 362 EXPECT_FALSE(factory()->IsBackingStoreOpen(origin)); |
| 363 | 363 |
| 364 const bool expect_connection = false; | 364 const bool expect_connection = false; |
| 365 scoped_refptr<MockIndexedDBCallbacks> callbacks( | 365 scoped_refptr<MockIndexedDBCallbacks> callbacks( |
| 366 new MockIndexedDBCallbacks(expect_connection)); | 366 new MockIndexedDBCallbacks(expect_connection)); |
| 367 factory()->GetDatabaseNames(callbacks, origin, temp_directory.path()); | 367 factory()->GetDatabaseNames( |
| 368 callbacks, origin, temp_directory.path(), NULL /* request_context */); |
| 368 | 369 |
| 369 EXPECT_TRUE(factory()->IsBackingStoreOpen(origin)); | 370 EXPECT_TRUE(factory()->IsBackingStoreOpen(origin)); |
| 370 EXPECT_TRUE(factory()->IsBackingStorePendingClose(origin)); | 371 EXPECT_TRUE(factory()->IsBackingStorePendingClose(origin)); |
| 371 | 372 |
| 372 // Now simulate shutdown, which should stop the timer. | 373 // Now simulate shutdown, which should stop the timer. |
| 373 factory()->ContextDestroyed(); | 374 factory()->ContextDestroyed(); |
| 374 | 375 |
| 375 EXPECT_FALSE(factory()->IsBackingStoreOpen(origin)); | 376 EXPECT_FALSE(factory()->IsBackingStoreOpen(origin)); |
| 376 EXPECT_FALSE(factory()->IsBackingStorePendingClose(origin)); | 377 EXPECT_FALSE(factory()->IsBackingStorePendingClose(origin)); |
| 377 } | 378 } |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 origin, | 503 origin, |
| 503 temp_directory.path()); | 504 temp_directory.path()); |
| 504 EXPECT_FALSE(factory()->IsDatabaseOpen(origin, db_name)); | 505 EXPECT_FALSE(factory()->IsDatabaseOpen(origin, db_name)); |
| 505 } | 506 } |
| 506 | 507 |
| 507 // Terminate all pending-close timers. | 508 // Terminate all pending-close timers. |
| 508 factory()->ForceClose(origin); | 509 factory()->ForceClose(origin); |
| 509 } | 510 } |
| 510 | 511 |
| 511 } // namespace content | 512 } // namespace content |
| OLD | NEW |