117 {
118 id<MTLDevice>
device = MTLCreateSystemDefaultDevice();
119 id<MTLCommandQueue>
queue = [
device newCommandQueue];
124 delegate:delegate
125 threadSynchronizer:threadSynchronizer
127 NSWindow*
window = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 800, 600)
128 styleMask:NSBorderlessWindowMask
129 backing:NSBackingStoreBuffered
130 defer:NO];
131
133
134 NSView* platformView = [[NSView alloc]
initWithFrame:NSMakeRect(0, 0, 100, 100)];
135
136 window.contentView = view;
137 __block
BOOL hitTestCalled = NO;
138 __block NSPoint hitTestCoordinate = NSZeroPoint;
139 view.onHitTest = ^NSView*(NSPoint point) {
140 hitTestCalled = YES;
141 hitTestCoordinate = point;
142 return platformView;
143 };
144 NSEvent* mouseEvent = [NSEvent mouseEventWithType:NSEventTypeMouseMoved
145 location:NSMakePoint(100, 100)
146 modifierFlags:0
147 timestamp:0
148 windowNumber:0
149 context:nil
150 eventNumber:0
151 clickCount:0
152 pressure:0];
153 [view didUpdateMouseCursor:cursor];
154 [view cursorUpdate:mouseEvent];
155
157
158 EXPECT_TRUE(CGPointEqualToPoint(hitTestCoordinate, CGPointMake(100, 100)));
159 EXPECT_FALSE(cursor.setCalled);
160}
instancetype initWithFrame