| 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 "chrome/browser/content_settings/content_settings_details.h" | 10 #include "chrome/browser/content_settings/content_settings_details.h" |
| (...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 706 | 706 |
| 707 DictionaryValue* dummy_payload = new DictionaryValue; | 707 DictionaryValue* dummy_payload = new DictionaryValue; |
| 708 dummy_payload->SetInteger("images", CONTENT_SETTING_ALLOW); | 708 dummy_payload->SetInteger("images", CONTENT_SETTING_ALLOW); |
| 709 all_settings_dictionary->SetWithoutPathExpansion("[*.]\xC4\x87ira.com,*", | 709 all_settings_dictionary->SetWithoutPathExpansion("[*.]\xC4\x87ira.com,*", |
| 710 dummy_payload); | 710 dummy_payload); |
| 711 } | 711 } |
| 712 profile.GetHostContentSettingsMap(); | 712 profile.GetHostContentSettingsMap(); |
| 713 | 713 |
| 714 const DictionaryValue* all_settings_dictionary = | 714 const DictionaryValue* all_settings_dictionary = |
| 715 prefs->GetDictionary(prefs::kContentSettingsPatternPairs); | 715 prefs->GetDictionary(prefs::kContentSettingsPatternPairs); |
| 716 DictionaryValue* result = NULL; | 716 const DictionaryValue* result = NULL; |
| 717 EXPECT_FALSE(all_settings_dictionary->GetDictionaryWithoutPathExpansion( | 717 EXPECT_FALSE(all_settings_dictionary->GetDictionaryWithoutPathExpansion( |
| 718 "[*.]\xC4\x87ira.com,*", &result)); | 718 "[*.]\xC4\x87ira.com,*", &result)); |
| 719 EXPECT_TRUE(all_settings_dictionary->GetDictionaryWithoutPathExpansion( | 719 EXPECT_TRUE(all_settings_dictionary->GetDictionaryWithoutPathExpansion( |
| 720 "[*.]xn--ira-ppa.com,*", &result)); | 720 "[*.]xn--ira-ppa.com,*", &result)); |
| 721 } | 721 } |
| 722 | 722 |
| 723 // If both Unicode and its punycode pattern exist, make sure we don't touch the | 723 // If both Unicode and its punycode pattern exist, make sure we don't touch the |
| 724 // settings for the punycode, and that Unicode pattern gets deleted. | 724 // settings for the punycode, and that Unicode pattern gets deleted. |
| 725 TEST_F(HostContentSettingsMapTest, CanonicalizeExceptionsUnicodeAndPunycode) { | 725 TEST_F(HostContentSettingsMapTest, CanonicalizeExceptionsUnicodeAndPunycode) { |
| 726 TestingProfile profile; | 726 TestingProfile profile; |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1073 GURL("http://other.com"), | 1073 GURL("http://other.com"), |
| 1074 CONTENT_SETTINGS_TYPE_COOKIES, | 1074 CONTENT_SETTINGS_TYPE_COOKIES, |
| 1075 std::string())); | 1075 std::string())); |
| 1076 EXPECT_EQ(CONTENT_SETTING_SESSION_ONLY, | 1076 EXPECT_EQ(CONTENT_SETTING_SESSION_ONLY, |
| 1077 host_content_settings_map->GetContentSetting( | 1077 host_content_settings_map->GetContentSetting( |
| 1078 GURL("http://third.com"), | 1078 GURL("http://third.com"), |
| 1079 GURL("http://third.com"), | 1079 GURL("http://third.com"), |
| 1080 CONTENT_SETTINGS_TYPE_COOKIES, | 1080 CONTENT_SETTINGS_TYPE_COOKIES, |
| 1081 std::string())); | 1081 std::string())); |
| 1082 } | 1082 } |
| OLD | NEW |