| 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 "base/auto_reset.h" | 5 #include "base/auto_reset.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "chrome/browser/content_settings/host_content_settings_map.h" | 7 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" | 10 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 EXPECT_EQ(2U, bubble_content.radio_group.radio_items.size()); | 100 EXPECT_EQ(2U, bubble_content.radio_group.radio_items.size()); |
| 101 EXPECT_FALSE(bubble_content.custom_link.empty()); | 101 EXPECT_FALSE(bubble_content.custom_link.empty()); |
| 102 EXPECT_TRUE(bubble_content.custom_link_enabled); | 102 EXPECT_TRUE(bubble_content.custom_link_enabled); |
| 103 EXPECT_FALSE(bubble_content.manage_link.empty()); | 103 EXPECT_FALSE(bubble_content.manage_link.empty()); |
| 104 } | 104 } |
| 105 | 105 |
| 106 TEST_F(ContentSettingBubbleModelTest, MultiplePlugins) { | 106 TEST_F(ContentSettingBubbleModelTest, MultiplePlugins) { |
| 107 CommandLine* cmd = CommandLine::ForCurrentProcess(); | 107 CommandLine* cmd = CommandLine::ForCurrentProcess(); |
| 108 AutoReset<CommandLine> auto_reset(cmd, *cmd); | 108 AutoReset<CommandLine> auto_reset(cmd, *cmd); |
| 109 cmd->AppendSwitch(switches::kEnableResourceContentSettings); | 109 cmd->AppendSwitch(switches::kEnableResourceContentSettings); |
| 110 cmd->AppendSwitch(switches::kEnableClickToPlay); | |
| 111 | 110 |
| 112 HostContentSettingsMap* map = profile()->GetHostContentSettingsMap(); | 111 HostContentSettingsMap* map = profile()->GetHostContentSettingsMap(); |
| 113 std::string fooPlugin = "foo"; | 112 std::string fooPlugin = "foo"; |
| 114 std::string barPlugin = "bar"; | 113 std::string barPlugin = "bar"; |
| 115 | 114 |
| 116 // Navigating to some sample url prevents the GetURL method from returning an | 115 // Navigating to some sample url prevents the GetURL method from returning an |
| 117 // invalid empty URL. | 116 // invalid empty URL. |
| 118 contents()->NavigateAndCommit(GURL("http://www.example.com")); | 117 contents()->NavigateAndCommit(GURL("http://www.example.com")); |
| 119 GURL url = contents()->GetURL(); | 118 GURL url = contents()->GetURL(); |
| 120 map->AddExceptionForURL(url, | 119 map->AddExceptionForURL(url, |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 std::string file_url("file:///tmp/test.html"); | 213 std::string file_url("file:///tmp/test.html"); |
| 215 NavigateAndCommit(GURL(file_url)); | 214 NavigateAndCommit(GURL(file_url)); |
| 216 scoped_ptr<ContentSettingBubbleModel> content_setting_bubble_model( | 215 scoped_ptr<ContentSettingBubbleModel> content_setting_bubble_model( |
| 217 ContentSettingBubbleModel::CreateContentSettingBubbleModel( | 216 ContentSettingBubbleModel::CreateContentSettingBubbleModel( |
| 218 NULL, contents_wrapper(), profile(), | 217 NULL, contents_wrapper(), profile(), |
| 219 CONTENT_SETTINGS_TYPE_IMAGES)); | 218 CONTENT_SETTINGS_TYPE_IMAGES)); |
| 220 std::string title = | 219 std::string title = |
| 221 content_setting_bubble_model->bubble_content().radio_group.radio_items[0]; | 220 content_setting_bubble_model->bubble_content().radio_group.radio_items[0]; |
| 222 ASSERT_NE(std::string::npos, title.find(file_url)); | 221 ASSERT_NE(std::string::npos, title.find(file_url)); |
| 223 } | 222 } |
| OLD | NEW |