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

Side by Side Diff: chrome/browser/ui/browser_browsertest.cc

Issue 187443008: Elim Browser::AppType (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <string> 5 #include <string>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 1950 matching lines...) Expand 10 before | Expand all | Expand 10 after
1961 EXPECT_EQ(popup_browser, params1.target); 1961 EXPECT_EQ(popup_browser, params1.target);
1962 1962
1963 // The popup should still only have one tab. 1963 // The popup should still only have one tab.
1964 EXPECT_EQ(1, popup_browser->tab_strip_model()->count()); 1964 EXPECT_EQ(1, popup_browser->tab_strip_model()->count());
1965 1965
1966 // The normal browser should now have two. 1966 // The normal browser should now have two.
1967 EXPECT_EQ(2, browser()->tab_strip_model()->count()); 1967 EXPECT_EQ(2, browser()->tab_strip_model()->count());
1968 1968
1969 // Open an app frame browser with a single blank foreground tab. 1969 // Open an app frame browser with a single blank foreground tab.
1970 Browser* app_browser = new Browser(Browser::CreateParams::CreateForApp( 1970 Browser* app_browser = new Browser(Browser::CreateParams::CreateForApp(
1971 L"Test", browser()->profile(), false)); 1971 Browser::TYPE_POPUP, L"Test", browser()->profile(), false));
1972 chrome::AddTabAt(app_browser, GURL(), -1, true); 1972 chrome::AddTabAt(app_browser, GURL(), -1, true);
1973 EXPECT_EQ(1, app_browser->tab_strip_model()->count()); 1973 EXPECT_EQ(1, app_browser->tab_strip_model()->count());
1974 1974
1975 // Now try opening another tab in the app browser. 1975 // Now try opening another tab in the app browser.
1976 AddTabWithURLParams params2(GURL(content::kAboutBlankURL), 1976 AddTabWithURLParams params2(GURL(content::kAboutBlankURL),
1977 content::PAGE_TRANSITION_TYPED); 1977 content::PAGE_TRANSITION_TYPED);
1978 app_browser->AddTabWithURL(&params2); 1978 app_browser->AddTabWithURL(&params2);
1979 EXPECT_EQ(app_browser, params2.target); 1979 EXPECT_EQ(app_browser, params2.target);
1980 1980
1981 // The popup should still only have one tab. 1981 // The popup should still only have one tab.
1982 EXPECT_EQ(1, app_browser->tab_strip_model()->count()); 1982 EXPECT_EQ(1, app_browser->tab_strip_model()->count());
1983 1983
1984 // The normal browser should now have three. 1984 // The normal browser should now have three.
1985 EXPECT_EQ(3, browser()->tab_strip_model()->count()); 1985 EXPECT_EQ(3, browser()->tab_strip_model()->count());
1986 1986
1987 // Open an app frame popup browser with a single blank foreground tab. 1987 // Open an app frame popup browser with a single blank foreground tab.
1988 Browser* app_popup_browser = new Browser(Browser::CreateParams::CreateForApp( 1988 Browser* app_popup_browser = new Browser(Browser::CreateParams::CreateForApp(
1989 L"Test", browser()->profile(), false)); 1989 Browser::TYPE_POPUP, L"Test", browser()->profile(), false));
1990 chrome::AddTabAt(app_popup_browser, GURL(), -1, true); 1990 chrome::AddTabAt(app_popup_browser, GURL(), -1, true);
1991 EXPECT_EQ(1, app_popup_browser->tab_strip_model()->count()); 1991 EXPECT_EQ(1, app_popup_browser->tab_strip_model()->count());
1992 1992
1993 // Now try opening another tab in the app popup browser. 1993 // Now try opening another tab in the app popup browser.
1994 AddTabWithURLParams params3(GURL(content::kAboutBlankURL), 1994 AddTabWithURLParams params3(GURL(content::kAboutBlankURL),
1995 content::PAGE_TRANSITION_TYPED); 1995 content::PAGE_TRANSITION_TYPED);
1996 app_popup_browser->AddTabWithURL(&params3); 1996 app_popup_browser->AddTabWithURL(&params3);
1997 EXPECT_EQ(app_popup_browser, params3.target); 1997 EXPECT_EQ(app_popup_browser, params3.target);
1998 1998
1999 // The popup should still only have one tab. 1999 // The popup should still only have one tab.
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
2564 exp_commit_size.Enlarge(wcv_resize_insets.width(), 2564 exp_commit_size.Enlarge(wcv_resize_insets.width(),
2565 wcv_resize_insets.height() + height_inset); 2565 wcv_resize_insets.height() + height_inset);
2566 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); 2566 EXPECT_EQ(exp_commit_size, rwhv_commit_size2);
2567 EXPECT_EQ(exp_commit_size, wcv_commit_size2); 2567 EXPECT_EQ(exp_commit_size, wcv_commit_size2);
2568 // Sizes of RenderWidgetHostView and WebContentsView before and after 2568 // Sizes of RenderWidgetHostView and WebContentsView before and after
2569 // WebContentsDelegate::DidNavigateMainFramePostCommit should be the same. 2569 // WebContentsDelegate::DidNavigateMainFramePostCommit should be the same.
2570 EXPECT_EQ(rwhv_commit_size2, 2570 EXPECT_EQ(rwhv_commit_size2,
2571 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); 2571 web_contents->GetRenderWidgetHostView()->GetViewBounds().size());
2572 EXPECT_EQ(wcv_commit_size2, web_contents->GetView()->GetContainerSize()); 2572 EXPECT_EQ(wcv_commit_size2, web_contents->GetView()->GetContainerSize());
2573 } 2573 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698