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

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

Issue 49063012: [rAC, OSX] Use bubble windows for error messages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix failing tests. Created 7 years, 1 month 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/base_bubble_controller_unittest.mm
diff --git a/chrome/browser/ui/cocoa/base_bubble_controller_unittest.mm b/chrome/browser/ui/cocoa/base_bubble_controller_unittest.mm
index feccd6fed5ad2a6aa31422278e4403668816a533..f2e8bb5e64f890cef393e1328bc8503538569feb 100644
--- a/chrome/browser/ui/cocoa/base_bubble_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/base_bubble_controller_unittest.mm
@@ -156,7 +156,8 @@ TEST_F(BaseBubbleControllerTest, ResignKeyCloses) {
EXPECT_TRUE([other_window isVisible]);
}
-// Test that clicking outside the window causes the bubble to close.
+// Test that clicking outside the window causes the bubble to close if
+// shouldCloseOnResignKey is YES.
TEST_F(BaseBubbleControllerTest, LionClickOutsideCloses) {
// The event tap is only installed on 10.7+.
if (!base::mac::IsOSLionOrLater())
@@ -166,16 +167,26 @@ TEST_F(BaseBubbleControllerTest, LionClickOutsideCloses) {
base::scoped_nsobject<BaseBubbleController> keep_alive([controller_ retain]);
NSWindow* window = [controller_ window];
+ EXPECT_TRUE([controller_ shouldCloseOnResignKey]); // Verify default value.
EXPECT_FALSE([window isVisible]);
[controller_ showWindow:nil];
EXPECT_TRUE([window isVisible]);
+ [controller_ setShouldCloseOnResignKey:NO];
NSEvent* event = cocoa_test_event_utils::LeftMouseDownAtPointInWindow(
NSMakePoint(10, 10), test_window());
[NSApp sendEvent:event];
chrome::testing::NSRunLoopRunAllPending();
+ EXPECT_TRUE([window isVisible]);
+
+ [controller_ setShouldCloseOnResignKey:YES];
+ event = cocoa_test_event_utils::LeftMouseDownAtPointInWindow(
+ NSMakePoint(10, 10), test_window());
+ [NSApp sendEvent:event];
+ chrome::testing::NSRunLoopRunAllPending();
+
EXPECT_FALSE([window isVisible]);
}

Powered by Google App Engine
This is Rietveld 408576698