Chromium Code Reviews| Index: chrome/browser/ui/browser_navigator_browsertest.cc |
| =================================================================== |
| --- chrome/browser/ui/browser_navigator_browsertest.cc (revision 156197) |
| +++ chrome/browser/ui/browser_navigator_browsertest.cc (working copy) |
| @@ -40,8 +40,7 @@ |
| } |
| GURL GetSettingsURL() { |
| - return GURL(chrome::kChromeUIUberURL).Resolve( |
| - chrome::kChromeUISettingsHost + std::string("/")); |
| + return GURL(chrome::kChromeUISettingsURL); |
| } |
| GURL GetContentSettingsURL() { |
| @@ -52,6 +51,16 @@ |
| return GetSettingsURL().Resolve(chrome::kClearBrowserDataSubPage); |
| } |
| +GURL ShortenUberURL(const GURL& url) { |
|
Alexei Svitkine (slow)
2012/09/14 14:15:27
Nit. Add a comment.
Cem Kocagil
2012/09/17 18:28:40
Done.
|
| + std::string url_string = url.spec(); |
| + const std::string long_prefix = "chrome://chrome/"; |
| + const std::string short_prefix = "chrome://"; |
| + if (url_string.find(long_prefix) != 0) |
| + return url; |
| + url_string.replace(0, long_prefix.length(), short_prefix); |
| + return GURL(url_string); |
| +} |
| + |
| } // namespace |
| chrome::NavigateParams BrowserNavigatorTest::MakeNavigateParams() const { |
| @@ -722,7 +731,7 @@ |
| EXPECT_EQ(3, browser()->tab_count()); |
| EXPECT_EQ(2, browser()->active_index()); |
| EXPECT_EQ(GetContentSettingsURL(), |
| - chrome::GetActiveWebContents(browser())->GetURL()); |
| + ShortenUberURL(chrome::GetActiveWebContents(browser())->GetURL())); |
| } |
| // This test verifies that constructing params with disposition = SINGLETON_TAB |
| @@ -755,7 +764,7 @@ |
| EXPECT_EQ(3, browser()->tab_count()); |
| EXPECT_EQ(1, browser()->active_index()); |
| EXPECT_EQ(GetContentSettingsURL(), |
| - chrome::GetActiveWebContents(browser())->GetURL()); |
| + ShortenUberURL(chrome::GetActiveWebContents(browser())->GetURL())); |
| } |
| // This test verifies that constructing params with disposition = SINGLETON_TAB |
| @@ -788,7 +797,7 @@ |
| EXPECT_EQ(3, browser()->tab_count()); |
| EXPECT_EQ(1, browser()->active_index()); |
| EXPECT_EQ(GetClearBrowsingDataURL(), |
| - chrome::GetActiveWebContents(browser())->GetURL()); |
| + ShortenUberURL(chrome::GetActiveWebContents(browser())->GetURL())); |
| } |
| // This test verifies that constructing params with disposition = SINGLETON_TAB |
| @@ -820,7 +829,7 @@ |
| EXPECT_EQ(3, browser()->tab_count()); |
| EXPECT_EQ(1, browser()->active_index()); |
| EXPECT_EQ(singleton_url1, |
| - chrome::GetActiveWebContents(browser())->GetURL()); |
| + ShortenUberURL(chrome::GetActiveWebContents(browser())->GetURL())); |
| } |
| // This test verifies that constructing params with disposition = SINGLETON_TAB |
| @@ -851,7 +860,7 @@ |
| EXPECT_EQ(2, browser()->tab_count()); |
| EXPECT_EQ(1, browser()->active_index()); |
| EXPECT_EQ(singleton_url_target, |
| - chrome::GetActiveWebContents(browser())->GetURL()); |
| + ShortenUberURL(chrome::GetActiveWebContents(browser())->GetURL())); |
| } |
| // This test verifies that constructing params with disposition = SINGLETON_TAB |
| @@ -910,7 +919,7 @@ |
| EXPECT_EQ(1u, BrowserList::size()); |
| EXPECT_EQ(GetSettingsURL(), |
| - chrome::GetActiveWebContents(browser())->GetURL()); |
| + ShortenUberURL(chrome::GetActiveWebContents(browser())->GetURL())); |
| } |
| // Settings page is expected to always open in normal mode regardless |
| @@ -994,7 +1003,7 @@ |
| } |
| EXPECT_EQ(1, browser()->tab_count()); |
| EXPECT_EQ(GetSettingsURL(), |
| - chrome::GetActiveWebContents(browser())->GetURL()); |
| + ShortenUberURL(chrome::GetActiveWebContents(browser())->GetURL())); |
| } |
| IN_PROC_BROWSER_TEST_F(BrowserNavigatorTest, |
| @@ -1012,7 +1021,7 @@ |
| } |
| EXPECT_EQ(1, browser()->tab_count()); |
| EXPECT_EQ(GetSettingsURL(), |
| - chrome::GetActiveWebContents(browser())->GetURL()); |
| + ShortenUberURL(chrome::GetActiveWebContents(browser())->GetURL())); |
| } |
| IN_PROC_BROWSER_TEST_F(BrowserNavigatorTest, |
| @@ -1033,7 +1042,7 @@ |
| } |
| EXPECT_EQ(1, browser()->tab_count()); |
| EXPECT_EQ(GetSettingsURL(), |
| - chrome::GetActiveWebContents(browser())->GetURL()); |
| + ShortenUberURL(chrome::GetActiveWebContents(browser())->GetURL())); |
| } |
| IN_PROC_BROWSER_TEST_F(BrowserNavigatorTest, |
| @@ -1053,7 +1062,7 @@ |
| } |
| EXPECT_EQ(2, browser()->tab_count()); |
| EXPECT_EQ(GetSettingsURL(), |
| - chrome::GetActiveWebContents(browser())->GetURL()); |
| + ShortenUberURL(chrome::GetActiveWebContents(browser())->GetURL())); |
| } |
| IN_PROC_BROWSER_TEST_F(BrowserNavigatorTest, |
| @@ -1079,7 +1088,7 @@ |
| } |
| EXPECT_EQ(2, browser()->tab_count()); |
| EXPECT_EQ(GetSettingsURL(), |
| - chrome::GetActiveWebContents(browser())->GetURL()); |
| + ShortenUberURL(chrome::GetActiveWebContents(browser())->GetURL())); |
| } |
| IN_PROC_BROWSER_TEST_F(BrowserNavigatorTest, |
| @@ -1144,7 +1153,7 @@ |
| } |
| EXPECT_EQ(2, browser()->tab_count()); |
| EXPECT_EQ(GetSettingsURL(), |
| - chrome::GetActiveWebContents(browser())->GetURL()); |
| + ShortenUberURL(chrome::GetActiveWebContents(browser())->GetURL())); |
| } |
| // Tests that when a new tab is opened from the omnibox, the focus is moved from |