| 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/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
| 7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 base::FilePath origin2_db_dir; | 560 base::FilePath origin2_db_dir; |
| 561 { | 561 { |
| 562 scoped_refptr<quota::MockSpecialStoragePolicy> special_storage_policy = | 562 scoped_refptr<quota::MockSpecialStoragePolicy> special_storage_policy = |
| 563 new quota::MockSpecialStoragePolicy; | 563 new quota::MockSpecialStoragePolicy; |
| 564 special_storage_policy->AddSessionOnly(GURL(kOrigin2Url)); | 564 special_storage_policy->AddSessionOnly(GURL(kOrigin2Url)); |
| 565 scoped_refptr<DatabaseTracker> tracker( | 565 scoped_refptr<DatabaseTracker> tracker( |
| 566 new DatabaseTracker(temp_dir.path(), | 566 new DatabaseTracker(temp_dir.path(), |
| 567 false, | 567 false, |
| 568 special_storage_policy.get(), | 568 special_storage_policy.get(), |
| 569 NULL, | 569 NULL, |
| 570 base::MessageLoopProxy::current())); | 570 base::MessageLoopProxy::current().get())); |
| 571 | 571 |
| 572 // Open two new databases. | 572 // Open two new databases. |
| 573 tracker->DatabaseOpened(kOrigin1, kDB1, kDescription, 0, | 573 tracker->DatabaseOpened(kOrigin1, kDB1, kDescription, 0, |
| 574 &database_size); | 574 &database_size); |
| 575 EXPECT_EQ(0, database_size); | 575 EXPECT_EQ(0, database_size); |
| 576 tracker->DatabaseOpened(kOrigin2, kDB2, kDescription, 0, | 576 tracker->DatabaseOpened(kOrigin2, kDB2, kDescription, 0, |
| 577 &database_size); | 577 &database_size); |
| 578 EXPECT_EQ(0, database_size); | 578 EXPECT_EQ(0, database_size); |
| 579 | 579 |
| 580 // Write some data to each file. | 580 // Write some data to each file. |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 base::FilePath origin2_db_dir; | 640 base::FilePath origin2_db_dir; |
| 641 { | 641 { |
| 642 scoped_refptr<quota::MockSpecialStoragePolicy> special_storage_policy = | 642 scoped_refptr<quota::MockSpecialStoragePolicy> special_storage_policy = |
| 643 new quota::MockSpecialStoragePolicy; | 643 new quota::MockSpecialStoragePolicy; |
| 644 special_storage_policy->AddSessionOnly(GURL(kOrigin2Url)); | 644 special_storage_policy->AddSessionOnly(GURL(kOrigin2Url)); |
| 645 scoped_refptr<DatabaseTracker> tracker( | 645 scoped_refptr<DatabaseTracker> tracker( |
| 646 new DatabaseTracker(temp_dir.path(), | 646 new DatabaseTracker(temp_dir.path(), |
| 647 false, | 647 false, |
| 648 special_storage_policy.get(), | 648 special_storage_policy.get(), |
| 649 NULL, | 649 NULL, |
| 650 base::MessageLoopProxy::current())); | 650 base::MessageLoopProxy::current().get())); |
| 651 tracker->SetForceKeepSessionState(); | 651 tracker->SetForceKeepSessionState(); |
| 652 | 652 |
| 653 // Open two new databases. | 653 // Open two new databases. |
| 654 tracker->DatabaseOpened(kOrigin1, kDB1, kDescription, 0, | 654 tracker->DatabaseOpened(kOrigin1, kDB1, kDescription, 0, |
| 655 &database_size); | 655 &database_size); |
| 656 EXPECT_EQ(0, database_size); | 656 EXPECT_EQ(0, database_size); |
| 657 tracker->DatabaseOpened(kOrigin2, kDB2, kDescription, 0, | 657 tracker->DatabaseOpened(kOrigin2, kDB2, kDescription, 0, |
| 658 &database_size); | 658 &database_size); |
| 659 EXPECT_EQ(0, database_size); | 659 EXPECT_EQ(0, database_size); |
| 660 | 660 |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 859 | 859 |
| 860 TEST(DatabaseTrackerTest, EmptyDatabaseNameIsValid) { | 860 TEST(DatabaseTrackerTest, EmptyDatabaseNameIsValid) { |
| 861 DatabaseTracker_TestHelper_Test::EmptyDatabaseNameIsValid(); | 861 DatabaseTracker_TestHelper_Test::EmptyDatabaseNameIsValid(); |
| 862 } | 862 } |
| 863 | 863 |
| 864 TEST(DatabaseTrackerTest, HandleSqliteError) { | 864 TEST(DatabaseTrackerTest, HandleSqliteError) { |
| 865 DatabaseTracker_TestHelper_Test::HandleSqliteError(); | 865 DatabaseTracker_TestHelper_Test::HandleSqliteError(); |
| 866 } | 866 } |
| 867 | 867 |
| 868 } // namespace webkit_database | 868 } // namespace webkit_database |
| OLD | NEW |