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

Side by Side Diff: chrome/browser/content_settings/content_settings_origin_identifier_value_map_unittest.cc

Issue 2938163002: Store base::Value in ContentSettingPatternSource instead of an enum (Closed)
Patch Set: rebased Created 3 years, 5 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 (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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698