Remove unused l and --isolate-filter tools (#63336)

This commit is contained in:
Michael Klimushyn
2020-08-10 10:51:04 -07:00
committed by GitHub
parent ba92cbedd8
commit cb69bbb4d5
22 changed files with 0 additions and 496 deletions

View File

@@ -83,8 +83,6 @@ Future<void> main(List<String> args) async {
'attach',
'--module',
name,
'--isolate-filter',
name,
'--target',
targetFile,
'--target-model',

View File

@@ -198,11 +198,6 @@ abstract class ResidentWebRunner extends ResidentRunner {
}
}
@override
Future<List<FlutterView>> listFlutterViews() async {
return <FlutterView>[];
}
@override
Future<void> debugDumpApp() async {
try {

View File

@@ -57,7 +57,6 @@ import '../widget_cache.dart';
class AttachCommand extends FlutterCommand {
AttachCommand({bool verboseHelp = false, this.hotRunnerFactory}) {
addBuildModeFlags(defaultToRelease: false);
usesIsolateFilterOption(hide: !verboseHelp);
usesTargetOption();
usesPortOptions();
usesIpv6Flag();
@@ -380,7 +379,6 @@ class AttachCommand extends FlutterCommand {
flutterProject: flutterProject,
fileSystemRoots: stringsArg('filesystem-root'),
fileSystemScheme: stringArg('filesystem-scheme'),
viewFilter: stringArg('isolate-filter'),
target: stringArg('target'),
targetModel: TargetModel(stringArg('target-model')),
buildInfo: getBuildInfo(),

View File

@@ -470,7 +470,6 @@ class AppDomain extends Domain {
final FlutterDevice flutterDevice = await FlutterDevice.create(
device,
flutterProject: flutterProject,
viewFilter: isolateFilter,
target: target,
buildInfo: options.buildInfo,
widgetCache: WidgetCache(featureFlags: featureFlags),

View File

@@ -73,7 +73,6 @@ abstract class RunCommandBase extends FlutterCommand with DeviceBasedDevelopment
usesIpv6Flag();
usesPubOption();
usesTrackWidgetCreation(verboseHelp: verboseHelp);
usesIsolateFilterOption(hide: !verboseHelp);
addNullSafetyModeOptions(hide: !verboseHelp);
usesDeviceUserOption();
}
@@ -526,7 +525,6 @@ class RunCommand extends RunCommandBase {
flutterProject: flutterProject,
fileSystemRoots: stringsArg('filesystem-root'),
fileSystemScheme: stringArg('filesystem-scheme'),
viewFilter: stringArg('isolate-filter'),
experimentalFlags: expFlags,
target: stringArg('target'),
buildInfo: getBuildInfo(),

View File

@@ -42,7 +42,6 @@ class FlutterDevice {
@required this.buildInfo,
this.fileSystemRoots,
this.fileSystemScheme,
this.viewFilter,
TargetModel targetModel = TargetModel.flutter,
TargetPlatform targetPlatform,
ResidentCompiler generator,
@@ -76,7 +75,6 @@ class FlutterDevice {
@required BuildInfo buildInfo,
List<String> fileSystemRoots,
String fileSystemScheme,
String viewFilter,
TargetModel targetModel = TargetModel.flutter,
List<String> experimentalFlags,
ResidentCompiler generator,
@@ -165,7 +163,6 @@ class FlutterDevice {
device,
fileSystemRoots: fileSystemRoots,
fileSystemScheme:fileSystemScheme,
viewFilter: viewFilter,
targetModel: targetModel,
targetPlatform: targetPlatform,
generator: generator,
@@ -188,7 +185,6 @@ class FlutterDevice {
String fileSystemScheme;
StreamSubscription<String> _loggingSubscription;
bool _isListeningForObservatoryUri;
final String viewFilter;
/// Whether the stream [observatoryUris] is still open.
bool get isWaitingForObservatory => _isListeningForObservatoryUri ?? false;
@@ -947,18 +943,6 @@ abstract class ResidentRunner {
throw Exception('Canvaskit not supported by this runner.');
}
/// List the attached flutter views.
Future<List<FlutterView>> listFlutterViews() async {
final List<List<FlutterView>> views = await Future.wait(<Future<List<FlutterView>>>[
for (FlutterDevice device in flutterDevices)
if (device.vmService != null)
device.vmService.getFlutterViews()
]);
return views
.expand((List<FlutterView> viewList) => viewList)
.toList();
}
/// Write the SkSL shaders to a zip file in build directory.
///
/// Returns the name of the file, or `null` on failures.
@@ -1532,13 +1516,6 @@ class TerminalHandler {
return true;
}
return false;
case 'l':
final List<FlutterView> views = await residentRunner.listFlutterViews();
globals.printStatus('Connected ${pluralize('view', views.length)}:');
for (final FlutterView v in views) {
globals.printStatus('${v.uiIsolate.name} (${v.uiIsolate.id})', indent: 2);
}
return true;
case 'L':
if (residentRunner.supportsServiceProtocol) {
await residentRunner.debugDumpLayerTree();

View File

@@ -396,14 +396,6 @@ abstract class FlutterCommand extends Command<void> {
);
}
void usesIsolateFilterOption({ @required bool hide }) {
argParser.addOption('isolate-filter',
defaultsTo: null,
hide: hide,
help: 'Restricts commands to a subset of the available isolates (running instances of Flutter).\n'
"Normally there's only one, but when adding Flutter to a pre-existing app it's possible to create multiple.");
}
void usesDeviceUserOption() {
argParser.addOption(FlutterOptions.kDeviceUser,
help: 'Identifier number for a user or work profile on Android only. Run "adb shell pm list users" for available identifiers.',

View File

@@ -207,20 +207,6 @@ void main() {
});
});
testUsingContext('FlutterDevice can list views with a filter', () => testbed.run(() async {
fakeVmServiceHost = FakeVmServiceHost(requests: <VmServiceExpectation>[
listViews,
]);
final MockDevice mockDevice = MockDevice();
final FlutterDevice flutterDevice = FlutterDevice(
mockDevice,
buildInfo: BuildInfo.debug,
viewFilter: 'b', // Does not match name of `fakeFlutterView`.
);
flutterDevice.vmService = fakeVmServiceHost.vmService;
}));
testUsingContext('ResidentRunner can attach to device successfully', () => testbed.run(() async {
fakeVmServiceHost = FakeVmServiceHost(requests: <VmServiceExpectation>[
listViews,
@@ -1640,17 +1626,6 @@ void main() {
expect(fakeVmServiceHost.hasRemainingExpectations, false);
}));
testUsingContext('listViews handles a null VM service', () => testbed.run(() async {
final FlutterDevice device = FlutterDevice(mockDevice, buildInfo: BuildInfo.debug);
final ResidentRunner residentRunner = HotRunner(
<FlutterDevice>[device],
debuggingOptions: DebuggingOptions.disabled(BuildInfo.debug)
);
expect(await residentRunner.listFlutterViews(), isEmpty);
}));
testUsingContext('ResidentRunner debugDumpApp calls flutter device', () => testbed.run(() async {
fakeVmServiceHost = FakeVmServiceHost(requests: <VmServiceExpectation>[]);
await residentRunner.debugDumpApp();

View File

@@ -8,7 +8,6 @@ import 'package:flutter_tools/src/build_info.dart';
import 'package:flutter_tools/src/compile.dart';
import 'package:flutter_tools/src/device.dart';
import 'package:flutter_tools/src/resident_runner.dart';
import 'package:flutter_tools/src/vmservice.dart';
import 'package:mockito/mockito.dart';
import '../src/common.dart';
@@ -155,19 +154,6 @@ void main() {
});
testUsingContext('l - list flutter views', () async {
final MockFlutterDevice mockFlutterDevice = MockFlutterDevice();
when(mockResidentRunner.isRunningDebug).thenReturn(true);
when(mockResidentRunner.flutterDevices).thenReturn(<FlutterDevice>[mockFlutterDevice]);
when(mockResidentRunner.listFlutterViews()).thenAnswer((Invocation invocation) async {
return <FlutterView>[];
});
await terminalHandler.processTerminalInput('l');
expect(testLogger.statusText, contains('Connected views:\n'));
});
testUsingContext('L - debugDumpLayerTree with service protocol', () async {
await terminalHandler.processTerminalInput('L');