| OLD | NEW |
| 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> |
| 6 |
| 5 #include <algorithm> | 7 #include <algorithm> |
| 6 #include <vector> | 8 #include <vector> |
| 7 | 9 |
| 10 #include "base/macros.h" |
| 8 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 9 #include "chrome/browser/android/thumbnail/scoped_ptr_expiring_cache.h" | 12 #include "chrome/browser/android/thumbnail/scoped_ptr_expiring_cache.h" |
| 10 #include "testing/gmock/include/gmock/gmock.h" | 13 #include "testing/gmock/include/gmock/gmock.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 12 | 15 |
| 13 #define MAX_CACHE_SIZE 5u | 16 #define MAX_CACHE_SIZE 5u |
| 14 | 17 |
| 15 namespace { | 18 namespace { |
| 16 | 19 |
| 17 unsigned int GenerateValue(unsigned int key) { | 20 unsigned int GenerateValue(unsigned int key) { |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 } | 159 } |
| 157 | 160 |
| 158 TestScopedPtrExpiringCache::iterator cache_iter = cache.begin(); | 161 TestScopedPtrExpiringCache::iterator cache_iter = cache.begin(); |
| 159 std::vector<unsigned int>::iterator key_iter = test_keys.begin(); | 162 std::vector<unsigned int>::iterator key_iter = test_keys.begin(); |
| 160 while (cache_iter != cache.end() && key_iter != test_keys.end()) { | 163 while (cache_iter != cache.end() && key_iter != test_keys.end()) { |
| 161 EXPECT_EQ(cache_iter->first, *key_iter); | 164 EXPECT_EQ(cache_iter->first, *key_iter); |
| 162 cache_iter++; | 165 cache_iter++; |
| 163 key_iter++; | 166 key_iter++; |
| 164 } | 167 } |
| 165 } | 168 } |
| OLD | NEW |