| OLD | NEW |
| 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 Loading... |
| 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 // * The test calls open(), to create a new database: | 490 // * Then deletes the database: |
| 491 // #3: IndexedDBFactoryImpl::Open | 491 // #3: IndexedDBFactoryImpl::DeleteDatabase |
| 492 // => IndexedDBDatabase::Create | 492 // => IndexedDBDatabase::Create |
| 493 // => IndexedDBBackingStore::CreateIDBDatabaseMetaData | 493 // => IndexedDBBackingStore::CreateIDBDatabaseMetaData |
| 494 // #4: IndexedDBTransaction::Commit - initial "versionchange" transaction | 494 // #4: IndexedDBFactoryImpl::DeleteDatabase |
| 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 |
| 495 // * Once the connection is opened, the test runs: | 503 // * Once the connection is opened, the test runs: |
| 496 // #5: IndexedDBTransaction::Commit - the test's "readwrite" transaction) | 504 // #7: IndexedDBTransaction::Commit - the test's "readwrite" transaction) |
| 497 const int instance_num = 5; | 505 const int instance_num = 7; |
| 498 const int call_num = 1; | 506 const int call_num = 1; |
| 499 FailOperation(FAIL_CLASS_LEVELDB_TRANSACTION, FAIL_METHOD_COMMIT_DISK_FULL, | 507 FailOperation(FAIL_CLASS_LEVELDB_TRANSACTION, FAIL_METHOD_COMMIT_DISK_FULL, |
| 500 instance_num, call_num); | 508 instance_num, call_num); |
| 501 SimpleTest(GetTestUrl("indexeddb", "disk_full_on_commit.html")); | 509 SimpleTest(GetTestUrl("indexeddb", "disk_full_on_commit.html")); |
| 502 } | 510 } |
| 503 | 511 |
| 504 namespace { | 512 namespace { |
| 505 | 513 |
| 506 static void CompactIndexedDBBackingStore( | 514 static void CompactIndexedDBBackingStore( |
| 507 scoped_refptr<IndexedDBContextImpl> context, | 515 scoped_refptr<IndexedDBContextImpl> context, |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 834 command_line->AppendSwitch(switches::kSingleProcess); | 842 command_line->AppendSwitch(switches::kSingleProcess); |
| 835 } | 843 } |
| 836 }; | 844 }; |
| 837 | 845 |
| 838 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestSingleProcess, | 846 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestSingleProcess, |
| 839 RenderThreadShutdownTest) { | 847 RenderThreadShutdownTest) { |
| 840 SimpleTest(GetTestUrl("indexeddb", "shutdown_with_requests.html")); | 848 SimpleTest(GetTestUrl("indexeddb", "shutdown_with_requests.html")); |
| 841 } | 849 } |
| 842 | 850 |
| 843 } // namespace content | 851 } // namespace content |
| OLD | NEW |