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/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/api/infobars/infobar_service.h" | 8 #include "chrome/browser/api/infobars/infobar_service.h" |
9 #include "chrome/browser/content_settings/host_content_settings_map.h" | 9 #include "chrome/browser/content_settings/host_content_settings_map.h" |
10 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 10 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 NULL, web_contents(), profile(), | 119 NULL, web_contents(), profile(), |
120 CONTENT_SETTINGS_TYPE_MEDIASTREAM)); | 120 CONTENT_SETTINGS_TYPE_MEDIASTREAM)); |
121 const ContentSettingBubbleModel::BubbleContent& bubble_content = | 121 const ContentSettingBubbleModel::BubbleContent& bubble_content = |
122 content_setting_bubble_model->bubble_content(); | 122 content_setting_bubble_model->bubble_content(); |
123 EXPECT_FALSE(bubble_content.title.empty()); | 123 EXPECT_FALSE(bubble_content.title.empty()); |
124 EXPECT_EQ(2U, bubble_content.radio_group.radio_items.size()); | 124 EXPECT_EQ(2U, bubble_content.radio_group.radio_items.size()); |
125 EXPECT_EQ(0, bubble_content.radio_group.default_item); | 125 EXPECT_EQ(0, bubble_content.radio_group.default_item); |
126 EXPECT_TRUE(bubble_content.custom_link.empty()); | 126 EXPECT_TRUE(bubble_content.custom_link.empty()); |
127 EXPECT_FALSE(bubble_content.custom_link_enabled); | 127 EXPECT_FALSE(bubble_content.custom_link_enabled); |
128 EXPECT_FALSE(bubble_content.manage_link.empty()); | 128 EXPECT_FALSE(bubble_content.manage_link.empty()); |
| 129 EXPECT_EQ(2U, bubble_content.media_menus.size()); |
129 } | 130 } |
130 | 131 |
131 TEST_F(ContentSettingBubbleModelTest, BlockedMediastream) { | 132 TEST_F(ContentSettingBubbleModelTest, BlockedMediastream) { |
132 WebContentsTester::For(web_contents())-> | 133 WebContentsTester::For(web_contents())-> |
133 NavigateAndCommit(GURL("https://www.example.com")); | 134 NavigateAndCommit(GURL("https://www.example.com")); |
134 GURL url = web_contents()->GetURL(); | 135 GURL url = web_contents()->GetURL(); |
135 | 136 |
136 HostContentSettingsMap* host_content_settings_map = | 137 HostContentSettingsMap* host_content_settings_map = |
137 profile()->GetHostContentSettingsMap(); | 138 profile()->GetHostContentSettingsMap(); |
138 ContentSettingsPattern primary_pattern = | 139 ContentSettingsPattern primary_pattern = |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 ProtocolHandler handler = registry.GetHandlerFor("mailto"); | 455 ProtocolHandler handler = registry.GetHandlerFor("mailto"); |
455 ASSERT_FALSE(handler.IsEmpty()); | 456 ASSERT_FALSE(handler.IsEmpty()); |
456 EXPECT_EQ(ASCIIToUTF16("Handler"), handler.title()); | 457 EXPECT_EQ(ASCIIToUTF16("Handler"), handler.title()); |
457 EXPECT_EQ(CONTENT_SETTING_ALLOW, | 458 EXPECT_EQ(CONTENT_SETTING_ALLOW, |
458 content_settings->pending_protocol_handler_setting()); | 459 content_settings->pending_protocol_handler_setting()); |
459 EXPECT_FALSE(registry.IsIgnored(test_handler)); | 460 EXPECT_FALSE(registry.IsIgnored(test_handler)); |
460 } | 461 } |
461 | 462 |
462 registry.Shutdown(); | 463 registry.Shutdown(); |
463 } | 464 } |
OLD | NEW |