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

Side by Side Diff: content/browser/quota/quota_manager_unittest.cc

Issue 2316043002: //content: Change ScopedTempDir::path() to GetPath() (Closed)
Patch Set: Just rebased Created 4 years, 3 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
OLDNEW
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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 } 116 }
117 117
118 void TearDown() override { 118 void TearDown() override {
119 // Make sure the quota manager cleans up correctly. 119 // Make sure the quota manager cleans up correctly.
120 quota_manager_ = NULL; 120 quota_manager_ = NULL;
121 base::RunLoop().RunUntilIdle(); 121 base::RunLoop().RunUntilIdle();
122 } 122 }
123 123
124 protected: 124 protected:
125 void ResetQuotaManager(bool is_incognito) { 125 void ResetQuotaManager(bool is_incognito) {
126 quota_manager_ = new QuotaManager(is_incognito, data_dir_.path(), 126 quota_manager_ = new QuotaManager(is_incognito, data_dir_.GetPath(),
127 base::ThreadTaskRunnerHandle::Get().get(), 127 base::ThreadTaskRunnerHandle::Get().get(),
128 base::ThreadTaskRunnerHandle::Get().get(), 128 base::ThreadTaskRunnerHandle::Get().get(),
129 mock_special_storage_policy_.get()); 129 mock_special_storage_policy_.get());
130 // Don't (automatically) start the eviction for testing. 130 // Don't (automatically) start the eviction for testing.
131 quota_manager_->eviction_disabled_ = true; 131 quota_manager_->eviction_disabled_ = true;
132 // Don't query the hard disk for remaining capacity. 132 // Don't query the hard disk for remaining capacity.
133 quota_manager_->get_volume_info_fn_= &GetVolumeInfoForTests; 133 quota_manager_->get_volume_info_fn_= &GetVolumeInfoForTests;
134 additional_callback_count_ = 0; 134 additional_callback_count_ = 0;
135 } 135 }
136 136
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 int64_t unlimited_usage() const { return unlimited_usage_; } 446 int64_t unlimited_usage() const { return unlimited_usage_; }
447 int64_t quota() const { return quota_; } 447 int64_t quota() const { return quota_; }
448 int64_t available_space() const { return available_space_; } 448 int64_t available_space() const { return available_space_; }
449 const GURL& eviction_origin() const { return eviction_origin_; } 449 const GURL& eviction_origin() const { return eviction_origin_; }
450 const std::set<GURL>& modified_origins() const { return modified_origins_; } 450 const std::set<GURL>& modified_origins() const { return modified_origins_; }
451 StorageType modified_origins_type() const { return modified_origins_type_; } 451 StorageType modified_origins_type() const { return modified_origins_type_; }
452 const QuotaTableEntries& quota_entries() const { return quota_entries_; } 452 const QuotaTableEntries& quota_entries() const { return quota_entries_; }
453 const OriginInfoTableEntries& origin_info_entries() const { 453 const OriginInfoTableEntries& origin_info_entries() const {
454 return origin_info_entries_; 454 return origin_info_entries_;
455 } 455 }
456 base::FilePath profile_path() const { return data_dir_.path(); } 456 base::FilePath profile_path() const { return data_dir_.GetPath(); }
457 int status_callback_count() const { return status_callback_count_; } 457 int status_callback_count() const { return status_callback_count_; }
458 void reset_status_callback_count() { status_callback_count_ = 0; } 458 void reset_status_callback_count() { status_callback_count_ = 0; }
459 459
460 private: 460 private:
461 base::Time IncrementMockTime() { 461 base::Time IncrementMockTime() {
462 ++mock_time_counter_; 462 ++mock_time_counter_;
463 return base::Time::FromDoubleT(mock_time_counter_ * 10.0); 463 return base::Time::FromDoubleT(mock_time_counter_ * 10.0);
464 } 464 }
465 465
466 base::MessageLoop message_loop_; 466 base::MessageLoop message_loop_;
(...skipping 1835 matching lines...) Expand 10 before | Expand all | Expand 10 after
2302 base::FilePath tmp_dir; 2302 base::FilePath tmp_dir;
2303 ASSERT_TRUE(base::GetTempDir(&tmp_dir)); 2303 ASSERT_TRUE(base::GetTempDir(&tmp_dir));
2304 uint64_t available_space = 0; 2304 uint64_t available_space = 0;
2305 uint64_t total_size = 0; 2305 uint64_t total_size = 0;
2306 EXPECT_TRUE(GetVolumeInfo(tmp_dir, &available_space, &total_size)); 2306 EXPECT_TRUE(GetVolumeInfo(tmp_dir, &available_space, &total_size));
2307 EXPECT_GT(available_space, 0u) << tmp_dir.value(); 2307 EXPECT_GT(available_space, 0u) << tmp_dir.value();
2308 EXPECT_GT(total_size, 0u) << tmp_dir.value(); 2308 EXPECT_GT(total_size, 0u) << tmp_dir.value();
2309 } 2309 }
2310 2310
2311 } // namespace content 2311 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/quota/quota_database_unittest.cc ('k') | content/browser/quota/quota_reservation_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698