| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <string> | 5 #include <string> |
| 6 #include <utility> | 6 #include <utility> |
| 7 #include <vector> | 7 #include <vector> |
| 8 #include "chrome/common/instant_restricted_id_cache.h" | 8 |
| 9 #include "chrome/renderer/instant_restricted_id_cache.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 11 |
| 11 namespace { | 12 namespace { |
| 12 | 13 |
| 13 struct TestData { | 14 struct TestData { |
| 14 TestData() {} | 15 TestData() {} |
| 15 explicit TestData(const std::string& i_value) : value(i_value) {} | 16 explicit TestData(const std::string& i_value) : value(i_value) {} |
| 16 | 17 |
| 17 bool operator==(const TestData& rhs) const { | 18 bool operator==(const TestData& rhs) const { |
| 18 return rhs.value == value; | 19 return rhs.value == value; |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 // Add the same items again. | 415 // Add the same items again. |
| 415 cache.AddItemsWithRestrictedID(input1); | 416 cache.AddItemsWithRestrictedID(input1); |
| 416 | 417 |
| 417 // Make sure |cache.last_add_start_| is still valid. | 418 // Make sure |cache.last_add_start_| is still valid. |
| 418 cache.GetCurrentItems(&output); | 419 cache.GetCurrentItems(&output); |
| 419 EXPECT_EQ(3u, output.size()); | 420 EXPECT_EQ(3u, output.size()); |
| 420 EXPECT_EQ(3u, cache.cache_.size()); | 421 EXPECT_EQ(3u, cache.cache_.size()); |
| 421 EXPECT_EQ(12, cache.last_restricted_id_); | 422 EXPECT_EQ(12, cache.last_restricted_id_); |
| 422 EXPECT_EQ(10, cache.last_add_start_->first); | 423 EXPECT_EQ(10, cache.last_add_start_->first); |
| 423 } | 424 } |
| OLD | NEW |