| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 888 EXPECT_EQ(kPerm, type()); | 888 EXPECT_EQ(kPerm, type()); |
| 889 EXPECT_EQ(0, quota()); | 889 EXPECT_EQ(0, quota()); |
| 890 | 890 |
| 891 SetPersistentHostQuota("foo.com", 100); | 891 SetPersistentHostQuota("foo.com", 100); |
| 892 MessageLoop::current()->RunAllPending(); | 892 MessageLoop::current()->RunAllPending(); |
| 893 EXPECT_EQ(100, quota()); | 893 EXPECT_EQ(100, quota()); |
| 894 | 894 |
| 895 GetPersistentHostQuota("foo.com"); | 895 GetPersistentHostQuota("foo.com"); |
| 896 SetPersistentHostQuota("foo.com", 200); | 896 SetPersistentHostQuota("foo.com", 200); |
| 897 GetPersistentHostQuota("foo.com"); | 897 GetPersistentHostQuota("foo.com"); |
| 898 SetPersistentHostQuota("foo.com", 300000000000); | 898 SetPersistentHostQuota("foo.com", 300); |
| 899 GetPersistentHostQuota("foo.com"); | 899 GetPersistentHostQuota("foo.com"); |
| 900 MessageLoop::current()->RunAllPending(); | 900 MessageLoop::current()->RunAllPending(); |
| 901 EXPECT_EQ(300000000000, quota()); | 901 EXPECT_EQ(300, quota()); |
| 902 } | 902 } |
| 903 | 903 |
| 904 TEST_F(QuotaManagerTest, GetAndSetPersistentUsageAndQuota) { | 904 TEST_F(QuotaManagerTest, GetAndSetPersistentUsageAndQuota) { |
| 905 RegisterClient(CreateClient(NULL, 0)); | 905 RegisterClient(CreateClient(NULL, 0)); |
| 906 | 906 |
| 907 GetUsageAndQuota(GURL("http://foo.com/"), kPerm); | 907 GetUsageAndQuota(GURL("http://foo.com/"), kPerm); |
| 908 MessageLoop::current()->RunAllPending(); | 908 MessageLoop::current()->RunAllPending(); |
| 909 EXPECT_EQ(kQuotaStatusOk, status()); | 909 EXPECT_EQ(kQuotaStatusOk, status()); |
| 910 EXPECT_EQ(0, usage()); | 910 EXPECT_EQ(0, usage()); |
| 911 EXPECT_EQ(0, quota()); | 911 EXPECT_EQ(0, quota()); |
| (...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1790 GetPersistentHostQuota(std::string()); | 1790 GetPersistentHostQuota(std::string()); |
| 1791 MessageLoop::current()->RunAllPending(); | 1791 MessageLoop::current()->RunAllPending(); |
| 1792 EXPECT_EQ(kQuotaStatusOk, status()); | 1792 EXPECT_EQ(kQuotaStatusOk, status()); |
| 1793 EXPECT_EQ(0, quota()); | 1793 EXPECT_EQ(0, quota()); |
| 1794 | 1794 |
| 1795 SetPersistentHostQuota(std::string(), 10); | 1795 SetPersistentHostQuota(std::string(), 10); |
| 1796 MessageLoop::current()->RunAllPending(); | 1796 MessageLoop::current()->RunAllPending(); |
| 1797 EXPECT_EQ(kQuotaErrorNotSupported, status()); | 1797 EXPECT_EQ(kQuotaErrorNotSupported, status()); |
| 1798 } | 1798 } |
| 1799 } // namespace quota | 1799 } // namespace quota |
| OLD | NEW |