diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-05 15:58:55 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-05 15:58:55 +0000 |
commit | cecc93a46dd560fe4157af3d098092eb395324d3 (patch) | |
tree | 18e511cec0772c03f0109bb8a24bd9ad95a4e3fd /chrome/browser/browser_focus_uitest.cc | |
parent | 07efbd20cead99d9b46df250e6e562bf1696cd4b (diff) | |
download | chromium_src-cecc93a46dd560fe4157af3d098092eb395324d3.zip chromium_src-cecc93a46dd560fe4157af3d098092eb395324d3.tar.gz chromium_src-cecc93a46dd560fe4157af3d098092eb395324d3.tar.bz2 |
Replace Browser::AddTabWithURL(...) with:
- Browser::AddSelectedTabWithURL(const GURL& url, PageTransition::Type transition)
-> A good many callsites just wanted a way to open a tab somewhere and select it.
- Browser::AddTabWithURL(AddTabWithURLParams* params)
-> For the callsites with specialized needs, this new signature allows the parameter set to change as features are added without having to update a bunch of callers every time.
BUG=none
TEST=existing unit tests
Review URL: http://codereview.chromium.org/3599006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61517 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_focus_uitest.cc')
-rw-r--r-- | chrome/browser/browser_focus_uitest.cc | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/chrome/browser/browser_focus_uitest.cc b/chrome/browser/browser_focus_uitest.cc index 90a3b19..43b18ec 100644 --- a/chrome/browser/browser_focus_uitest.cc +++ b/chrome/browser/browser_focus_uitest.cc @@ -20,6 +20,7 @@ #include "chrome/browser/tabs/tab_strip_model.h" #include "chrome/browser/view_ids.h" #include "chrome/common/chrome_paths.h" +#include "chrome/common/url_constants.h" #include "chrome/test/in_process_browser_test.h" #include "chrome/test/ui_test_utils.h" #include "net/test/test_server.h" @@ -217,11 +218,9 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, TabsRememberFocus) { // Create several tabs. for (int i = 0; i < 4; ++i) { - Browser* browser_used = NULL; - browser()->AddTabWithURL(url, GURL(), PageTransition::TYPED, -1, - TabStripModel::ADD_SELECTED, NULL, std::string(), - &browser_used); - EXPECT_EQ(browser(), browser_used); + Browser::AddTabWithURLParams params(url, PageTransition::TYPED); + browser()->AddTabWithURL(¶ms); + EXPECT_EQ(browser(), params.target); } // Alternate focus for the tab. @@ -297,11 +296,9 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_TabsRememberFocusFindInPage) { browser()->FocusLocationBar(); // Create a 2nd tab. - Browser* browser_used = NULL; - browser()->AddTabWithURL(url, GURL(), PageTransition::TYPED, -1, - TabStripModel::ADD_SELECTED, NULL, std::string(), - &browser_used); - EXPECT_EQ(browser(), browser_used); + Browser::AddTabWithURLParams params(url, PageTransition::TYPED); + browser()->AddTabWithURL(¶ms); + EXPECT_EQ(browser(), params.target); // Focus should be on the recently opened tab page. ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW)); @@ -733,10 +730,8 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FLAKY_TabInitialFocus) { ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW)); // Open about:blank, focus should be on the location bar. - browser()->AddTabWithURL(GURL("about:blank"), GURL(), PageTransition::LINK, - -1, TabStripModel::ADD_SELECTED, NULL, - std::string(), - NULL); + browser()->AddSelectedTabWithURL(GURL(chrome::kAboutBlankURL), + PageTransition::LINK); ASSERT_TRUE(IsViewFocused(VIEW_ID_LOCATION_BAR)); } |