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

Side by Side Diff: content/browser/cache_storage/cache_storage_index_unittest.cc

Issue 2607983002: avoid GCC content::CacheStorage::kSizeUnknown redeclaration error (Closed)
Patch Set: formatting Created 3 years, 11 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "content/browser/cache_storage/cache_storage_index.h" 5 #include "content/browser/cache_storage/cache_storage_index.h"
6 6
7 #include <list> 7 #include <list>
8 #include <utility> 8 #include <utility>
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 25 matching lines...) Expand all
36 ASSERT_EQ(3u, index.ordered_cache_metadata().size()); 36 ASSERT_EQ(3u, index.ordered_cache_metadata().size());
37 EXPECT_EQ(1031, index.GetStorageSize()); 37 EXPECT_EQ(1031, index.GetStorageSize());
38 38
39 EXPECT_TRUE(index.SetCacheSize("baz", 2000)); 39 EXPECT_TRUE(index.SetCacheSize("baz", 2000));
40 EXPECT_EQ(2031, index.GetStorageSize()); 40 EXPECT_EQ(2031, index.GetStorageSize());
41 41
42 EXPECT_FALSE(index.SetCacheSize("baz", 2000)); 42 EXPECT_FALSE(index.SetCacheSize("baz", 2000));
43 EXPECT_EQ(2031, index.GetStorageSize()); 43 EXPECT_EQ(2031, index.GetStorageSize());
44 44
45 EXPECT_EQ(2000, index.GetCacheSize("baz")); 45 EXPECT_EQ(2000, index.GetCacheSize("baz"));
46 EXPECT_EQ(CacheStorage::kSizeUnknown, index.GetCacheSize("<not-present>")); 46 EXPECT_EQ(kCacheStorageSizeUnknown, index.GetCacheSize("<not-present>"));
47 } 47 }
48 48
49 TEST_F(CacheStorageIndexTest, TestDoomCache) { 49 TEST_F(CacheStorageIndexTest, TestDoomCache) {
50 CacheStorageIndex index; 50 CacheStorageIndex index;
51 index.Insert(CacheStorageIndex::CacheMetadata("foo", 12)); 51 index.Insert(CacheStorageIndex::CacheMetadata("foo", 12));
52 index.Insert(CacheStorageIndex::CacheMetadata("bar", 19)); 52 index.Insert(CacheStorageIndex::CacheMetadata("bar", 19));
53 index.Insert(CacheStorageIndex::CacheMetadata("baz", 1000)); 53 index.Insert(CacheStorageIndex::CacheMetadata("baz", 1000));
54 EXPECT_EQ(3u, index.num_entries()); 54 EXPECT_EQ(3u, index.num_entries());
55 ASSERT_EQ(3u, index.ordered_cache_metadata().size()); 55 ASSERT_EQ(3u, index.ordered_cache_metadata().size());
56 EXPECT_EQ(1031, index.GetStorageSize()); 56 EXPECT_EQ(1031, index.GetStorageSize());
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 it++; 155 it++;
156 EXPECT_EQ("baz", it->name); 156 EXPECT_EQ("baz", it->name);
157 EXPECT_EQ(1000u, it->size); 157 EXPECT_EQ(1000u, it->size);
158 158
159 EXPECT_EQ(3u, index2.num_entries()); 159 EXPECT_EQ(3u, index2.num_entries());
160 ASSERT_EQ(3u, index2.ordered_cache_metadata().size()); 160 ASSERT_EQ(3u, index2.ordered_cache_metadata().size());
161 EXPECT_EQ(1031, index2.GetStorageSize()); 161 EXPECT_EQ(1031, index2.GetStorageSize());
162 } 162 }
163 163
164 } // namespace content 164 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698