Chromium Code Reviews| Index: chrome/browser/ui/browser_focus_uitest.cc |
| diff --git a/chrome/browser/ui/browser_focus_uitest.cc b/chrome/browser/ui/browser_focus_uitest.cc |
| index 142b522a2f57f1115904b454efc30aaabd8ba406..50d56213e7d2a1780d321f793b305d75af5b0845 100644 |
| --- a/chrome/browser/ui/browser_focus_uitest.cc |
| +++ b/chrome/browser/ui/browser_focus_uitest.cc |
| @@ -738,4 +738,28 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, DISABLED_FocusOnNavigate) { |
| EXPECT_FALSE(IsViewFocused(VIEW_ID_OMNIBOX)); |
| } |
| +// Ensure that crbug.com/567445 does not regress. |
| +IN_PROC_BROWSER_TEST_F(BrowserFocusTest, AboutBlankNavigationLocationTest) { |
| + ui_test_utils::NavigateToURL(browser(), |
| + embedded_test_server()->GetURL("/title1.html")); |
| + |
| + const char kSpoofScript[] = |
| + "var w = window.open('about:blank');" |
| + "w.opener = null;" |
| + "w.document.location = '%s';"; |
| + |
| + TabStripModel* tab_strip = browser()->tab_strip_model(); |
| + WebContents* web_contents = tab_strip->GetActiveWebContents(); |
| + |
| + ASSERT_TRUE(content::ExecuteScript( |
| + web_contents, |
| + base::StringPrintf( |
| + kSpoofScript, |
| + embedded_test_server()->GetURL("/title2.html").spec().c_str()))); |
| + EXPECT_FALSE(web_contents->GetController().GetPendingEntry()); |
|
Charlie Reis
2016/02/12 23:43:47
I don't think you don't need this line. Technical
palmer
2016/02/23 00:37:59
Done.
|
| + EXPECT_EQ(embedded_test_server()->GetURL("/title1.html"), |
| + web_contents->GetVisibleURL()); |
|
Charlie Reis
2016/02/12 23:43:47
Hmm, this isn't the WebContents where the spoof ha
palmer
2016/02/23 00:37:59
Following the example of other code in this file,
|
| + EXPECT_FALSE(IsViewFocused(VIEW_ID_OMNIBOX)); |
|
Charlie Reis
2016/02/12 23:43:47
Which window is this checking? Is the test openin
palmer
2016/02/23 00:37:59
I think the core problem is that the Omnibox is fo
|
| +} |
| + |
| } // namespace |