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

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

Issue 8528022: Fix quota value overflow (reland). (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 9 years, 1 month 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
« no previous file with comments | « webkit/quota/quota_manager.cc ('k') | no next file » | 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) 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
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", 300); 898 SetPersistentHostQuota("foo.com", 300000000000ll);
899 GetPersistentHostQuota("foo.com"); 899 GetPersistentHostQuota("foo.com");
900 MessageLoop::current()->RunAllPending(); 900 MessageLoop::current()->RunAllPending();
901 EXPECT_EQ(300, quota()); 901 EXPECT_EQ(300000000000ll, 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
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
OLDNEW
« no previous file with comments | « webkit/quota/quota_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698