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

Side by Side Diff: webkit/quota/quota_manager_unittest.cc

Issue 12163003: Add FilePath to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « webkit/quota/quota_manager.cc ('k') | webkit/support/platform_support_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <set> 5 #include <set>
6 #include <sstream> 6 #include <sstream>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 17 matching lines...) Expand all
28 namespace quota { 28 namespace quota {
29 29
30 // For shorter names. 30 // For shorter names.
31 const StorageType kTemp = kStorageTypeTemporary; 31 const StorageType kTemp = kStorageTypeTemporary;
32 const StorageType kPerm = kStorageTypePersistent; 32 const StorageType kPerm = kStorageTypePersistent;
33 const StorageType kSync = kStorageTypeSyncable; 33 const StorageType kSync = kStorageTypeSyncable;
34 34
35 const int kAllClients = QuotaClient::kAllClientsMask; 35 const int kAllClients = QuotaClient::kAllClientsMask;
36 36
37 // Returns a deterministic value for the amount of available disk space. 37 // Returns a deterministic value for the amount of available disk space.
38 int64 GetAvailableDiskSpaceForTest(const FilePath&) { 38 int64 GetAvailableDiskSpaceForTest(const base::FilePath&) {
39 return 13377331; 39 return 13377331;
40 } 40 }
41 41
42 class QuotaManagerTest : public testing::Test { 42 class QuotaManagerTest : public testing::Test {
43 protected: 43 protected:
44 typedef QuotaManager::QuotaTableEntry QuotaTableEntry; 44 typedef QuotaManager::QuotaTableEntry QuotaTableEntry;
45 typedef QuotaManager::QuotaTableEntries QuotaTableEntries; 45 typedef QuotaManager::QuotaTableEntries QuotaTableEntries;
46 typedef QuotaManager::OriginInfoTableEntries OriginInfoTableEntries; 46 typedef QuotaManager::OriginInfoTableEntries OriginInfoTableEntries;
47 47
48 public: 48 public:
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 int64 unlimited_usage() const { return unlimited_usage_; } 386 int64 unlimited_usage() const { return unlimited_usage_; }
387 int64 quota() const { return quota_; } 387 int64 quota() const { return quota_; }
388 int64 available_space() const { return available_space_; } 388 int64 available_space() const { return available_space_; }
389 const GURL& lru_origin() const { return lru_origin_; } 389 const GURL& lru_origin() const { return lru_origin_; }
390 const std::set<GURL>& modified_origins() const { return modified_origins_; } 390 const std::set<GURL>& modified_origins() const { return modified_origins_; }
391 StorageType modified_origins_type() const { return modified_origins_type_; } 391 StorageType modified_origins_type() const { return modified_origins_type_; }
392 const QuotaTableEntries& quota_entries() const { return quota_entries_; } 392 const QuotaTableEntries& quota_entries() const { return quota_entries_; }
393 const OriginInfoTableEntries& origin_info_entries() const { 393 const OriginInfoTableEntries& origin_info_entries() const {
394 return origin_info_entries_; 394 return origin_info_entries_;
395 } 395 }
396 FilePath profile_path() const { return data_dir_.path(); } 396 base::FilePath profile_path() const { return data_dir_.path(); }
397 int status_callback_count() const { return status_callback_count_; } 397 int status_callback_count() const { return status_callback_count_; }
398 void reset_status_callback_count() { status_callback_count_ = 0; } 398 void reset_status_callback_count() { status_callback_count_ = 0; }
399 399
400 private: 400 private:
401 base::Time IncrementMockTime() { 401 base::Time IncrementMockTime() {
402 ++mock_time_counter_; 402 ++mock_time_counter_;
403 return base::Time::FromDoubleT(mock_time_counter_ * 10.0); 403 return base::Time::FromDoubleT(mock_time_counter_ * 10.0);
404 } 404 }
405 405
406 MessageLoop message_loop_; 406 MessageLoop message_loop_;
(...skipping 1639 matching lines...) Expand 10 before | Expand all | Expand 10 after
2046 EXPECT_EQ(predelete_foo_tmp - 2 - 1, usage()); 2046 EXPECT_EQ(predelete_foo_tmp - 2 - 1, usage());
2047 2047
2048 DeleteHostData("foo.com", kTemp, 2048 DeleteHostData("foo.com", kTemp,
2049 QuotaClient::kDatabase | QuotaClient::kIndexedDatabase); 2049 QuotaClient::kDatabase | QuotaClient::kIndexedDatabase);
2050 MessageLoop::current()->RunUntilIdle(); 2050 MessageLoop::current()->RunUntilIdle();
2051 GetHostUsage("foo.com", kTemp); 2051 GetHostUsage("foo.com", kTemp);
2052 MessageLoop::current()->RunUntilIdle(); 2052 MessageLoop::current()->RunUntilIdle();
2053 EXPECT_EQ(predelete_foo_tmp - 8 - 4 - 2 - 1, usage()); 2053 EXPECT_EQ(predelete_foo_tmp - 8 - 4 - 2 - 1, usage());
2054 } 2054 }
2055 } // namespace quota 2055 } // namespace quota
OLDNEW
« no previous file with comments | « webkit/quota/quota_manager.cc ('k') | webkit/support/platform_support_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698