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