Chromium Code Reviews| Index: chrome/browser/policy/policy_browsertest.cc |
| diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc |
| index 21795486c87fde30f851c01554cabbe20eaa81aa..5a36b122169d462bc152ce17b07830d1cde4e300 100644 |
| --- a/chrome/browser/policy/policy_browsertest.cc |
| +++ b/chrome/browser/policy/policy_browsertest.cc |
| @@ -371,9 +371,13 @@ 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); |
| + |
| + base::string16 title; |
| + if (url.has_host()) |
| + title = base::UTF8ToUTF16(url.host()); |
| + else |
| + // Local file paths show the full URL. |
| + title = base::UTF8ToUTF16(url.spec()); |
|
mmenke
2016/08/08 14:23:49
Use braces on if / else bodies, when one of them t
|
| EXPECT_NE(title, contents->GetTitle()); |
| } |
| @@ -384,9 +388,13 @@ 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); |
| + |
| + base::string16 title; |
| + if (url.has_host()) |
| + title = base::UTF8ToUTF16(url.host()); |
| + else |
| + // Local file paths show the full URL. |
| + title = base::UTF8ToUTF16(url.spec()); |
|
mmenke
2016/08/08 14:23:49
Use braces
|
| EXPECT_EQ(title, contents->GetTitle()); |
| // Verify that the expected error page is being displayed. |