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 "components/content_settings/core/browser/content_settings_origin_ident
ifier_value_map.h" | 5 #include "components/content_settings/core/browser/content_settings_origin_ident
ifier_value_map.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "components/content_settings/core/browser/content_settings_rule.h" | 10 #include "components/content_settings/core/browser/content_settings_rule.h" |
11 #include "components/content_settings/core/browser/content_settings_utils.h" | 11 #include "components/content_settings/core/browser/content_settings_utils.h" |
| 12 #include "components/content_settings/core/common/content_settings_utils.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
13 #include "url/gurl.h" | 14 #include "url/gurl.h" |
14 | 15 |
15 TEST(OriginIdentifierValueMapTest, SetGetValue) { | 16 TEST(OriginIdentifierValueMapTest, SetGetValue) { |
16 content_settings::OriginIdentifierValueMap map; | 17 content_settings::OriginIdentifierValueMap map; |
17 | 18 |
18 EXPECT_EQ(NULL, | 19 EXPECT_EQ(NULL, |
19 map.GetValue(GURL("http://www.google.com"), | 20 map.GetValue(GURL("http://www.google.com"), |
20 GURL("http://www.google.com"), | 21 GURL("http://www.google.com"), |
21 CONTENT_SETTINGS_TYPE_COOKIES, | 22 CONTENT_SETTINGS_TYPE_COOKIES, |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 CONTENT_SETTINGS_TYPE_COOKIES, std::string())); | 261 CONTENT_SETTINGS_TYPE_COOKIES, std::string())); |
261 rule = rule_iterator->Next(); | 262 rule = rule_iterator->Next(); |
262 EXPECT_EQ(pattern, rule.primary_pattern); | 263 EXPECT_EQ(pattern, rule.primary_pattern); |
263 EXPECT_EQ(3, content_settings::ValueToContentSetting(rule.value.get())); | 264 EXPECT_EQ(3, content_settings::ValueToContentSetting(rule.value.get())); |
264 EXPECT_EQ( | 265 EXPECT_EQ( |
265 t2, map.GetLastModified(rule.primary_pattern, rule.secondary_pattern, | 266 t2, map.GetLastModified(rule.primary_pattern, rule.secondary_pattern, |
266 CONTENT_SETTINGS_TYPE_COOKIES, std::string())); | 267 CONTENT_SETTINGS_TYPE_COOKIES, std::string())); |
267 ASSERT_FALSE(rule_iterator->HasNext()); | 268 ASSERT_FALSE(rule_iterator->HasNext()); |
268 } | 269 } |
269 } | 270 } |
OLD | NEW |