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

Unified Diff: chrome/browser/policy/policy_browsertest.cc

Issue 2214393003: Change network error titles to just the hostname (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix merge conflict Created 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/policy/policy_browsertest.cc
diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc
index 74a0479a9b1399ed267add69da21ba0ad7f4babd..acdd3199584eb5273ae333acaa7c1539fcaeff4a 100644
--- a/chrome/browser/policy/policy_browsertest.cc
+++ b/chrome/browser/policy/policy_browsertest.cc
@@ -377,10 +377,15 @@ void CheckCanOpenURL(Browser* browser, const char* spec) {
content::WebContents* contents =
browser->tab_strip_model()->GetActiveWebContents();
EXPECT_EQ(url, contents->GetURL());
- base::string16 spec16 = base::UTF8ToUTF16(url.spec());
- base::string16 title =
- l10n_util::GetStringFUTF16(IDS_ERRORPAGES_TITLE_BLOCKED, spec16);
- EXPECT_NE(title, contents->GetTitle());
+
+ base::string16 blocked_page_title;
+ if (url.has_host()) {
+ blocked_page_title = base::UTF8ToUTF16(url.host());
+ } else {
+ // Local file paths show the full URL.
+ blocked_page_title = base::UTF8ToUTF16(url.spec());
+ }
+ EXPECT_NE(blocked_page_title, contents->GetTitle());
}
// Verifies that access to the given url |spec| is blocked.
@@ -390,10 +395,15 @@ void CheckURLIsBlocked(Browser* browser, const char* spec) {
content::WebContents* contents =
browser->tab_strip_model()->GetActiveWebContents();
EXPECT_EQ(url, contents->GetURL());
- base::string16 spec16 = base::UTF8ToUTF16(url.spec());
- base::string16 title =
- l10n_util::GetStringFUTF16(IDS_ERRORPAGES_TITLE_BLOCKED, spec16);
- EXPECT_EQ(title, contents->GetTitle());
+
+ base::string16 blocked_page_title;
+ if (url.has_host()) {
+ blocked_page_title = base::UTF8ToUTF16(url.host());
+ } else {
+ // Local file paths show the full URL.
+ blocked_page_title = base::UTF8ToUTF16(url.spec());
+ }
+ EXPECT_EQ(blocked_page_title, contents->GetTitle());
// Verify that the expected error page is being displayed.
bool result = false;
« no previous file with comments | « chrome/browser/content_settings/content_settings_browsertest.cc ('k') | components/error_page/common/localized_error.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698