OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 } | 641 } |
642 | 642 |
643 // Integration test for QuotaManager and StorageMonitor: | 643 // Integration test for QuotaManager and StorageMonitor: |
644 | 644 |
645 class StorageMonitorIntegrationTest : public testing::Test { | 645 class StorageMonitorIntegrationTest : public testing::Test { |
646 public: | 646 public: |
647 void SetUp() override { | 647 void SetUp() override { |
648 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); | 648 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); |
649 storage_policy_ = new MockSpecialStoragePolicy(); | 649 storage_policy_ = new MockSpecialStoragePolicy(); |
650 quota_manager_ = new QuotaManager( | 650 quota_manager_ = new QuotaManager( |
651 false, data_dir_.path(), base::ThreadTaskRunnerHandle::Get().get(), | 651 false, data_dir_.GetPath(), base::ThreadTaskRunnerHandle::Get().get(), |
652 base::ThreadTaskRunnerHandle::Get().get(), storage_policy_.get()); | 652 base::ThreadTaskRunnerHandle::Get().get(), storage_policy_.get()); |
653 | 653 |
654 client_ = new MockStorageClient(quota_manager_->proxy(), | 654 client_ = new MockStorageClient(quota_manager_->proxy(), |
655 NULL, | 655 NULL, |
656 QuotaClient::kFileSystem, | 656 QuotaClient::kFileSystem, |
657 0); | 657 0); |
658 | 658 |
659 quota_manager_->proxy()->RegisterClient(client_); | 659 quota_manager_->proxy()->RegisterClient(client_); |
660 } | 660 } |
661 | 661 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
694 base::RunLoop().RunUntilIdle(); | 694 base::RunLoop().RunUntilIdle(); |
695 | 695 |
696 // Verify that the observer receives it. | 696 // Verify that the observer receives it. |
697 ASSERT_EQ(1, mock_observer.EventCount()); | 697 ASSERT_EQ(1, mock_observer.EventCount()); |
698 const StorageObserver::Event& event = mock_observer.LastEvent(); | 698 const StorageObserver::Event& event = mock_observer.LastEvent(); |
699 EXPECT_EQ(params.filter, event.filter); | 699 EXPECT_EQ(params.filter, event.filter); |
700 EXPECT_EQ(kTestUsage, event.usage); | 700 EXPECT_EQ(kTestUsage, event.usage); |
701 } | 701 } |
702 | 702 |
703 } // namespace content | 703 } // namespace content |
OLD | NEW |