272 {
273
275 FlutterRenderer.ViewportMetrics metrics =
new FlutterRenderer.ViewportMetrics();
276 metrics.width = 1000;
277 metrics.height = 1000;
278 metrics.devicePixelRatio = 2;
279 metrics.displayFeatures.add(
281 new Rect(10, 20, 30, 40),
284 metrics.displayFeatures.add(
287
288
289 flutterRenderer.setViewportMetrics(metrics);
290
291
292 ArgumentCaptor<int[]> boundsCaptor = ArgumentCaptor.forClass(int[].class);
293 ArgumentCaptor<int[]> typeCaptor = ArgumentCaptor.forClass(int[].class);
294 ArgumentCaptor<int[]> stateCaptor = ArgumentCaptor.forClass(int[].class);
295 verify(fakeFlutterJNI)
296 .setViewportMetrics(
297 anyFloat(),
298 anyInt(),
299 anyInt(),
300 anyInt(),
301 anyInt(),
302 anyInt(),
303 anyInt(),
304 anyInt(),
305 anyInt(),
306 anyInt(),
307 anyInt(),
308 anyInt(),
309 anyInt(),
310 anyInt(),
311 anyInt(),
312 anyInt(),
313 boundsCaptor.capture(),
314 typeCaptor.capture(),
315 stateCaptor.capture());
316
317 assertArrayEquals(new int[] {10, 20, 30, 40, 50, 60, 70, 80}, boundsCaptor.getValue());
318 assertArrayEquals(
319 new int[] {
321 FlutterRenderer.DisplayFeatureType.CUTOUT.encodedValue
322 },
323 typeCaptor.getValue());
324 assertArrayEquals(
325 new int[] {
327 FlutterRenderer.DisplayFeatureState.UNKNOWN.encodedValue
328 },
329 stateCaptor.getValue());
330 }