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

Unified Diff: chrome/browser/ui/cocoa/permission_bubble/permission_bubble_controller_unittest.mm

Issue 2853143003: MacViews: Allows the toolkit-views Device Chooser bubble to be used (Closed)
Patch Set: MacViews: Allows the toolkit-views Device Chooser bubble to be used (nits) Created 3 years, 7 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/cocoa/permission_bubble/permission_bubble_controller_unittest.mm
diff --git a/chrome/browser/ui/cocoa/permission_bubble/permission_bubble_controller_unittest.mm b/chrome/browser/ui/cocoa/permission_bubble/permission_bubble_controller_unittest.mm
index cf89bbcfb00e9748c6457e2153ebd380d88538b0..b4fb3155e547c5f3eb7edcd3477e896659c66738 100644
--- a/chrome/browser/ui/cocoa/permission_bubble/permission_bubble_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/permission_bubble/permission_bubble_controller_unittest.mm
@@ -39,7 +39,6 @@
- (void)onBlock:(id)sender;
- (void)onCustomize:(id)sender;
- (void)onCheckboxChanged:(id)sender;
-+ (NSInteger)getFullscreenLeftOffset;
@end
@interface SplitBlockButton (ExposedForTesting)
@@ -393,6 +392,9 @@ TEST_F(PermissionBubbleControllerTest, AnchorPositionWithLocationBar) {
}
TEST_F(PermissionBubbleControllerTest, AnchorPositionWithoutLocationBar) {
+ // See comment in bubble_anchor_helper.mm where this is defined.
+ const NSInteger kFullscreenLeftOffset = 40;
+
base::mac::ScopedObjCClassSwizzler locationSwizzle(
[PermissionBubbleController class], [MockBubbleNoLocationBar class],
@selector(hasVisibleLocationBarForBrowser:));
@@ -402,9 +404,8 @@ TEST_F(PermissionBubbleControllerTest, AnchorPositionWithoutLocationBar) {
// Expected anchor location will be top left when there's no location bar.
NSWindow* window = browser()->window()->GetNativeWindow();
NSRect frame = [[window contentView] frame];
- NSPoint expected = NSMakePoint(
- NSMinX(frame) + [PermissionBubbleController getFullscreenLeftOffset],
- NSMaxY(frame));
+ NSPoint expected =
+ NSMakePoint(NSMinX(frame) + kFullscreenLeftOffset, NSMaxY(frame));
expected = ui::ConvertPointFromWindowToScreen(window, expected);
EXPECT_NSEQ(expected, anchor);
}

Powered by Google App Engine
This is Rietveld 408576698