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