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_delegate.h" | 8 #include "chrome/browser/api/infobars/infobar_delegate.h" |
9 #include "chrome/browser/api/infobars/infobar_service.h" | 9 #include "chrome/browser/api/infobars/infobar_service.h" |
10 #include "chrome/browser/content_settings/host_content_settings_map.h" | 10 #include "chrome/browser/content_settings/host_content_settings_map.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 NULL, web_contents(), profile(), | 120 NULL, web_contents(), profile(), |
121 CONTENT_SETTINGS_TYPE_MEDIASTREAM)); | 121 CONTENT_SETTINGS_TYPE_MEDIASTREAM)); |
122 const ContentSettingBubbleModel::BubbleContent& bubble_content = | 122 const ContentSettingBubbleModel::BubbleContent& bubble_content = |
123 content_setting_bubble_model->bubble_content(); | 123 content_setting_bubble_model->bubble_content(); |
124 EXPECT_FALSE(bubble_content.title.empty()); | 124 EXPECT_FALSE(bubble_content.title.empty()); |
125 EXPECT_EQ(2U, bubble_content.radio_group.radio_items.size()); | 125 EXPECT_EQ(2U, bubble_content.radio_group.radio_items.size()); |
126 EXPECT_EQ(0, bubble_content.radio_group.default_item); | 126 EXPECT_EQ(0, bubble_content.radio_group.default_item); |
127 EXPECT_TRUE(bubble_content.custom_link.empty()); | 127 EXPECT_TRUE(bubble_content.custom_link.empty()); |
128 EXPECT_FALSE(bubble_content.custom_link_enabled); | 128 EXPECT_FALSE(bubble_content.custom_link_enabled); |
129 EXPECT_FALSE(bubble_content.manage_link.empty()); | 129 EXPECT_FALSE(bubble_content.manage_link.empty()); |
| 130 EXPECT_EQ(2U, bubble_content.media_menus.size()); |
130 } | 131 } |
131 | 132 |
132 TEST_F(ContentSettingBubbleModelTest, BlockedMediastream) { | 133 TEST_F(ContentSettingBubbleModelTest, BlockedMediastream) { |
133 WebContentsTester::For(web_contents())-> | 134 WebContentsTester::For(web_contents())-> |
134 NavigateAndCommit(GURL("https://www.example.com")); | 135 NavigateAndCommit(GURL("https://www.example.com")); |
135 GURL url = web_contents()->GetURL(); | 136 GURL url = web_contents()->GetURL(); |
136 | 137 |
137 HostContentSettingsMap* host_content_settings_map = | 138 HostContentSettingsMap* host_content_settings_map = |
138 profile()->GetHostContentSettingsMap(); | 139 profile()->GetHostContentSettingsMap(); |
139 ContentSettingsPattern primary_pattern = | 140 ContentSettingsPattern primary_pattern = |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 ProtocolHandler handler = registry.GetHandlerFor("mailto"); | 506 ProtocolHandler handler = registry.GetHandlerFor("mailto"); |
506 ASSERT_FALSE(handler.IsEmpty()); | 507 ASSERT_FALSE(handler.IsEmpty()); |
507 EXPECT_EQ(ASCIIToUTF16("Handler"), handler.title()); | 508 EXPECT_EQ(ASCIIToUTF16("Handler"), handler.title()); |
508 EXPECT_EQ(CONTENT_SETTING_ALLOW, | 509 EXPECT_EQ(CONTENT_SETTING_ALLOW, |
509 content_settings->pending_protocol_handler_setting()); | 510 content_settings->pending_protocol_handler_setting()); |
510 EXPECT_FALSE(registry.IsIgnored(test_handler)); | 511 EXPECT_FALSE(registry.IsIgnored(test_handler)); |
511 } | 512 } |
512 | 513 |
513 registry.Shutdown(); | 514 registry.Shutdown(); |
514 } | 515 } |
OLD | NEW |