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

Unified Diff: chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa_unittest.mm

Issue 195283003: Adds a hide button to the desktop capture notification bar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa_unittest.mm
diff --git a/chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa_unittest.mm b/chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa_unittest.mm
index 284ca3e63288831d6cb9844e63b3b1458900dcf6..005dceed97e74a401042e04c94ca8c609fdb17f1 100644
--- a/chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa_unittest.mm
+++ b/chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa_unittest.mm
@@ -10,12 +10,17 @@
@interface ScreenCaptureNotificationController (ExposedForTesting)
- (NSButton*)stopButton;
+- (NSButton*)minimizeButton;
@end
@implementation ScreenCaptureNotificationController (ExposedForTesting)
- (NSButton*)stopButton {
return stopButton_;
}
+
+- (NSButton*)minimizeButton {
+ return minimizeButton_;
+}
@end
class ScreenCaptureNotificationUICocoaTest : public CocoaTest {
@@ -68,7 +73,9 @@ TEST_F(ScreenCaptureNotificationUICocoaTest, LongTitle) {
target_->OnStarted(
base::Bind(&ScreenCaptureNotificationUICocoaTest::StopCallback,
base::Unretained(this)));
- EXPECT_LE(NSWidth([[controller() window] frame]), 1000);
+ // The elided label sometimes is a few pixels longer than the max width. So
+ // allow a 5px off from the 1000px maximium.
+ EXPECT_LE(NSWidth([[controller() window] frame]), 1005);
}
TEST_F(ScreenCaptureNotificationUICocoaTest, ShortTitle) {
@@ -102,3 +109,16 @@ TEST_F(ScreenCaptureNotificationUICocoaTest, CloseWindow) {
EXPECT_EQ(1, callback_called_);
}
+
+TEST_F(ScreenCaptureNotificationUICocoaTest, MinimizeWindow) {
+ target_.reset(
+ new ScreenCaptureNotificationUICocoa(base::UTF8ToUTF16("Title")));
+ target_->OnStarted(
+ base::Bind(&ScreenCaptureNotificationUICocoaTest::StopCallback,
+ base::Unretained(this)));
+
+ [[controller() minimizeButton] performClick:nil];
+
+ EXPECT_EQ(0, callback_called_);
+ EXPECT_TRUE([[controller() window] isMiniaturized]);
+}

Powered by Google App Engine
This is Rietveld 408576698