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

Unified Diff: chrome/browser/ui/content_settings/content_setting_bubble_model_unittest.cc

Issue 1147363005: Create FormatUrlForSecurityDisplay helper function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change testing strategy, respond to comments. Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/content_settings/content_setting_bubble_model.cc ('k') | chrome/browser/ui/elide_url.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/content_settings/content_setting_bubble_model_unittest.cc
diff --git a/chrome/browser/ui/content_settings/content_setting_bubble_model_unittest.cc b/chrome/browser/ui/content_settings/content_setting_bubble_model_unittest.cc
index df3602d6716785ed5c2289ffb0106abf2e2fec53..961332f9d7ecc6da90ee4b189900f3600969b353 100644
--- a/chrome/browser/ui/content_settings/content_setting_bubble_model_unittest.cc
+++ b/chrome/browser/ui/content_settings/content_setting_bubble_model_unittest.cc
@@ -13,6 +13,7 @@
#include "chrome/browser/media/media_stream_capture_indicator.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/content_settings/content_setting_bubble_model.h"
+#include "chrome/browser/ui/elide_url.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "chrome/grit/generated_resources.h"
@@ -153,7 +154,9 @@ TEST_F(ContentSettingBubbleModelTest, MediastreamMicAndCamera) {
EXPECT_EQ(bubble_content.radio_group.radio_items[0],
l10n_util::GetStringFUTF8(
IDS_ALLOWED_MEDIASTREAM_MIC_AND_CAMERA_NO_ACTION,
- base::UTF8ToUTF16(request_host)));
+ FormatUrlForSecurityDisplay(security_origin,
+ profile()->GetPrefs()->GetString(
+ prefs::kAcceptLanguages))));
EXPECT_EQ(bubble_content.radio_group.radio_items[1],
l10n_util::GetStringUTF8(
IDS_ALLOWED_MEDIASTREAM_MIC_AND_CAMERA_BLOCK));
@@ -536,7 +539,9 @@ TEST_F(ContentSettingBubbleModelTest, MediastreamMic) {
EXPECT_EQ(bubble_content.radio_group.radio_items[0],
l10n_util::GetStringFUTF8(
IDS_ALLOWED_MEDIASTREAM_MIC_NO_ACTION,
- base::UTF8ToUTF16(request_host)));
+ FormatUrlForSecurityDisplay(security_origin,
+ profile()->GetPrefs()->GetString(
+ prefs::kAcceptLanguages))));
EXPECT_EQ(bubble_content.radio_group.radio_items[1],
l10n_util::GetStringUTF8(
IDS_ALLOWED_MEDIASTREAM_MIC_BLOCK));
@@ -568,7 +573,9 @@ TEST_F(ContentSettingBubbleModelTest, MediastreamMic) {
EXPECT_EQ(new_bubble_content.radio_group.radio_items[0],
l10n_util::GetStringFUTF8(
IDS_BLOCKED_MEDIASTREAM_MIC_ASK,
- base::UTF8ToUTF16(request_host)));
+ FormatUrlForSecurityDisplay(security_origin,
+ profile()->GetPrefs()->GetString(
+ prefs::kAcceptLanguages))));
EXPECT_EQ(new_bubble_content.radio_group.radio_items[1],
l10n_util::GetStringUTF8(
IDS_BLOCKED_MEDIASTREAM_MIC_NO_ACTION));
@@ -611,7 +618,9 @@ TEST_F(ContentSettingBubbleModelTest, MediastreamCamera) {
EXPECT_EQ(bubble_content.radio_group.radio_items[0],
l10n_util::GetStringFUTF8(
IDS_ALLOWED_MEDIASTREAM_CAMERA_NO_ACTION,
- base::UTF8ToUTF16(request_host)));
+ FormatUrlForSecurityDisplay(security_origin,
+ profile()->GetPrefs()->GetString(
+ prefs::kAcceptLanguages))));
EXPECT_EQ(bubble_content.radio_group.radio_items[1],
l10n_util::GetStringUTF8(
IDS_ALLOWED_MEDIASTREAM_CAMERA_BLOCK));
@@ -643,7 +652,9 @@ TEST_F(ContentSettingBubbleModelTest, MediastreamCamera) {
EXPECT_EQ(new_bubble_content.radio_group.radio_items[0],
l10n_util::GetStringFUTF8(
IDS_BLOCKED_MEDIASTREAM_CAMERA_ASK,
- base::UTF8ToUTF16(request_host)));
+ FormatUrlForSecurityDisplay(security_origin,
+ profile()->GetPrefs()->GetString(
+ prefs::kAcceptLanguages))));
EXPECT_EQ(new_bubble_content.radio_group.radio_items[1],
l10n_util::GetStringUTF8(
IDS_BLOCKED_MEDIASTREAM_CAMERA_NO_ACTION));
@@ -688,7 +699,9 @@ TEST_F(ContentSettingBubbleModelTest, AccumulateMediastreamMicAndCamera) {
EXPECT_EQ(bubble_content.radio_group.radio_items[0],
l10n_util::GetStringFUTF8(
IDS_ALLOWED_MEDIASTREAM_MIC_NO_ACTION,
- base::UTF8ToUTF16(request_host)));
+ FormatUrlForSecurityDisplay(security_origin,
+ profile()->GetPrefs()->GetString(
+ prefs::kAcceptLanguages))));
EXPECT_EQ(bubble_content.radio_group.radio_items[1],
l10n_util::GetStringUTF8(
IDS_ALLOWED_MEDIASTREAM_MIC_BLOCK));
@@ -718,7 +731,9 @@ TEST_F(ContentSettingBubbleModelTest, AccumulateMediastreamMicAndCamera) {
EXPECT_EQ(new_bubble_content.radio_group.radio_items[0],
l10n_util::GetStringFUTF8(
IDS_ALLOWED_MEDIASTREAM_MIC_AND_CAMERA_NO_ACTION,
- base::UTF8ToUTF16(request_host)));
+ FormatUrlForSecurityDisplay(security_origin,
+ profile()->GetPrefs()->GetString(
+ prefs::kAcceptLanguages))));
EXPECT_EQ(new_bubble_content.radio_group.radio_items[1],
l10n_util::GetStringUTF8(
IDS_ALLOWED_MEDIASTREAM_MIC_AND_CAMERA_BLOCK));
« no previous file with comments | « chrome/browser/ui/content_settings/content_setting_bubble_model.cc ('k') | chrome/browser/ui/elide_url.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698