Delete un-tested hybrid_android_views, add layering to android_engine_test. (#162903)
Another large test suite that has never been running. The underlying thing I _think_ it wanted tested, which was hybrid composition, is now tested by `android_engine_test`. I also added a red square on top of each platform view so that, like `hybrid_android_views`, we can make sure layering is working as expected. Any other ideas? Can also be follow-up PRs?
This commit is contained in:
@@ -61,7 +61,8 @@ class NativeDriverSupportPlugin :
|
||||
selector = NativeSelector.ByContentDescription(call.argument("label")!!)
|
||||
}
|
||||
"byNativeIntegerId" -> {
|
||||
selector = NativeSelector.ByViewId(call.argument("id")!!)
|
||||
val stringId = call.argument<String>("id")!!
|
||||
selector = NativeSelector.ByViewId(stringId.toInt())
|
||||
}
|
||||
else -> {
|
||||
result.error("INVALID_SELECTOR", "Not supported", kind)
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
final class MainApp extends StatelessWidget {
|
||||
const MainApp({super.key, required this.platformView});
|
||||
final Widget platformView;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
debugShowCheckedModeBanner: false,
|
||||
home: Stack(
|
||||
children: <Widget>[
|
||||
platformView,
|
||||
Center(child: Container(width: 100, height: 100, color: Colors.red)),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter_driver/driver_extension.dart';
|
||||
|
||||
import '../src/allow_list_devices.dart';
|
||||
import '_shared.dart';
|
||||
|
||||
void main() async {
|
||||
ensureAndroidDevice();
|
||||
@@ -18,19 +19,13 @@ void main() async {
|
||||
|
||||
// Run on full screen.
|
||||
await SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersive);
|
||||
runApp(const MainApp());
|
||||
}
|
||||
|
||||
final class MainApp extends StatelessWidget {
|
||||
const MainApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const MaterialApp(
|
||||
debugShowCheckedModeBanner: false,
|
||||
home: _HybridCompositionAndroidPlatformView(viewType: 'blue_orange_gradient_platform_view'),
|
||||
);
|
||||
}
|
||||
runApp(
|
||||
const MainApp(
|
||||
platformView: _HybridCompositionAndroidPlatformView(
|
||||
viewType: 'blue_orange_gradient_platform_view',
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
final class _HybridCompositionAndroidPlatformView extends StatelessWidget {
|
||||
|
||||
@@ -8,6 +8,7 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter_driver/driver_extension.dart';
|
||||
|
||||
import '../src/allow_list_devices.dart';
|
||||
import '_shared.dart';
|
||||
|
||||
void main() async {
|
||||
ensureAndroidDevice();
|
||||
@@ -15,22 +16,12 @@ void main() async {
|
||||
|
||||
// Run on full screen.
|
||||
await SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersive);
|
||||
runApp(const MainApp());
|
||||
}
|
||||
|
||||
final class MainApp extends StatelessWidget {
|
||||
const MainApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const MaterialApp(
|
||||
debugShowCheckedModeBanner: false,
|
||||
// It is assumed:
|
||||
// - The Android SDK version is >= 23 (the test driver checks)
|
||||
// - This view does NOT use a SurfaceView
|
||||
//
|
||||
// See https://github.com/flutter/flutter/blob/main/docs/platforms/android/Android-Platform-Views.md.
|
||||
home: AndroidView(viewType: 'blue_orange_gradient_platform_view'),
|
||||
);
|
||||
}
|
||||
runApp(
|
||||
// It is assumed:
|
||||
// - The Android SDK version is >= 23 (the test driver checks)
|
||||
// - This view does NOT use a SurfaceView
|
||||
//
|
||||
// See https://github.com/flutter/flutter/blob/main/docs/platforms/android/Android-Platform-Views.md.
|
||||
const MainApp(platformView: AndroidView(viewType: 'blue_orange_gradient_platform_view')),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter_driver/driver_extension.dart';
|
||||
|
||||
import '../src/allow_list_devices.dart';
|
||||
import '_shared.dart';
|
||||
|
||||
void main() async {
|
||||
ensureAndroidDevice();
|
||||
@@ -15,22 +16,14 @@ void main() async {
|
||||
|
||||
// Run on full screen.
|
||||
await SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersive);
|
||||
runApp(const MainApp());
|
||||
}
|
||||
|
||||
final class MainApp extends StatelessWidget {
|
||||
const MainApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const MaterialApp(
|
||||
debugShowCheckedModeBanner: false,
|
||||
runApp(
|
||||
const MainApp(
|
||||
// It is assumed:
|
||||
// - The Android SDK version is >= 23 (the test driver checks)
|
||||
// - This view DOES use a SurfaceView
|
||||
//
|
||||
// See https://github.com/flutter/flutter/blob/main/docs/platforms/android/Android-Platform-Views.md.
|
||||
home: AndroidView(viewType: 'blue_orange_gradient_surface_view_platform_view'),
|
||||
);
|
||||
}
|
||||
platformView: AndroidView(viewType: 'blue_orange_gradient_surface_view_platform_view'),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -13,12 +13,12 @@ import '../_luci_skia_gold_prelude.dart';
|
||||
///
|
||||
/// ```sh
|
||||
/// # Checkout HEAD, i.e. *before* changes you want to test.
|
||||
/// UPDATE_GOLDENS=1 flutter drive lib/platform_view/hybrid_compoisition_platform_view_main.dart
|
||||
/// UPDATE_GOLDENS=1 flutter drive lib/platform_view/hybrid_composition_platform_view_main.dart
|
||||
///
|
||||
/// # Make your changes.
|
||||
///
|
||||
/// # Run the test against baseline.
|
||||
/// flutter drive lib/platform_view/hybrid_compoisition_platform_view_main.dart
|
||||
/// flutter drive lib/platform_view/hybrid_composition_platform_view_main.dart
|
||||
/// ```
|
||||
///
|
||||
/// For a convenient way to deflake a test, see `tool/deflake.dart`.
|
||||
|
||||
Reference in New Issue
Block a user