Add a virtual-display (VD) platform view test, and refactor tests a bit. (#161349)

Towards https://github.com/flutter/flutter/issues/161261.

Still need to add a HC (Hybrid Composition) variant, but figured I'd do
this incrementally to make it easier to review.
This commit is contained in:
Matan Lurey
2025-01-09 19:23:40 -08:00
committed by GitHub
parent 99fe90a05e
commit 89b336109f
15 changed files with 250 additions and 16 deletions

View File

@@ -6,11 +6,11 @@ import 'dart:io' as io;
import 'package:flutter/foundation.dart';
/// Throws an [UnsupportedError] if the current platform is not Android or iOS.
void ensureAndroidOrIosDevice() {
if (kIsWeb || (!io.Platform.isAndroid && !io.Platform.isIOS)) {
/// Throws an [UnsupportedError] if the current platform is not Android.
void ensureAndroidDevice() {
if (kIsWeb || !io.Platform.isAndroid) {
throw UnsupportedError(
'This app should only run on Android or iOS devices. It uses native '
'This app should only run on Android devices. It uses native Android '
'plugins that are not developed for other platforms, and would need to '
'be adapted to run on other platforms. See the README.md for details.',
);