Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 731 content::WindowedNotificationObserver forward_nav_observer( | 731 content::WindowedNotificationObserver forward_nav_observer( |
| 732 content::NOTIFICATION_NAV_ENTRY_COMMITTED, | 732 content::NOTIFICATION_NAV_ENTRY_COMMITTED, |
| 733 content::NotificationService::AllSources()); | 733 content::NotificationService::AllSources()); |
| 734 chrome::GoForward(browser(), CURRENT_TAB); | 734 chrome::GoForward(browser(), CURRENT_TAB); |
| 735 forward_nav_observer.Wait(); | 735 forward_nav_observer.Wait(); |
| 736 } | 736 } |
| 737 | 737 |
| 738 EXPECT_FALSE(IsViewFocused(VIEW_ID_OMNIBOX)); | 738 EXPECT_FALSE(IsViewFocused(VIEW_ID_OMNIBOX)); |
| 739 } | 739 } |
| 740 | 740 |
| 741 // Ensure that crbug.com/567445 does not regress. | |
| 742 IN_PROC_BROWSER_TEST_F(BrowserFocusTest, AboutBlankNavigationLocationTest) { | |
| 743 ui_test_utils::NavigateToURL(browser(), | |
| 744 embedded_test_server()->GetURL("/title1.html")); | |
| 745 | |
| 746 const char kSpoofScript[] = | |
| 747 "var w = window.open('about:blank');" | |
| 748 "w.opener = null;" | |
| 749 "w.document.location = '%s';"; | |
| 750 | |
| 751 TabStripModel* tab_strip = browser()->tab_strip_model(); | |
| 752 WebContents* web_contents = tab_strip->GetActiveWebContents(); | |
| 753 | |
| 754 ASSERT_TRUE(content::ExecuteScript( | |
| 755 web_contents, | |
| 756 base::StringPrintf( | |
| 757 kSpoofScript, | |
| 758 embedded_test_server()->GetURL("/title2.html").spec().c_str()))); | |
| 759 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.
| |
| 760 EXPECT_EQ(embedded_test_server()->GetURL("/title1.html"), | |
| 761 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,
| |
| 762 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
| |
| 763 } | |
| 764 | |
| 741 } // namespace | 765 } // namespace |
| OLD | NEW |