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

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

Issue 1171333003: Move net::FormatUrl and friends outside of //net and into //components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase again now that CQ is fixed Created 5 years, 4 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
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/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.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"
11 #include "chrome/browser/infobars/infobar_service.h" 11 #include "chrome/browser/infobars/infobar_service.h"
12 #include "chrome/browser/media/media_capture_devices_dispatcher.h" 12 #include "chrome/browser/media/media_capture_devices_dispatcher.h"
13 #include "chrome/browser/media/media_stream_capture_indicator.h" 13 #include "chrome/browser/media/media_stream_capture_indicator.h"
14 #include "chrome/browser/profiles/profile.h" 14 #include "chrome/browser/profiles/profile.h"
15 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" 15 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h"
16 #include "chrome/common/chrome_switches.h" 16 #include "chrome/common/chrome_switches.h"
17 #include "chrome/common/pref_names.h" 17 #include "chrome/common/pref_names.h"
18 #include "chrome/grit/generated_resources.h" 18 #include "chrome/grit/generated_resources.h"
19 #include "chrome/test/base/chrome_render_view_host_test_harness.h" 19 #include "chrome/test/base/chrome_render_view_host_test_harness.h"
20 #include "chrome/test/base/testing_profile.h" 20 #include "chrome/test/base/testing_profile.h"
21 #include "components/content_settings/core/browser/host_content_settings_map.h" 21 #include "components/content_settings/core/browser/host_content_settings_map.h"
22 #include "components/content_settings/core/common/content_settings.h" 22 #include "components/content_settings/core/common/content_settings.h"
23 #include "components/infobars/core/infobar_delegate.h" 23 #include "components/infobars/core/infobar_delegate.h"
24 #include "components/secure_display/elide_url.h" 24 #include "components/url_formatter/elide_url.h"
25 #include "content/public/browser/web_contents.h" 25 #include "content/public/browser/web_contents.h"
26 #include "content/public/test/web_contents_tester.h" 26 #include "content/public/test/web_contents_tester.h"
27 #include "testing/gtest/include/gtest/gtest.h" 27 #include "testing/gtest/include/gtest/gtest.h"
28 #include "ui/base/l10n/l10n_util.h" 28 #include "ui/base/l10n/l10n_util.h"
29 29
30 using content::WebContentsTester; 30 using content::WebContentsTester;
31 31
32 class ContentSettingBubbleModelTest : public ChromeRenderViewHostTestHarness { 32 class ContentSettingBubbleModelTest : public ChromeRenderViewHostTestHarness {
33 protected: 33 protected:
34 void SetUp() override { 34 void SetUp() override {
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 content_setting_bubble_model->bubble_content(); 111 content_setting_bubble_model->bubble_content();
112 112
113 EXPECT_FALSE(bubble_content_2.title.empty()); 113 EXPECT_FALSE(bubble_content_2.title.empty());
114 EXPECT_NE(title, bubble_content_2.title); 114 EXPECT_NE(title, bubble_content_2.title);
115 ASSERT_EQ(2U, bubble_content_2.radio_group.radio_items.size()); 115 ASSERT_EQ(2U, bubble_content_2.radio_group.radio_items.size());
116 EXPECT_EQ(bubble_content_2.radio_group.radio_items[0], 116 EXPECT_EQ(bubble_content_2.radio_group.radio_items[0],
117 l10n_util::GetStringUTF8(IDS_ALLOWED_COOKIES_NO_ACTION)); 117 l10n_util::GetStringUTF8(IDS_ALLOWED_COOKIES_NO_ACTION));
118 EXPECT_EQ(bubble_content_2.radio_group.radio_items[1], 118 EXPECT_EQ(bubble_content_2.radio_group.radio_items[1],
119 l10n_util::GetStringFUTF8( 119 l10n_util::GetStringFUTF8(
120 IDS_ALLOWED_COOKIES_BLOCK, 120 IDS_ALLOWED_COOKIES_BLOCK,
121 secure_display::FormatUrlForSecurityDisplay( 121 url_formatter::FormatUrlForSecurityDisplay(
122 web_contents()->GetURL(), profile()->GetPrefs()->GetString( 122 web_contents()->GetURL(), profile()->GetPrefs()->GetString(
123 prefs::kAcceptLanguages)))); 123 prefs::kAcceptLanguages))));
124 EXPECT_FALSE(bubble_content_2.custom_link.empty()); 124 EXPECT_FALSE(bubble_content_2.custom_link.empty());
125 EXPECT_TRUE(bubble_content_2.custom_link_enabled); 125 EXPECT_TRUE(bubble_content_2.custom_link_enabled);
126 EXPECT_FALSE(bubble_content_2.manage_link.empty()); 126 EXPECT_FALSE(bubble_content_2.manage_link.empty());
127 } 127 }
128 128
129 TEST_F(ContentSettingBubbleModelTest, MediastreamMicAndCamera) { 129 TEST_F(ContentSettingBubbleModelTest, MediastreamMicAndCamera) {
130 // Required to break dependency on BrowserMainLoop. 130 // Required to break dependency on BrowserMainLoop.
131 MediaCaptureDevicesDispatcher::GetInstance()-> 131 MediaCaptureDevicesDispatcher::GetInstance()->
(...skipping 18 matching lines...) Expand all
150 NULL, web_contents(), profile(), 150 NULL, web_contents(), profile(),
151 CONTENT_SETTINGS_TYPE_MEDIASTREAM)); 151 CONTENT_SETTINGS_TYPE_MEDIASTREAM));
152 const ContentSettingBubbleModel::BubbleContent& bubble_content = 152 const ContentSettingBubbleModel::BubbleContent& bubble_content =
153 content_setting_bubble_model->bubble_content(); 153 content_setting_bubble_model->bubble_content();
154 EXPECT_EQ(bubble_content.title, 154 EXPECT_EQ(bubble_content.title,
155 l10n_util::GetStringUTF8(IDS_MICROPHONE_CAMERA_ALLOWED)); 155 l10n_util::GetStringUTF8(IDS_MICROPHONE_CAMERA_ALLOWED));
156 EXPECT_EQ(2U, bubble_content.radio_group.radio_items.size()); 156 EXPECT_EQ(2U, bubble_content.radio_group.radio_items.size());
157 EXPECT_EQ(bubble_content.radio_group.radio_items[0], 157 EXPECT_EQ(bubble_content.radio_group.radio_items[0],
158 l10n_util::GetStringFUTF8( 158 l10n_util::GetStringFUTF8(
159 IDS_ALLOWED_MEDIASTREAM_MIC_AND_CAMERA_NO_ACTION, 159 IDS_ALLOWED_MEDIASTREAM_MIC_AND_CAMERA_NO_ACTION,
160 secure_display::FormatUrlForSecurityDisplay( 160 url_formatter::FormatUrlForSecurityDisplay(
161 security_origin, profile()->GetPrefs()->GetString( 161 security_origin, profile()->GetPrefs()->GetString(
162 prefs::kAcceptLanguages)))); 162 prefs::kAcceptLanguages))));
163 EXPECT_EQ(bubble_content.radio_group.radio_items[1], 163 EXPECT_EQ(bubble_content.radio_group.radio_items[1],
164 l10n_util::GetStringUTF8( 164 l10n_util::GetStringUTF8(
165 IDS_ALLOWED_MEDIASTREAM_MIC_AND_CAMERA_BLOCK)); 165 IDS_ALLOWED_MEDIASTREAM_MIC_AND_CAMERA_BLOCK));
166 EXPECT_EQ(0, bubble_content.radio_group.default_item); 166 EXPECT_EQ(0, bubble_content.radio_group.default_item);
167 EXPECT_TRUE(bubble_content.custom_link.empty()); 167 EXPECT_TRUE(bubble_content.custom_link.empty());
168 EXPECT_FALSE(bubble_content.custom_link_enabled); 168 EXPECT_FALSE(bubble_content.custom_link_enabled);
169 EXPECT_FALSE(bubble_content.manage_link.empty()); 169 EXPECT_FALSE(bubble_content.manage_link.empty());
170 EXPECT_EQ(2U, bubble_content.media_menus.size()); 170 EXPECT_EQ(2U, bubble_content.media_menus.size());
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 NULL, web_contents(), profile(), 535 NULL, web_contents(), profile(),
536 CONTENT_SETTINGS_TYPE_MEDIASTREAM)); 536 CONTENT_SETTINGS_TYPE_MEDIASTREAM));
537 const ContentSettingBubbleModel::BubbleContent& bubble_content = 537 const ContentSettingBubbleModel::BubbleContent& bubble_content =
538 content_setting_bubble_model->bubble_content(); 538 content_setting_bubble_model->bubble_content();
539 EXPECT_EQ(bubble_content.title, 539 EXPECT_EQ(bubble_content.title,
540 l10n_util::GetStringUTF8(IDS_MICROPHONE_ACCESSED)); 540 l10n_util::GetStringUTF8(IDS_MICROPHONE_ACCESSED));
541 EXPECT_EQ(2U, bubble_content.radio_group.radio_items.size()); 541 EXPECT_EQ(2U, bubble_content.radio_group.radio_items.size());
542 EXPECT_EQ(bubble_content.radio_group.radio_items[0], 542 EXPECT_EQ(bubble_content.radio_group.radio_items[0],
543 l10n_util::GetStringFUTF8( 543 l10n_util::GetStringFUTF8(
544 IDS_ALLOWED_MEDIASTREAM_MIC_NO_ACTION, 544 IDS_ALLOWED_MEDIASTREAM_MIC_NO_ACTION,
545 secure_display::FormatUrlForSecurityDisplay( 545 url_formatter::FormatUrlForSecurityDisplay(
546 security_origin, profile()->GetPrefs()->GetString( 546 security_origin, profile()->GetPrefs()->GetString(
547 prefs::kAcceptLanguages)))); 547 prefs::kAcceptLanguages))));
548 EXPECT_EQ(bubble_content.radio_group.radio_items[1], 548 EXPECT_EQ(bubble_content.radio_group.radio_items[1],
549 l10n_util::GetStringUTF8( 549 l10n_util::GetStringUTF8(
550 IDS_ALLOWED_MEDIASTREAM_MIC_BLOCK)); 550 IDS_ALLOWED_MEDIASTREAM_MIC_BLOCK));
551 EXPECT_EQ(0, bubble_content.radio_group.default_item); 551 EXPECT_EQ(0, bubble_content.radio_group.default_item);
552 EXPECT_TRUE(bubble_content.custom_link.empty()); 552 EXPECT_TRUE(bubble_content.custom_link.empty());
553 EXPECT_FALSE(bubble_content.custom_link_enabled); 553 EXPECT_FALSE(bubble_content.custom_link_enabled);
554 EXPECT_FALSE(bubble_content.manage_link.empty()); 554 EXPECT_FALSE(bubble_content.manage_link.empty());
555 EXPECT_EQ(1U, bubble_content.media_menus.size()); 555 EXPECT_EQ(1U, bubble_content.media_menus.size());
(...skipping 13 matching lines...) Expand all
569 NULL, web_contents(), profile(), 569 NULL, web_contents(), profile(),
570 CONTENT_SETTINGS_TYPE_MEDIASTREAM)); 570 CONTENT_SETTINGS_TYPE_MEDIASTREAM));
571 const ContentSettingBubbleModel::BubbleContent& new_bubble_content = 571 const ContentSettingBubbleModel::BubbleContent& new_bubble_content =
572 content_setting_bubble_model->bubble_content(); 572 content_setting_bubble_model->bubble_content();
573 EXPECT_EQ(new_bubble_content.title, 573 EXPECT_EQ(new_bubble_content.title,
574 l10n_util::GetStringUTF8(IDS_MICROPHONE_BLOCKED)); 574 l10n_util::GetStringUTF8(IDS_MICROPHONE_BLOCKED));
575 EXPECT_EQ(2U, new_bubble_content.radio_group.radio_items.size()); 575 EXPECT_EQ(2U, new_bubble_content.radio_group.radio_items.size());
576 EXPECT_EQ(new_bubble_content.radio_group.radio_items[0], 576 EXPECT_EQ(new_bubble_content.radio_group.radio_items[0],
577 l10n_util::GetStringFUTF8( 577 l10n_util::GetStringFUTF8(
578 IDS_BLOCKED_MEDIASTREAM_MIC_ASK, 578 IDS_BLOCKED_MEDIASTREAM_MIC_ASK,
579 secure_display::FormatUrlForSecurityDisplay( 579 url_formatter::FormatUrlForSecurityDisplay(
580 security_origin, profile()->GetPrefs()->GetString( 580 security_origin, profile()->GetPrefs()->GetString(
581 prefs::kAcceptLanguages)))); 581 prefs::kAcceptLanguages))));
582 EXPECT_EQ(new_bubble_content.radio_group.radio_items[1], 582 EXPECT_EQ(new_bubble_content.radio_group.radio_items[1],
583 l10n_util::GetStringUTF8( 583 l10n_util::GetStringUTF8(
584 IDS_BLOCKED_MEDIASTREAM_MIC_NO_ACTION)); 584 IDS_BLOCKED_MEDIASTREAM_MIC_NO_ACTION));
585 EXPECT_EQ(1, new_bubble_content.radio_group.default_item); 585 EXPECT_EQ(1, new_bubble_content.radio_group.default_item);
586 EXPECT_TRUE(new_bubble_content.custom_link.empty()); 586 EXPECT_TRUE(new_bubble_content.custom_link.empty());
587 EXPECT_FALSE(new_bubble_content.custom_link_enabled); 587 EXPECT_FALSE(new_bubble_content.custom_link_enabled);
588 EXPECT_FALSE(new_bubble_content.manage_link.empty()); 588 EXPECT_FALSE(new_bubble_content.manage_link.empty());
589 EXPECT_EQ(1U, new_bubble_content.media_menus.size()); 589 EXPECT_EQ(1U, new_bubble_content.media_menus.size());
(...skipping 24 matching lines...) Expand all
614 NULL, web_contents(), profile(), 614 NULL, web_contents(), profile(),
615 CONTENT_SETTINGS_TYPE_MEDIASTREAM)); 615 CONTENT_SETTINGS_TYPE_MEDIASTREAM));
616 const ContentSettingBubbleModel::BubbleContent& bubble_content = 616 const ContentSettingBubbleModel::BubbleContent& bubble_content =
617 content_setting_bubble_model->bubble_content(); 617 content_setting_bubble_model->bubble_content();
618 EXPECT_EQ(bubble_content.title, 618 EXPECT_EQ(bubble_content.title,
619 l10n_util::GetStringUTF8(IDS_CAMERA_ACCESSED)); 619 l10n_util::GetStringUTF8(IDS_CAMERA_ACCESSED));
620 EXPECT_EQ(2U, bubble_content.radio_group.radio_items.size()); 620 EXPECT_EQ(2U, bubble_content.radio_group.radio_items.size());
621 EXPECT_EQ(bubble_content.radio_group.radio_items[0], 621 EXPECT_EQ(bubble_content.radio_group.radio_items[0],
622 l10n_util::GetStringFUTF8( 622 l10n_util::GetStringFUTF8(
623 IDS_ALLOWED_MEDIASTREAM_CAMERA_NO_ACTION, 623 IDS_ALLOWED_MEDIASTREAM_CAMERA_NO_ACTION,
624 secure_display::FormatUrlForSecurityDisplay( 624 url_formatter::FormatUrlForSecurityDisplay(
625 security_origin, profile()->GetPrefs()->GetString( 625 security_origin, profile()->GetPrefs()->GetString(
626 prefs::kAcceptLanguages)))); 626 prefs::kAcceptLanguages))));
627 EXPECT_EQ(bubble_content.radio_group.radio_items[1], 627 EXPECT_EQ(bubble_content.radio_group.radio_items[1],
628 l10n_util::GetStringUTF8( 628 l10n_util::GetStringUTF8(
629 IDS_ALLOWED_MEDIASTREAM_CAMERA_BLOCK)); 629 IDS_ALLOWED_MEDIASTREAM_CAMERA_BLOCK));
630 EXPECT_EQ(0, bubble_content.radio_group.default_item); 630 EXPECT_EQ(0, bubble_content.radio_group.default_item);
631 EXPECT_TRUE(bubble_content.custom_link.empty()); 631 EXPECT_TRUE(bubble_content.custom_link.empty());
632 EXPECT_FALSE(bubble_content.custom_link_enabled); 632 EXPECT_FALSE(bubble_content.custom_link_enabled);
633 EXPECT_FALSE(bubble_content.manage_link.empty()); 633 EXPECT_FALSE(bubble_content.manage_link.empty());
634 EXPECT_EQ(1U, bubble_content.media_menus.size()); 634 EXPECT_EQ(1U, bubble_content.media_menus.size());
(...skipping 13 matching lines...) Expand all
648 NULL, web_contents(), profile(), 648 NULL, web_contents(), profile(),
649 CONTENT_SETTINGS_TYPE_MEDIASTREAM)); 649 CONTENT_SETTINGS_TYPE_MEDIASTREAM));
650 const ContentSettingBubbleModel::BubbleContent& new_bubble_content = 650 const ContentSettingBubbleModel::BubbleContent& new_bubble_content =
651 content_setting_bubble_model->bubble_content(); 651 content_setting_bubble_model->bubble_content();
652 EXPECT_EQ(new_bubble_content.title, 652 EXPECT_EQ(new_bubble_content.title,
653 l10n_util::GetStringUTF8(IDS_CAMERA_BLOCKED)); 653 l10n_util::GetStringUTF8(IDS_CAMERA_BLOCKED));
654 EXPECT_EQ(2U, new_bubble_content.radio_group.radio_items.size()); 654 EXPECT_EQ(2U, new_bubble_content.radio_group.radio_items.size());
655 EXPECT_EQ(new_bubble_content.radio_group.radio_items[0], 655 EXPECT_EQ(new_bubble_content.radio_group.radio_items[0],
656 l10n_util::GetStringFUTF8( 656 l10n_util::GetStringFUTF8(
657 IDS_BLOCKED_MEDIASTREAM_CAMERA_ASK, 657 IDS_BLOCKED_MEDIASTREAM_CAMERA_ASK,
658 secure_display::FormatUrlForSecurityDisplay( 658 url_formatter::FormatUrlForSecurityDisplay(
659 security_origin, profile()->GetPrefs()->GetString( 659 security_origin, profile()->GetPrefs()->GetString(
660 prefs::kAcceptLanguages)))); 660 prefs::kAcceptLanguages))));
661 EXPECT_EQ(new_bubble_content.radio_group.radio_items[1], 661 EXPECT_EQ(new_bubble_content.radio_group.radio_items[1],
662 l10n_util::GetStringUTF8( 662 l10n_util::GetStringUTF8(
663 IDS_BLOCKED_MEDIASTREAM_CAMERA_NO_ACTION)); 663 IDS_BLOCKED_MEDIASTREAM_CAMERA_NO_ACTION));
664 EXPECT_EQ(1, new_bubble_content.radio_group.default_item); 664 EXPECT_EQ(1, new_bubble_content.radio_group.default_item);
665 EXPECT_TRUE(new_bubble_content.custom_link.empty()); 665 EXPECT_TRUE(new_bubble_content.custom_link.empty());
666 EXPECT_FALSE(new_bubble_content.custom_link_enabled); 666 EXPECT_FALSE(new_bubble_content.custom_link_enabled);
667 EXPECT_FALSE(new_bubble_content.manage_link.empty()); 667 EXPECT_FALSE(new_bubble_content.manage_link.empty());
668 EXPECT_EQ(1U, new_bubble_content.media_menus.size()); 668 EXPECT_EQ(1U, new_bubble_content.media_menus.size());
(...skipping 26 matching lines...) Expand all
695 NULL, web_contents(), profile(), 695 NULL, web_contents(), profile(),
696 CONTENT_SETTINGS_TYPE_MEDIASTREAM)); 696 CONTENT_SETTINGS_TYPE_MEDIASTREAM));
697 const ContentSettingBubbleModel::BubbleContent& bubble_content = 697 const ContentSettingBubbleModel::BubbleContent& bubble_content =
698 content_setting_bubble_model->bubble_content(); 698 content_setting_bubble_model->bubble_content();
699 EXPECT_EQ(bubble_content.title, 699 EXPECT_EQ(bubble_content.title,
700 l10n_util::GetStringUTF8(IDS_MICROPHONE_ACCESSED)); 700 l10n_util::GetStringUTF8(IDS_MICROPHONE_ACCESSED));
701 EXPECT_EQ(2U, bubble_content.radio_group.radio_items.size()); 701 EXPECT_EQ(2U, bubble_content.radio_group.radio_items.size());
702 EXPECT_EQ(bubble_content.radio_group.radio_items[0], 702 EXPECT_EQ(bubble_content.radio_group.radio_items[0],
703 l10n_util::GetStringFUTF8( 703 l10n_util::GetStringFUTF8(
704 IDS_ALLOWED_MEDIASTREAM_MIC_NO_ACTION, 704 IDS_ALLOWED_MEDIASTREAM_MIC_NO_ACTION,
705 secure_display::FormatUrlForSecurityDisplay( 705 url_formatter::FormatUrlForSecurityDisplay(
706 security_origin, profile()->GetPrefs()->GetString( 706 security_origin, profile()->GetPrefs()->GetString(
707 prefs::kAcceptLanguages)))); 707 prefs::kAcceptLanguages))));
708 EXPECT_EQ(bubble_content.radio_group.radio_items[1], 708 EXPECT_EQ(bubble_content.radio_group.radio_items[1],
709 l10n_util::GetStringUTF8( 709 l10n_util::GetStringUTF8(
710 IDS_ALLOWED_MEDIASTREAM_MIC_BLOCK)); 710 IDS_ALLOWED_MEDIASTREAM_MIC_BLOCK));
711 EXPECT_EQ(0, bubble_content.radio_group.default_item); 711 EXPECT_EQ(0, bubble_content.radio_group.default_item);
712 EXPECT_EQ(1U, bubble_content.media_menus.size()); 712 EXPECT_EQ(1U, bubble_content.media_menus.size());
713 EXPECT_EQ(content::MEDIA_DEVICE_AUDIO_CAPTURE, 713 EXPECT_EQ(content::MEDIA_DEVICE_AUDIO_CAPTURE,
714 bubble_content.media_menus.begin()->first); 714 bubble_content.media_menus.begin()->first);
715 715
(...skipping 11 matching lines...) Expand all
727 NULL, web_contents(), profile(), 727 NULL, web_contents(), profile(),
728 CONTENT_SETTINGS_TYPE_MEDIASTREAM)); 728 CONTENT_SETTINGS_TYPE_MEDIASTREAM));
729 const ContentSettingBubbleModel::BubbleContent& new_bubble_content = 729 const ContentSettingBubbleModel::BubbleContent& new_bubble_content =
730 content_setting_bubble_model->bubble_content(); 730 content_setting_bubble_model->bubble_content();
731 EXPECT_EQ(new_bubble_content.title, 731 EXPECT_EQ(new_bubble_content.title,
732 l10n_util::GetStringUTF8(IDS_MICROPHONE_CAMERA_ALLOWED)); 732 l10n_util::GetStringUTF8(IDS_MICROPHONE_CAMERA_ALLOWED));
733 EXPECT_EQ(2U, new_bubble_content.radio_group.radio_items.size()); 733 EXPECT_EQ(2U, new_bubble_content.radio_group.radio_items.size());
734 EXPECT_EQ(new_bubble_content.radio_group.radio_items[0], 734 EXPECT_EQ(new_bubble_content.radio_group.radio_items[0],
735 l10n_util::GetStringFUTF8( 735 l10n_util::GetStringFUTF8(
736 IDS_ALLOWED_MEDIASTREAM_MIC_AND_CAMERA_NO_ACTION, 736 IDS_ALLOWED_MEDIASTREAM_MIC_AND_CAMERA_NO_ACTION,
737 secure_display::FormatUrlForSecurityDisplay( 737 url_formatter::FormatUrlForSecurityDisplay(
738 security_origin, profile()->GetPrefs()->GetString( 738 security_origin, profile()->GetPrefs()->GetString(
739 prefs::kAcceptLanguages)))); 739 prefs::kAcceptLanguages))));
740 EXPECT_EQ(new_bubble_content.radio_group.radio_items[1], 740 EXPECT_EQ(new_bubble_content.radio_group.radio_items[1],
741 l10n_util::GetStringUTF8( 741 l10n_util::GetStringUTF8(
742 IDS_ALLOWED_MEDIASTREAM_MIC_AND_CAMERA_BLOCK)); 742 IDS_ALLOWED_MEDIASTREAM_MIC_AND_CAMERA_BLOCK));
743 EXPECT_EQ(0, new_bubble_content.radio_group.default_item); 743 EXPECT_EQ(0, new_bubble_content.radio_group.default_item);
744 EXPECT_EQ(2U, new_bubble_content.media_menus.size()); 744 EXPECT_EQ(2U, new_bubble_content.media_menus.size());
745 } 745 }
746 746
747 TEST_F(ContentSettingBubbleModelTest, Plugins) { 747 TEST_F(ContentSettingBubbleModelTest, Plugins) {
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
965 { 965 {
966 ProtocolHandler handler = registry.GetHandlerFor("mailto"); 966 ProtocolHandler handler = registry.GetHandlerFor("mailto");
967 ASSERT_FALSE(handler.IsEmpty()); 967 ASSERT_FALSE(handler.IsEmpty());
968 EXPECT_EQ(CONTENT_SETTING_ALLOW, 968 EXPECT_EQ(CONTENT_SETTING_ALLOW,
969 content_settings->pending_protocol_handler_setting()); 969 content_settings->pending_protocol_handler_setting());
970 EXPECT_FALSE(registry.IsIgnored(test_handler)); 970 EXPECT_FALSE(registry.IsIgnored(test_handler));
971 } 971 }
972 972
973 registry.Shutdown(); 973 registry.Shutdown();
974 } 974 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698