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