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

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

Issue 259063004: Track which IndexedDBBackingStores have been opened since boot. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged out Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « content/browser/indexed_db/indexed_db_factory.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/browser/indexed_db/indexed_db_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698