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

Unified Diff: chrome/browser/ui/views/bookmarks/bookmark_bubble_sign_in_delegate_browsertest.cc

Issue 845373002: Change default code flag to NewAvatarMenu. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sky@ comments; shess@ nit Created 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/bookmarks/bookmark_bubble_sign_in_delegate_browsertest.cc
diff --git a/chrome/browser/ui/bookmarks/bookmark_bubble_sign_in_delegate_browsertest.cc b/chrome/browser/ui/views/bookmarks/bookmark_bubble_sign_in_delegate_browsertest.cc
similarity index 68%
rename from chrome/browser/ui/bookmarks/bookmark_bubble_sign_in_delegate_browsertest.cc
rename to chrome/browser/ui/views/bookmarks/bookmark_bubble_sign_in_delegate_browsertest.cc
index 536c1eafb699cfc3328e1b5d552f8087ae1f84b1..ada7a413554ed427989fdc70c56221e2fc51135c 100644
--- a/chrome/browser/ui/bookmarks/bookmark_bubble_sign_in_delegate_browsertest.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bubble_sign_in_delegate_browsertest.cc
@@ -15,6 +15,7 @@
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/singleton_tabs.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
+#include "chrome/browser/ui/views/profiles/profile_chooser_view.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/testing_profile.h"
@@ -23,6 +24,12 @@
#include "ui/events/event_constants.h"
#include "ui/gfx/range/range.h"
+#if defined(OS_CHROMEOS)
+const bool kHasProfileChooser = false;
+#else
+const bool kHasProfileChooser = true;
+#endif
+
class BookmarkBubbleSignInDelegateTest : public InProcessBrowserTest {
public:
BookmarkBubbleSignInDelegateTest() {}
@@ -55,8 +62,12 @@ IN_PROC_BROWSER_TEST_F(BookmarkBubbleSignInDelegateTest, OnSignInLinkClicked) {
delegate->OnSignInLinkClicked();
- // A new tab should have been opened and the browser should be visible.
- EXPECT_EQ(starting_tab_count + 1, browser()->tab_strip_model()->count());
+ if (kHasProfileChooser) {
+ EXPECT_TRUE(ProfileChooserView::IsShowing());
+ EXPECT_EQ(starting_tab_count, browser()->tab_strip_model()->count());
+ } else {
+ EXPECT_EQ(starting_tab_count + 1, browser()->tab_strip_model()->count());
+ }
}
IN_PROC_BROWSER_TEST_F(BookmarkBubbleSignInDelegateTest,
@@ -68,8 +79,12 @@ IN_PROC_BROWSER_TEST_F(BookmarkBubbleSignInDelegateTest,
delegate->OnSignInLinkClicked();
- // A new tab should have been opened and the browser should be visible.
- EXPECT_EQ(starting_tab_count, browser()->tab_strip_model()->count());
+ if (kHasProfileChooser) {
+ EXPECT_TRUE(ProfileChooserView::IsShowing());
+ EXPECT_EQ(starting_tab_count, browser()->tab_strip_model()->count());
+ } else {
+ EXPECT_EQ(starting_tab_count, browser()->tab_strip_model()->count());
+ }
}
IN_PROC_BROWSER_TEST_F(BookmarkBubbleSignInDelegateTest,
@@ -86,14 +101,23 @@ IN_PROC_BROWSER_TEST_F(BookmarkBubbleSignInDelegateTest,
delegate->OnSignInLinkClicked();
- // A new tab should have been opened in the normal browser, which should be
- // visible.
- int tab_count_normal = browser()->tab_strip_model()->count();
- EXPECT_EQ(starting_tab_count_normal + 1, tab_count_normal);
-
- // No effect is expected on the incognito browser.
- int tab_count_incognito = incognito_browser->tab_strip_model()->count();
- EXPECT_EQ(starting_tab_count_incognito, tab_count_incognito);
+ if (kHasProfileChooser) {
+ // ProfileChooser doesn't show in an incognito window.
+ EXPECT_FALSE(ProfileChooserView::IsShowing());
+
+ // No effect is expected on the incognito browser.
+ int tab_count_incognito = incognito_browser->tab_strip_model()->count();
+ EXPECT_EQ(starting_tab_count_incognito, tab_count_incognito);
+ } else {
+ // A new tab should have been opened in the normal browser, which should be
+ // visible.
+ int tab_count_normal = browser()->tab_strip_model()->count();
+ EXPECT_EQ(starting_tab_count_normal + 1, tab_count_normal);
+
+ // No effect is expected on the incognito browser.
+ int tab_count_incognito = incognito_browser->tab_strip_model()->count();
+ EXPECT_EQ(starting_tab_count_incognito, tab_count_incognito);
+ }
}
// Verifies that the sign in page can be loaded in a different browser
@@ -103,7 +127,9 @@ IN_PROC_BROWSER_TEST_F(BookmarkBubbleSignInDelegateTest, BrowserRemoved) {
Browser* extra_browser = CreateBrowser(profile());
ReplaceBlank(extra_browser);
+#if defined(OS_CHROMEOS)
int starting_tab_count = extra_browser->tab_strip_model()->count();
+#endif
scoped_ptr<BookmarkBubbleDelegate> delegate;
delegate.reset(new BookmarkBubbleSignInDelegate(browser()));
@@ -117,8 +143,12 @@ IN_PROC_BROWSER_TEST_F(BookmarkBubbleSignInDelegateTest, BrowserRemoved) {
delegate->OnSignInLinkClicked();
- // A new tab should have been opened in the extra browser, which should be
- // visible.
- int tab_count = extra_browser->tab_strip_model()->count();
- EXPECT_EQ(starting_tab_count + 1, tab_count);
+ if (kHasProfileChooser) {
+ EXPECT_TRUE(ProfileChooserView::IsShowing());
+ } else {
+ // A new tab should have been opened in the extra browser, which should be
+ // visible.
+ int tab_count = extra_browser->tab_strip_model()->count();
+ EXPECT_EQ(starting_tab_count + 1, tab_count);
noms (inactive) 2015/03/09 19:26:17 I don't think this will compile (given that starti
Mike Lerman 2015/03/10 15:58:59 Done.
+ }
}

Powered by Google App Engine
This is Rietveld 408576698