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

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

Issue 1071553002: Optimizes the operation of DeleteDatabase when no backing store exists. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporated review comments for browser tests. Created 5 years, 8 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 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 EXPECT_EQ(0, RequestDiskUsage()); 485 EXPECT_EQ(0, RequestDiskUsage());
486 } 486 }
487 487
488 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DiskFullOnCommit) { 488 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DiskFullOnCommit) {
489 // Ignore several preceding transactions: 489 // Ignore several preceding transactions:
490 // * The test calls deleteDatabase() which opens the backing store: 490 // * The test calls deleteDatabase() which opens the backing store:
491 // #1: IndexedDBBackingStore::OpenBackingStore 491 // #1: IndexedDBBackingStore::OpenBackingStore
492 // => IndexedDBBackingStore::SetUpMetadata 492 // => IndexedDBBackingStore::SetUpMetadata
493 // #2: IndexedDBBackingStore::OpenBackingStore 493 // #2: IndexedDBBackingStore::OpenBackingStore
494 // => IndexedDBBackingStore::CleanUpBlobJournal (no-op) 494 // => IndexedDBBackingStore::CleanUpBlobJournal (no-op)
495 // * Then deletes the database: 495 // * The test calls open(), to create a new database:
496 // #3: IndexedDBFactoryImpl::DeleteDatabase 496 // #3: IndexedDBFactoryImpl::Open
497 // => IndexedDBDatabase::Create 497 // => IndexedDBDatabase::Create
498 // => IndexedDBBackingStore::CreateIDBDatabaseMetaData 498 // => IndexedDBBackingStore::CreateIDBDatabaseMetaData
499 // #4: IndexedDBFactoryImpl::DeleteDatabase 499 // #4: IndexedDBTransaction::Commit - initial "versionchange" transaction
500 // => IndexedDBDatabase::DeleteDatabase
501 // => IndexedDBBackingStore::DeleteDatabase
502 // => IndexedDBBackingStore::CleanUpBlobJournal (no-op)
503 // * The test calls open(), to create a new database:
504 // #5: IndexedDBFactoryImpl::Open
505 // => IndexedDBDatabase::Create
506 // => IndexedDBBackingStore::CreateIDBDatabaseMetaData
507 // #6: IndexedDBTransaction::Commit - initial "versionchange" transaction
508 // * Once the connection is opened, the test runs: 500 // * Once the connection is opened, the test runs:
509 // #7: IndexedDBTransaction::Commit - the test's "readwrite" transaction) 501 // #5: IndexedDBTransaction::Commit - the test's "readwrite" transaction)
510 const int instance_num = 7; 502 const int instance_num = 5;
511 const int call_num = 1; 503 const int call_num = 1;
512 FailOperation(FAIL_CLASS_LEVELDB_TRANSACTION, FAIL_METHOD_COMMIT_DISK_FULL, 504 FailOperation(FAIL_CLASS_LEVELDB_TRANSACTION, FAIL_METHOD_COMMIT_DISK_FULL,
513 instance_num, call_num); 505 instance_num, call_num);
514 SimpleTest(GetTestUrl("indexeddb", "disk_full_on_commit.html")); 506 SimpleTest(GetTestUrl("indexeddb", "disk_full_on_commit.html"));
515 } 507 }
516 508
517 namespace { 509 namespace {
518 510
519 static void CompactIndexedDBBackingStore( 511 static void CompactIndexedDBBackingStore(
520 scoped_refptr<IndexedDBContextImpl> context, 512 scoped_refptr<IndexedDBContextImpl> context,
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 command_line->AppendSwitch(switches::kSingleProcess); 831 command_line->AppendSwitch(switches::kSingleProcess);
840 } 832 }
841 }; 833 };
842 834
843 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestSingleProcess, 835 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestSingleProcess,
844 RenderThreadShutdownTest) { 836 RenderThreadShutdownTest) {
845 SimpleTest(GetTestUrl("indexeddb", "shutdown_with_requests.html")); 837 SimpleTest(GetTestUrl("indexeddb", "shutdown_with_requests.html"));
846 } 838 }
847 839
848 } // namespace content 840 } // 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