52 {
54 auto callback = [](std::unique_ptr<flutter::FrameTimingsRecorder> recorder) {};
55 id bundleMock = OCMPartialMock([NSBundle mainBundle]);
56 OCMStub([bundleMock objectForInfoDictionaryKey:@"CADisableMinimumFrameDurationOnPhone"])
57 .andReturn(@YES);
59 double maxFrameRate = 120;
60 [[[mockDisplayLinkManager stub] andReturnValue:@(maxFrameRate)] displayRefreshRate];
61
63 callback:callback];
65 if (@available(iOS 15.0, *)) {
66 XCTAssertEqualWithAccuracy(
link.preferredFrameRateRange.maximum, maxFrameRate, 0.1);
67 XCTAssertEqualWithAccuracy(
link.preferredFrameRateRange.preferred, maxFrameRate, 0.1);
68 XCTAssertEqualWithAccuracy(
link.preferredFrameRateRange.minimum, maxFrameRate / 2, 0.1);
69 } else {
70 XCTAssertEqualWithAccuracy(
link.preferredFramesPerSecond, maxFrameRate, 0.1);
71 }
72}