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

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

Issue 201933003: Merge 256851 "Adds a hide button to the desktop capture notifica..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1847/src/
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
===================================================================
--- chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa_unittest.mm (revision 257441)
+++ chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa_unittest.mm (working copy)
@@ -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 @@
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 @@
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