OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/auto_reset.h" | 5 #include "base/auto_reset.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 EXPECT_EQ(CONTENT_SETTING_BLOCK, | 388 EXPECT_EQ(CONTENT_SETTING_BLOCK, |
389 host_content_settings_map->GetContentSetting( | 389 host_content_settings_map->GetContentSetting( |
390 host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); | 390 host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); |
391 } | 391 } |
392 | 392 |
393 TEST_F(HostContentSettingsMapTest, HostTrimEndingDotCheck) { | 393 TEST_F(HostContentSettingsMapTest, HostTrimEndingDotCheck) { |
394 TestingProfile profile; | 394 TestingProfile profile; |
395 HostContentSettingsMap* host_content_settings_map = | 395 HostContentSettingsMap* host_content_settings_map = |
396 profile.GetHostContentSettingsMap(); | 396 profile.GetHostContentSettingsMap(); |
397 CookieSettings* cookie_settings = | 397 CookieSettings* cookie_settings = |
398 CookieSettings::Factory::GetForProfile(&profile); | 398 CookieSettings::Factory::GetForProfile(&profile).get(); |
399 | 399 |
400 ContentSettingsPattern pattern = | 400 ContentSettingsPattern pattern = |
401 ContentSettingsPattern::FromString("[*.]example.com"); | 401 ContentSettingsPattern::FromString("[*.]example.com"); |
402 GURL host_ending_with_dot("http://example.com./"); | 402 GURL host_ending_with_dot("http://example.com./"); |
403 | 403 |
404 EXPECT_EQ(CONTENT_SETTING_ALLOW, | 404 EXPECT_EQ(CONTENT_SETTING_ALLOW, |
405 host_content_settings_map->GetContentSetting( | 405 host_content_settings_map->GetContentSetting( |
406 host_ending_with_dot, | 406 host_ending_with_dot, |
407 host_ending_with_dot, | 407 host_ending_with_dot, |
408 CONTENT_SETTINGS_TYPE_IMAGES, | 408 CONTENT_SETTINGS_TYPE_IMAGES, |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1072 GURL("http://other.com"), | 1072 GURL("http://other.com"), |
1073 CONTENT_SETTINGS_TYPE_COOKIES, | 1073 CONTENT_SETTINGS_TYPE_COOKIES, |
1074 std::string())); | 1074 std::string())); |
1075 EXPECT_EQ(CONTENT_SETTING_SESSION_ONLY, | 1075 EXPECT_EQ(CONTENT_SETTING_SESSION_ONLY, |
1076 host_content_settings_map->GetContentSetting( | 1076 host_content_settings_map->GetContentSetting( |
1077 GURL("http://third.com"), | 1077 GURL("http://third.com"), |
1078 GURL("http://third.com"), | 1078 GURL("http://third.com"), |
1079 CONTENT_SETTINGS_TYPE_COOKIES, | 1079 CONTENT_SETTINGS_TYPE_COOKIES, |
1080 std::string())); | 1080 std::string())); |
1081 } | 1081 } |
OLD | NEW |