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/ssl/ssl_browser_tests.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/ssl/ssl_browser_tests.cc')
| -rw-r--r-- | chrome/browser/ssl/ssl_browser_tests.cc | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/chrome/browser/ssl/ssl_browser_tests.cc b/chrome/browser/ssl/ssl_browser_tests.cc index a897e1b..aad8854 100644 --- a/chrome/browser/ssl/ssl_browser_tests.cc +++ b/chrome/browser/ssl/ssl_browser_tests.cc @@ -329,9 +329,8 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTPSErrorWithNoNavEntry) { ASSERT_TRUE(https_server_expired_.Start()); GURL url = https_server_expired_.GetURL("files/ssl/google.htm"); - TabContents* tab2 = browser()->AddTabWithURL( - url, GURL(), PageTransition::TYPED, -1, TabStripModel::ADD_SELECTED, NULL, - std::string(), NULL); + TabContents* tab2 = + browser()->AddSelectedTabWithURL(url, PageTransition::TYPED); ui_test_utils::WaitForLoadStop(&(tab2->controller())); // Verify our assumption that there was no prior navigation. @@ -450,9 +449,10 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestDisplaysInsecureContentTwoTabs) { // Create a new tab. GURL url = https_server_.GetURL( "files/ssl/page_displays_insecure_content.html"); - TabContents* tab2 = browser()->AddTabWithURL(url, GURL(), - PageTransition::TYPED, 0, TabStripModel::ADD_SELECTED, - tab1->GetSiteInstance(), std::string(), NULL); + Browser::AddTabWithURLParams params(url, PageTransition::TYPED); + params.index = 0; + params.instance = tab1->GetSiteInstance(); + TabContents* tab2 = browser()->AddTabWithURL(¶ms); ui_test_utils::WaitForNavigation(&(tab2->controller())); // The new tab has insecure content. @@ -480,9 +480,9 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestRunsInsecureContentTwoTabs) { // Create a new tab. GURL url = https_server_.GetURL("files/ssl/page_runs_insecure_content.html"); - TabContents* tab2 = browser()->AddTabWithURL(url, GURL(), - PageTransition::TYPED, 0, TabStripModel::ADD_SELECTED, - tab1->GetSiteInstance(), std::string(), NULL); + Browser::AddTabWithURLParams params(url, PageTransition::TYPED); + params.instance = tab1->GetSiteInstance(); + TabContents* tab2 = browser()->AddTabWithURL(¶ms); ui_test_utils::WaitForNavigation(&(tab2->controller())); // The new tab has insecure content. @@ -623,15 +623,13 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestCloseTabWithUnsafePopup) { // Let's add another tab to make sure the browser does not exit when we close // the first tab. - Browser* browser_used = NULL; GURL url = test_server()->GetURL("files/ssl/google.html"); - TabContents* tab2 = browser()->AddTabWithURL( - url, GURL(), PageTransition::TYPED, 0, TabStripModel::ADD_SELECTED, NULL, - std::string(), &browser_used); + Browser::AddTabWithURLParams params(url, PageTransition::TYPED); + TabContents* tab2 = browser()->AddTabWithURL(¶ms); ui_test_utils::WaitForNavigation(&(tab2->controller())); // Ensure that the tab was created in the correct browser. - EXPECT_EQ(browser(), browser_used); + EXPECT_EQ(browser(), params.target); // Close the first tab. browser()->CloseTabContents(tab1); |
