| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/content_setting_bubble_model.h" | 5 #include "chrome/browser/content_setting_bubble_model.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "chrome/browser/browser_thread.h" | 9 #include "chrome/browser/browser_thread.h" |
| 10 #include "chrome/browser/host_content_settings_map.h" | 10 #include "chrome/browser/host_content_settings_map.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 EXPECT_NE(std::string(), bubble_content.manage_link); | 102 EXPECT_NE(std::string(), bubble_content.manage_link); |
| 103 EXPECT_EQ(std::string(), bubble_content.info_link); | 103 EXPECT_EQ(std::string(), bubble_content.info_link); |
| 104 EXPECT_NE(std::string(), bubble_content.title); | 104 EXPECT_NE(std::string(), bubble_content.title); |
| 105 EXPECT_NE(std::string(), bubble_content.load_plugins_link_title); | 105 EXPECT_NE(std::string(), bubble_content.load_plugins_link_title); |
| 106 } | 106 } |
| 107 | 107 |
| 108 TEST_F(ContentSettingBubbleModelTest, MultiplePlugins) { | 108 TEST_F(ContentSettingBubbleModelTest, MultiplePlugins) { |
| 109 CommandLine* cmd = CommandLine::ForCurrentProcess(); | 109 CommandLine* cmd = CommandLine::ForCurrentProcess(); |
| 110 AutoReset<CommandLine> auto_reset(cmd, *cmd); | 110 AutoReset<CommandLine> auto_reset(cmd, *cmd); |
| 111 cmd->AppendSwitch(switches::kEnableResourceContentSettings); | 111 cmd->AppendSwitch(switches::kEnableResourceContentSettings); |
| 112 cmd->AppendSwitch(switches::kEnableClickToPlay); |
| 112 | 113 |
| 113 HostContentSettingsMap* map = profile_->GetHostContentSettingsMap(); | 114 HostContentSettingsMap* map = profile_->GetHostContentSettingsMap(); |
| 114 std::string fooPlugin = "foo"; | 115 std::string fooPlugin = "foo"; |
| 115 std::string barPlugin = "bar"; | 116 std::string barPlugin = "bar"; |
| 116 GURL url = contents()->GetURL(); | 117 GURL url = contents()->GetURL(); |
| 117 map->AddExceptionForURL(url, | 118 map->AddExceptionForURL(url, |
| 118 CONTENT_SETTINGS_TYPE_PLUGINS, | 119 CONTENT_SETTINGS_TYPE_PLUGINS, |
| 119 fooPlugin, | 120 fooPlugin, |
| 120 CONTENT_SETTING_ALLOW); | 121 CONTENT_SETTING_ALLOW); |
| 121 map->AddExceptionForURL(url, | 122 map->AddExceptionForURL(url, |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 CheckGeolocationBubble(1, false, false); | 186 CheckGeolocationBubble(1, false, false); |
| 186 | 187 |
| 187 // Second frame denied, but not stored in the content map: requires reload. | 188 // Second frame denied, but not stored in the content map: requires reload. |
| 188 content_settings->OnGeolocationPermissionSet(frame2_url, false); | 189 content_settings->OnGeolocationPermissionSet(frame2_url, false); |
| 189 CheckGeolocationBubble(2, false, true); | 190 CheckGeolocationBubble(2, false, true); |
| 190 | 191 |
| 191 // Change the default to block: offer a clear link for the persisted frame 1. | 192 // Change the default to block: offer a clear link for the persisted frame 1. |
| 192 setting_map->SetDefaultContentSetting(CONTENT_SETTING_BLOCK); | 193 setting_map->SetDefaultContentSetting(CONTENT_SETTING_BLOCK); |
| 193 CheckGeolocationBubble(2, true, false); | 194 CheckGeolocationBubble(2, true, false); |
| 194 } | 195 } |
| OLD | NEW |