Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Side by Side Diff: chrome/browser/ui/content_settings/content_setting_bubble_model_unittest.cc

Issue 12208010: Adding device selection menus to the content setting bubble (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed the windows code. Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/content_settings/host_content_settings_map.h" 8 #include "chrome/browser/content_settings/host_content_settings_map.h"
9 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 9 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
10 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" 10 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 NULL, web_contents(), profile(), 117 NULL, web_contents(), profile(),
118 CONTENT_SETTINGS_TYPE_MEDIASTREAM)); 118 CONTENT_SETTINGS_TYPE_MEDIASTREAM));
119 const ContentSettingBubbleModel::BubbleContent& bubble_content = 119 const ContentSettingBubbleModel::BubbleContent& bubble_content =
120 content_setting_bubble_model->bubble_content(); 120 content_setting_bubble_model->bubble_content();
121 EXPECT_FALSE(bubble_content.title.empty()); 121 EXPECT_FALSE(bubble_content.title.empty());
122 EXPECT_EQ(2U, bubble_content.radio_group.radio_items.size()); 122 EXPECT_EQ(2U, bubble_content.radio_group.radio_items.size());
123 EXPECT_EQ(0, bubble_content.radio_group.default_item); 123 EXPECT_EQ(0, bubble_content.radio_group.default_item);
124 EXPECT_TRUE(bubble_content.custom_link.empty()); 124 EXPECT_TRUE(bubble_content.custom_link.empty());
125 EXPECT_FALSE(bubble_content.custom_link_enabled); 125 EXPECT_FALSE(bubble_content.custom_link_enabled);
126 EXPECT_FALSE(bubble_content.manage_link.empty()); 126 EXPECT_FALSE(bubble_content.manage_link.empty());
127 EXPECT_EQ(2U, bubble_content.media_menus.size());
127 } 128 }
128 129
129 TEST_F(ContentSettingBubbleModelTest, BlockedMediastream) { 130 TEST_F(ContentSettingBubbleModelTest, BlockedMediastream) {
130 WebContentsTester::For(web_contents())-> 131 WebContentsTester::For(web_contents())->
131 NavigateAndCommit(GURL("https://www.example.com")); 132 NavigateAndCommit(GURL("https://www.example.com"));
132 GURL url = web_contents()->GetURL(); 133 GURL url = web_contents()->GetURL();
133 134
134 HostContentSettingsMap* host_content_settings_map = 135 HostContentSettingsMap* host_content_settings_map =
135 profile()->GetHostContentSettingsMap(); 136 profile()->GetHostContentSettingsMap();
136 ContentSettingsPattern primary_pattern = 137 ContentSettingsPattern primary_pattern =
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 ProtocolHandler handler = registry.GetHandlerFor("mailto"); 453 ProtocolHandler handler = registry.GetHandlerFor("mailto");
453 ASSERT_FALSE(handler.IsEmpty()); 454 ASSERT_FALSE(handler.IsEmpty());
454 EXPECT_EQ(ASCIIToUTF16("Handler"), handler.title()); 455 EXPECT_EQ(ASCIIToUTF16("Handler"), handler.title());
455 EXPECT_EQ(CONTENT_SETTING_ALLOW, 456 EXPECT_EQ(CONTENT_SETTING_ALLOW,
456 content_settings->pending_protocol_handler_setting()); 457 content_settings->pending_protocol_handler_setting());
457 EXPECT_FALSE(registry.IsIgnored(test_handler)); 458 EXPECT_FALSE(registry.IsIgnored(test_handler));
458 } 459 }
459 460
460 registry.Shutdown(); 461 registry.Shutdown();
461 } 462 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698