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

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

Issue 1224533004: Revert of Revert of Reland: Optimizes IndexedDB's DeleteDatabase when no db exists (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « no previous file | content/browser/indexed_db/indexed_db_factory_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/files/file.h" 7 #include "base/files/file.h"
8 #include "base/files/file_enumerator.h" 8 #include "base/files/file_enumerator.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 EXPECT_EQ(0, RequestDiskUsage()); 480 EXPECT_EQ(0, RequestDiskUsage());
481 } 481 }
482 482
483 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DiskFullOnCommit) { 483 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DiskFullOnCommit) {
484 // Ignore several preceding transactions: 484 // Ignore several preceding transactions:
485 // * The test calls deleteDatabase() which opens the backing store: 485 // * The test calls deleteDatabase() which opens the backing store:
486 // #1: IndexedDBBackingStore::OpenBackingStore 486 // #1: IndexedDBBackingStore::OpenBackingStore
487 // => IndexedDBBackingStore::SetUpMetadata 487 // => IndexedDBBackingStore::SetUpMetadata
488 // #2: IndexedDBBackingStore::OpenBackingStore 488 // #2: IndexedDBBackingStore::OpenBackingStore
489 // => IndexedDBBackingStore::CleanUpBlobJournal (no-op) 489 // => IndexedDBBackingStore::CleanUpBlobJournal (no-op)
490 // * Then deletes the database: 490 // * The test calls open(), to create a new database:
491 // #3: IndexedDBFactoryImpl::DeleteDatabase 491 // #3: IndexedDBFactoryImpl::Open
492 // => IndexedDBDatabase::Create 492 // => IndexedDBDatabase::Create
493 // => IndexedDBBackingStore::CreateIDBDatabaseMetaData 493 // => IndexedDBBackingStore::CreateIDBDatabaseMetaData
494 // #4: IndexedDBFactoryImpl::DeleteDatabase 494 // #4: IndexedDBTransaction::Commit - initial "versionchange" transaction
495 // => IndexedDBDatabase::DeleteDatabase
496 // => IndexedDBBackingStore::DeleteDatabase
497 // => IndexedDBBackingStore::CleanUpBlobJournal (no-op)
498 // * The test calls open(), to create a new database:
499 // #5: IndexedDBFactoryImpl::Open
500 // => IndexedDBDatabase::Create
501 // => IndexedDBBackingStore::CreateIDBDatabaseMetaData
502 // #6: IndexedDBTransaction::Commit - initial "versionchange" transaction
503 // * Once the connection is opened, the test runs: 495 // * Once the connection is opened, the test runs:
504 // #7: IndexedDBTransaction::Commit - the test's "readwrite" transaction) 496 // #5: IndexedDBTransaction::Commit - the test's "readwrite" transaction)
505 const int instance_num = 7; 497 const int instance_num = 5;
506 const int call_num = 1; 498 const int call_num = 1;
507 FailOperation(FAIL_CLASS_LEVELDB_TRANSACTION, FAIL_METHOD_COMMIT_DISK_FULL, 499 FailOperation(FAIL_CLASS_LEVELDB_TRANSACTION, FAIL_METHOD_COMMIT_DISK_FULL,
508 instance_num, call_num); 500 instance_num, call_num);
509 SimpleTest(GetTestUrl("indexeddb", "disk_full_on_commit.html")); 501 SimpleTest(GetTestUrl("indexeddb", "disk_full_on_commit.html"));
510 } 502 }
511 503
512 namespace { 504 namespace {
513 505
514 static void CompactIndexedDBBackingStore( 506 static void CompactIndexedDBBackingStore(
515 scoped_refptr<IndexedDBContextImpl> context, 507 scoped_refptr<IndexedDBContextImpl> context,
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 command_line->AppendSwitch(switches::kSingleProcess); 834 command_line->AppendSwitch(switches::kSingleProcess);
843 } 835 }
844 }; 836 };
845 837
846 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestSingleProcess, 838 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestSingleProcess,
847 RenderThreadShutdownTest) { 839 RenderThreadShutdownTest) {
848 SimpleTest(GetTestUrl("indexeddb", "shutdown_with_requests.html")); 840 SimpleTest(GetTestUrl("indexeddb", "shutdown_with_requests.html"));
849 } 841 }
850 842
851 } // namespace content 843 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/indexed_db/indexed_db_factory_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698