Index: chrome/browser/ui/webui/ntp/new_tab_ui_browsertest.cc |
=================================================================== |
--- chrome/browser/ui/webui/ntp/new_tab_ui_browsertest.cc (revision 145001) |
+++ chrome/browser/ui/webui/ntp/new_tab_ui_browsertest.cc (working copy) |
@@ -5,6 +5,7 @@ |
#include "base/command_line.h" |
#include "chrome/browser/ui/browser.h" |
#include "chrome/browser/ui/browser_commands.h" |
+#include "chrome/browser/ui/browser_tabstrip.h" |
#include "chrome/common/chrome_switches.h" |
#include "chrome/common/url_constants.h" |
#include "chrome/test/base/in_process_browser_test.h" |
@@ -34,7 +35,7 @@ |
ui_test_utils::NavigateToURL(browser(), GURL("chrome-internal:")); |
bool empty_inner_html = false; |
ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( |
- browser()->GetWebContentsAt(0)->GetRenderViewHost(), L"", |
+ chrome::GetWebContentsAt(browser(), 0)->GetRenderViewHost(), L"", |
L"window.domAutomationController.send(document.body.innerHTML == '')", |
&empty_inner_html)); |
ASSERT_FALSE(empty_inner_html); |
@@ -53,7 +54,7 @@ |
ui_test_utils::NavigateToURLWithDisposition( |
browser(), GURL(chrome::kChromeUINewTabURL), NEW_FOREGROUND_TAB, |
ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
- EXPECT_EQ(1, browser()->GetWebContentsAt(1)->GetMaxPageID()); |
+ EXPECT_EQ(1, chrome::GetWebContentsAt(browser(), 1)->GetMaxPageID()); |
// Navigate that tab to another site. This allows the NTP process to exit, |
// but it keeps the NTP SiteInstance (and its max_page_id) alive in history. |
@@ -74,27 +75,27 @@ |
ui_test_utils::NavigateToURLWithDisposition( |
browser(), GURL(chrome::kChromeUINewTabURL), NEW_FOREGROUND_TAB, |
ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
- EXPECT_EQ(1, browser()->GetWebContentsAt(2)->GetMaxPageID()); |
+ EXPECT_EQ(1, chrome::GetWebContentsAt(browser(), 2)->GetMaxPageID()); |
chrome::CloseTab(browser()); |
// Open another Web UI page in a new tab. |
ui_test_utils::NavigateToURLWithDisposition( |
browser(), GURL(chrome::kChromeUISettingsURL), NEW_FOREGROUND_TAB, |
ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
- EXPECT_EQ(1, browser()->GetWebContentsAt(2)->GetMaxPageID()); |
+ EXPECT_EQ(1, chrome::GetWebContentsAt(browser(), 2)->GetMaxPageID()); |
// At this point, opening another NTP will use the existing WebUI process |
// but its own SiteInstance, so the page IDs shouldn't affect each other. |
ui_test_utils::NavigateToURLWithDisposition( |
browser(), GURL(chrome::kChromeUINewTabURL), NEW_FOREGROUND_TAB, |
ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
- EXPECT_EQ(1, browser()->GetWebContentsAt(3)->GetMaxPageID()); |
+ EXPECT_EQ(1, chrome::GetWebContentsAt(browser(), 3)->GetMaxPageID()); |
// Navigating to the NTP in the original tab causes a BrowsingInstance |
// swap, so it gets a new SiteInstance starting with page ID 1 again. |
- browser()->ActivateTabAt(1, true); |
+ chrome::ActivateTabAt(browser(), 1, true); |
ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUINewTabURL)); |
- EXPECT_EQ(1, browser()->GetWebContentsAt(1)->GetMaxPageID()); |
+ EXPECT_EQ(1, chrome::GetWebContentsAt(browser(), 1)->GetMaxPageID()); |
} |
// Loads chrome://hang/ into two NTP tabs, ensuring we don't crash. |