From c2086cf7c74c7ebeb1e62223cb705fef2b900c97 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Wed, 26 Aug 2015 16:38:43 -0400 Subject: [PATCH] Mac: Fix 10.10 SDK compile and test errors (issue #1414) --- libcef/browser/text_input_client_osr_mac.mm | 5 +++++ tests/cefclient/browser/browser_window_osr_mac.mm | 2 ++ tests/cefsimple/cefsimple_mac.mm | 4 ++-- tests/unittests/os_rendering_unittest.cc | 4 ++-- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/libcef/browser/text_input_client_osr_mac.mm b/libcef/browser/text_input_client_osr_mac.mm index 249ec853d..c13f95007 100644 --- a/libcef/browser/text_input_client_osr_mac.mm +++ b/libcef/browser/text_input_client_osr_mac.mm @@ -348,8 +348,13 @@ extern "C" { // doesn't call any NSTextInput functions, such as setMarkedText or // insertText. So, we need to send an IPC message to a renderer so it can // delete the composition node. + // TODO(erikchen): NSInputManager is deprecated since OSX 10.6. Switch to + // NSTextInputContext. http://www.crbug.com/479010. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" NSInputManager *currentInputManager = [NSInputManager currentInputManager]; [currentInputManager markedTextAbandoned:self]; +#pragma clang diagnostic pop hasMarkedText_ = NO; // Should not call [self unmarkText] here, because it'll send unnecessary diff --git a/tests/cefclient/browser/browser_window_osr_mac.mm b/tests/cefclient/browser/browser_window_osr_mac.mm index 22e0a84e5..b96474198 100644 --- a/tests/cefclient/browser/browser_window_osr_mac.mm +++ b/tests/cefclient/browser/browser_window_osr_mac.mm @@ -648,6 +648,8 @@ BrowserOpenGLView* GLView(NSView* view) { case NSOtherMouseUp: modifiers |= EVENTFLAG_MIDDLE_MOUSE_BUTTON; break; + default: + break; } return modifiers; diff --git a/tests/cefsimple/cefsimple_mac.mm b/tests/cefsimple/cefsimple_mac.mm index d4052fa3a..61c9470f5 100644 --- a/tests/cefsimple/cefsimple_mac.mm +++ b/tests/cefsimple/cefsimple_mac.mm @@ -11,7 +11,7 @@ #include "include/wrapper/cef_helpers.h" // Receives notifications from the application. -@interface SimpleAppDelegate : NSObject +@interface SimpleAppDelegate : NSObject - (void)createApplication:(id)object; - (void)tryToTerminateApplication:(NSApplication*)app; @end @@ -90,7 +90,7 @@ [NSBundle loadNibNamed:@"MainMenu" owner:NSApp]; // Set the delegate for application events. - [NSApp setDelegate:self]; + [[NSApplication sharedApplication] setDelegate:self]; } - (void)tryToTerminateApplication:(NSApplication*)app { diff --git a/tests/unittests/os_rendering_unittest.cc b/tests/unittests/os_rendering_unittest.cc index 1e16702f8..a6b0266ae 100644 --- a/tests/unittests/os_rendering_unittest.cc +++ b/tests/unittests/os_rendering_unittest.cc @@ -85,7 +85,7 @@ const int kVerticalScrollbarWidth = GetSystemMetrics(SM_CXVSCROLL); const CefRect kEditBoxRect(442, 251, 46, 16); const CefRect kNavigateButtonRect(375, 275, 130, 20); const CefRect kSelectRect(461, 21, 87, 26); -const CefRect kExpandedSelectRect(466, 42, 81, 286); +const CefRect kExpandedSelectRect(466, 42, 79, 286); const CefRect kDropDivRect(9, 330, 52, 52); const CefRect kDragDivRect(60, 330, 52, 52); const int kVerticalScrollbarWidth = 15; @@ -691,7 +691,7 @@ class OSRTestHandler : public RoutingTestHandler, expanded_select_rect.height)); // first pixel of border #if defined(OS_MACOSX) - EXPECT_EQ(0xff719bc1, *(reinterpret_cast(buffer))); + EXPECT_EQ(0xff5d99d6, *(reinterpret_cast(buffer))); #else if (scale_factor_ == 1.0f) EXPECT_EQ(0xffd69c2b, *(reinterpret_cast(buffer)));