5#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterView.h"
9#import "flutter/testing/testing.h"
19- (void)viewDidReshape:(nonnull NSView*)view {
22- (
BOOL)viewShouldAcceptFirstResponder:(NSView*)view {
29 id<MTLDevice>
device = MTLCreateSystemDefaultDevice();
30 id<MTLCommandQueue>
queue = [device newCommandQueue];
36 threadSynchronizer:threadSynchronizer
37 viewIdentifier:kImplicitViewId];
38 EXPECT_EQ([view layer:view.layer shouldInheritContentsScale:3.0 fromWindow:view.window], YES);
43@property(readwrite, nonatomic) NSView* (^onHitTest)(NSPoint point);
51- (NSView*)hitTest:(NSPoint)point {
52 return self.onHitTest(point);
62@property(readwrite, nonatomic)
BOOL setCalled;
74 id<MTLDevice>
device = MTLCreateSystemDefaultDevice();
75 id<MTLCommandQueue>
queue = [device newCommandQueue];
81 threadSynchronizer:threadSynchronizer
82 viewIdentifier:kImplicitViewId];
83 NSWindow*
window = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 800, 600)
84 styleMask:NSBorderlessWindowMask
85 backing:NSBackingStoreBuffered
91 __weak NSView* weakView = view;
92 __block
BOOL hitTestCalled = NO;
93 __block NSPoint hitTestCoordinate = NSZeroPoint;
94 view.
onHitTest = ^NSView*(NSPoint point) {
96 hitTestCoordinate = point;
99 NSEvent* mouseEvent = [NSEvent mouseEventWithType:NSEventTypeMouseMoved
100 location:NSMakePoint(100, 100)
113 EXPECT_TRUE(CGPointEqualToPoint(hitTestCoordinate, CGPointMake(100, 100)));
118 id<MTLDevice>
device = MTLCreateSystemDefaultDevice();
119 id<MTLCommandQueue>
queue = [device newCommandQueue];
125 threadSynchronizer:threadSynchronizer
126 viewIdentifier:kImplicitViewId];
127 NSWindow*
window = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 800, 600)
128 styleMask:NSBorderlessWindowMask
129 backing:NSBackingStoreBuffered
134 NSView* platformView = [[NSView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)];
136 window.contentView = view;
137 __block
BOOL hitTestCalled = NO;
138 __block NSPoint hitTestCoordinate = NSZeroPoint;
139 view.
onHitTest = ^NSView*(NSPoint point) {
141 hitTestCoordinate = point;
144 NSEvent* mouseEvent = [NSEvent mouseEventWithType:NSEventTypeMouseMoved
145 location:NSMakePoint(100, 100)
158 EXPECT_TRUE(CGPointEqualToPoint(hitTestCoordinate, CGPointMake(100, 100)));
void cursorUpdate:(NSEvent *event)
void didUpdateMouseCursor:(nonnull NSCursor *cursor)
NSView *(^ onHitTest)(NSPoint point)
TEST(FlutterView, ShouldInheritContentsScaleReturnsYes)
constexpr int64_t kImplicitViewId
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not set
#define EXPECT_TRUE(handle)