cef/tests/unittests/run_all_unittests_mac.mm
Marshall Greenblatt 243a9c26d7 Update to Chromium revision 0bfd25d4 (#381305)
- Delete include/cef_runnable.h (issue #1336).
- Build the cef_unittests target using all Chromium headers. Add a
  USING_CHROMIUM_INCLUDES define and libcef_dll_wrapper_unittests
  target to support this. This change avoids compile errors due to
  the divergence of CEF and Chromium base/ header implementations.
  The libcef_dll_wrapper sources must now compile successfully with
  both CEF and Chromium base/ headers (issue #1632).
- The onbeforeunload message specified via JavaScript is no longer
  passed to the client (see http://crbug.com/587940).
2016-03-17 13:01:21 -04:00

46 lines
1.1 KiB
Plaintext

// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
#include "include/cef_app.h"
#import "include/cef_application_mac.h"
// Memory AutoRelease pool.
static NSAutoreleasePool* g_autopool = nil;
// Provide the CefAppProtocol implementation required by CEF.
@interface TestApplication : NSApplication<CefAppProtocol> {
@private
BOOL handlingSendEvent_;
}
@end
@implementation TestApplication
- (BOOL)isHandlingSendEvent {
return handlingSendEvent_;
}
- (void)setHandlingSendEvent:(BOOL)handlingSendEvent {
handlingSendEvent_ = handlingSendEvent;
}
- (void)sendEvent:(NSEvent*)event {
CefScopedSendingEvent sendingEventScoper;
[super sendEvent:event];
}
@end
void PlatformInit() {
// Initialize the AutoRelease pool.
g_autopool = [[NSAutoreleasePool alloc] init];
// Initialize the TestApplication instance.
[TestApplication sharedApplication];
}
void PlatformCleanup() {
// Release the AutoRelease pool.
[g_autopool release];
}