| 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..a39b85bac316b0e1362d0bfcd246800b978c984a 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 filename as the title.
|
| + title = base::UTF8ToUTF16(url.ExtractFileName());
|
| 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 filename as the title.
|
| + title = base::UTF8ToUTF16(url.ExtractFileName());
|
| EXPECT_EQ(title, contents->GetTitle());
|
|
|
| // Verify that the expected error page is being displayed.
|
| @@ -2553,7 +2561,7 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, MAYBE_FileURLBlacklist) {
|
| PathService::Get(chrome::DIR_TEST_DATA, &test_path);
|
| const std::string base_path = "file://" + test_path.AsUTF8Unsafe() +"/";
|
| const std::string folder_path = base_path + "apptest/";
|
| - const std::string file_path1 = base_path + "title1.html";
|
| + const std::string file_path1 = base_path + "title2.html";
|
| const std::string file_path2 = folder_path + "basic.html";
|
|
|
| CheckCanOpenURL(browser(), file_path1.c_str());
|
|
|