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

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 (swizzling tests) Created 3 years, 8 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..a263e9f57ec168a8d065d690dacdb0dda3e49936 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) {
+ // Constant offset from the left to use for fullscreen permission bubbles.
tapted 2017/05/03 09:09:11 See bubble_anchor_helper.mm?
varkha 2017/05/03 09:22:40 Done.
+ 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