Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Unified Diff: chrome/browser/ui/browser_navigator_browsertest.cc

Issue 10696222: Make chrome::Navigate take in a Browser* that is never NULL. That function doesn't have a context, … (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/browser_navigator.cc ('k') | chrome/browser/ui/intents/web_intent_picker_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_navigator_browsertest.cc
===================================================================
--- chrome/browser/ui/browser_navigator_browsertest.cc (revision 146674)
+++ chrome/browser/ui/browser_navigator_browsertest.cc (working copy)
@@ -696,62 +696,6 @@
EXPECT_EQ(2, browser()->tab_count());
}
-// This test verifies that constructing params with a NULL browser has
-// the same result as navigating to a new foreground tab in the (only)
-// active browser. Tests are the same as for Disposition_NewForegroundTab.
-IN_PROC_BROWSER_TEST_F(BrowserNavigatorTest, NullBrowser_NewForegroundTab) {
- WebContents* old_contents = chrome::GetActiveWebContents(browser());
- // Navigate with a NULL browser.
- chrome::NavigateParams p(MakeNavigateParams(NULL));
- p.disposition = NEW_FOREGROUND_TAB;
- p.profile = browser()->profile();
- chrome::Navigate(&p);
-
- // Navigate() should have found browser() and create a new tab.
- EXPECT_EQ(browser(), p.browser);
- EXPECT_NE(old_contents, chrome::GetActiveWebContents(browser()));
- EXPECT_EQ(chrome::GetActiveTabContents(browser()), p.target_contents);
- EXPECT_EQ(2, browser()->tab_count());
-}
-
-// This test verifies that constructing params with a NULL browser and
-// a specific profile matches the specified profile.
-IN_PROC_BROWSER_TEST_F(BrowserNavigatorTest, NullBrowser_MatchProfile) {
- // Create a new browser with using the incognito profile.
- Browser* incognito =
- Browser::Create(browser()->profile()->GetOffTheRecordProfile());
-
- // Navigate with a NULL browser and the incognito profile.
- chrome::NavigateParams p(MakeNavigateParams(NULL));
- p.disposition = NEW_FOREGROUND_TAB;
- p.profile = incognito->profile();
- chrome::Navigate(&p);
-
- // Navigate() should have found incognito, not browser().
- EXPECT_EQ(incognito, p.browser);
- EXPECT_EQ(chrome::GetActiveTabContents(incognito), p.target_contents);
- EXPECT_EQ(1, incognito->tab_count());
-}
-
-// This test verifies that constructing params with a NULL browser and
-// disposition = NEW_WINDOW always opens exactly one new window.
-IN_PROC_BROWSER_TEST_F(BrowserNavigatorTest, NullBrowser_NewWindow) {
- chrome::NavigateParams p(MakeNavigateParams(NULL));
- p.disposition = NEW_WINDOW;
- p.profile = browser()->profile();
- chrome::Navigate(&p);
-
- // Navigate() should have created a new browser.
- EXPECT_NE(browser(), p.browser);
- EXPECT_TRUE( p.browser->is_type_tabbed());
-
- // We should now have two windows, the browser() provided by the framework and
- // the new normal window.
- EXPECT_EQ(2u, BrowserList::size());
- EXPECT_EQ(1, browser()->tab_count());
- EXPECT_EQ(1, p.browser->tab_count());
-}
-
// This test verifies that constructing params with disposition = SINGLETON_TAB
// and IGNORE_AND_NAVIGATE opens a new tab navigated to the specified URL if
// no previous tab with that URL (minus the path) exists.
« no previous file with comments | « chrome/browser/ui/browser_navigator.cc ('k') | chrome/browser/ui/intents/web_intent_picker_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698