mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Enable overlay before flutter drive
This commit is contained in:
parent
5aee14b818
commit
ffe1e7fa23
@ -80,6 +80,28 @@ Future<void> runFlutterDriverAndroidTests() async {
|
||||
),
|
||||
);
|
||||
|
||||
// A simulated cutout overlay is necessary to test display_cutout_rotation.
|
||||
await runCommand(
|
||||
'adb',
|
||||
<String>[
|
||||
'shell',
|
||||
'settings',
|
||||
'put',
|
||||
'global',
|
||||
'development_settings_enabled',
|
||||
'1',
|
||||
],
|
||||
);
|
||||
await runCommand(
|
||||
'adb',
|
||||
<String>[
|
||||
'shell',
|
||||
'cmd',
|
||||
'overlay',
|
||||
'enable',
|
||||
'com.android.internal.display.cutout.emulation.tall',
|
||||
],
|
||||
);
|
||||
await runCommand(
|
||||
'flutter',
|
||||
<String>[
|
||||
|
||||
@ -8,8 +8,6 @@ import 'package:flutter_driver/flutter_driver.dart';
|
||||
import 'package:native_driver/native_driver.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
const String _tallCutout = 'com.android.internal.display.cutout.emulation.tall';
|
||||
|
||||
void main() async {
|
||||
late final FlutterDriver flutterDriver;
|
||||
late final NativeDriver nativeDriver;
|
||||
@ -18,18 +16,6 @@ void main() async {
|
||||
flutterDriver = await FlutterDriver.connect();
|
||||
nativeDriver = await AndroidNativeDriver.connect(flutterDriver);
|
||||
await flutterDriver.waitUntilFirstFrameRasterized();
|
||||
// Enable developer settings in order to simulate a cutout.
|
||||
await Process.run('adb', <String>[
|
||||
'shell',
|
||||
'settings',
|
||||
'put',
|
||||
'global',
|
||||
'development_settings_enabled',
|
||||
'1'
|
||||
]);
|
||||
// Simulate the tall cutout. A singular cutout that aligns to the "top" of the display.
|
||||
await Process.run(
|
||||
'adb', <String>['shell', 'cmd', 'overlay', 'enable', _tallCutout]);
|
||||
});
|
||||
|
||||
tearDownAll(() async {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user