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

Unified Diff: chrome/browser/ui/cocoa/profiles/profile_chooser_controller_unittest.mm

Issue 2673183002: [Mac] Test for avatar bubble alignment logic (Closed)
Patch Set: Created 3 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/profiles/profile_chooser_controller_unittest.mm
diff --git a/chrome/browser/ui/cocoa/profiles/profile_chooser_controller_unittest.mm b/chrome/browser/ui/cocoa/profiles/profile_chooser_controller_unittest.mm
index 4c5db4f0904bff13b729722b4af3b8a3de096143..6d16600f829e7f77aeff414d88729b61e8e33d40 100644
--- a/chrome/browser/ui/cocoa/profiles/profile_chooser_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/profiles/profile_chooser_controller_unittest.mm
@@ -25,7 +25,10 @@
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/ui/browser.h"
+#import "chrome/browser/ui/cocoa/info_bubble_view.h"
+#include "chrome/browser/ui/cocoa/l10n_util.h"
#include "chrome/browser/ui/cocoa/test/cocoa_profile_test.h"
+#include "chrome/browser/ui/cocoa/test/scoped_force_rtl_mac.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "components/signin/core/browser/fake_account_fetcher_service.h"
@@ -251,6 +254,25 @@ TEST_F(ProfileChooserControllerTest, InitialLayoutWithNewMenu) {
EXPECT_GT([[promo stringValue] length], 0U);
}
+// Check to see if the bubble is aligned properly in LTR and RTL format.
+TEST_F(ProfileChooserControllerTest, BubbleAlignment) {
+ // Test the LTR format.
+ StartProfileChooserController();
+ EXPECT_EQ(info_bubble::kAlignTrailingEdgeToAnchorEdge,
+ [[controller() bubble] alignment]);
+ [controller() close];
+
+ // Force to RTL format
+ cocoa_l10n_util::ScopedForceRTLMac rtl;
+ StartProfileChooserController();
+ info_bubble::BubbleAlignment expected_alignment =
+ cocoa_l10n_util::ShouldFlipWindowControlsInRTL()
+ ? info_bubble::kAlignTrailingEdgeToAnchorEdge
+ : info_bubble::kAlignLeadingEdgeToAnchorEdge;
+ EXPECT_EQ(expected_alignment, [[controller() bubble] alignment]);
+ [controller() close];
+}
+
TEST_F(ProfileChooserControllerTest, RightClickTutorialShownAfterWelcome) {
// The welcome upgrade tutorial takes precedence so show it then dismiss it.
// The right click tutorial should be shown right away.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698