This reverts commit d7d12412e5ba55ebbc508de983f731b28efaddb1.
This commit is contained in:
parent
cad4d1333e
commit
2ae25cc2d7
@ -620,7 +620,7 @@ class AndroidDevice extends Device {
|
|||||||
observatoryDiscovery = ProtocolDiscovery.observatory(
|
observatoryDiscovery = ProtocolDiscovery.observatory(
|
||||||
await getLogReader(),
|
await getLogReader(),
|
||||||
portForwarder: portForwarder,
|
portForwarder: portForwarder,
|
||||||
hostPort: debuggingOptions.disableDds ? debuggingOptions.hostVmServicePort : 0,
|
hostPort: debuggingOptions.hostVmServicePort,
|
||||||
devicePort: debuggingOptions.deviceVmServicePort,
|
devicePort: debuggingOptions.deviceVmServicePort,
|
||||||
ipv6: ipv6,
|
ipv6: ipv6,
|
||||||
);
|
);
|
||||||
|
@ -15,24 +15,30 @@ import 'logger.dart';
|
|||||||
class DartDevelopmentService {
|
class DartDevelopmentService {
|
||||||
DartDevelopmentService({@required this.logger});
|
DartDevelopmentService({@required this.logger});
|
||||||
|
|
||||||
|
// TODO(bkonyi): enable once VM service can handle SSE forwarding for
|
||||||
|
// Devtools (https://github.com/flutter/flutter/issues/62507)
|
||||||
|
static const bool ddsDisabled = true;
|
||||||
final Logger logger;
|
final Logger logger;
|
||||||
dds.DartDevelopmentService _ddsInstance;
|
dds.DartDevelopmentService _ddsInstance;
|
||||||
|
|
||||||
Uri get uri => _ddsInstance.uri;
|
|
||||||
|
|
||||||
Future<void> startDartDevelopmentService(
|
Future<void> startDartDevelopmentService(
|
||||||
Uri observatoryUri,
|
Uri observatoryUri,
|
||||||
int hostPort,
|
|
||||||
bool ipv6,
|
bool ipv6,
|
||||||
bool disableServiceAuthCodes,
|
|
||||||
) async {
|
) async {
|
||||||
|
if (ddsDisabled) {
|
||||||
|
logger.printTrace(
|
||||||
|
'DDS is currently disabled due to '
|
||||||
|
'https://github.com/flutter/flutter/issues/62507'
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
final Uri ddsUri = Uri(
|
final Uri ddsUri = Uri(
|
||||||
scheme: 'http',
|
scheme: 'http',
|
||||||
host: (ipv6 ?
|
host: (ipv6 ?
|
||||||
io.InternetAddress.loopbackIPv6 :
|
io.InternetAddress.loopbackIPv6 :
|
||||||
io.InternetAddress.loopbackIPv4
|
io.InternetAddress.loopbackIPv4
|
||||||
).host,
|
).host,
|
||||||
port: hostPort ?? 0,
|
port: 0,
|
||||||
);
|
);
|
||||||
logger.printTrace(
|
logger.printTrace(
|
||||||
'Launching a Dart Developer Service (DDS) instance at $ddsUri, '
|
'Launching a Dart Developer Service (DDS) instance at $ddsUri, '
|
||||||
@ -42,7 +48,6 @@ class DartDevelopmentService {
|
|||||||
_ddsInstance = await dds.DartDevelopmentService.startDartDevelopmentService(
|
_ddsInstance = await dds.DartDevelopmentService.startDartDevelopmentService(
|
||||||
observatoryUri,
|
observatoryUri,
|
||||||
serviceUri: ddsUri,
|
serviceUri: ddsUri,
|
||||||
enableAuthCodes: !disableServiceAuthCodes,
|
|
||||||
);
|
);
|
||||||
logger.printTrace('DDS is listening at ${_ddsInstance.uri}.');
|
logger.printTrace('DDS is listening at ${_ddsInstance.uri}.');
|
||||||
} on dds.DartDevelopmentServiceException catch (e) {
|
} on dds.DartDevelopmentServiceException catch (e) {
|
||||||
|
@ -240,12 +240,7 @@ class DriveCommand extends RunCommandBase {
|
|||||||
// If there's another flutter_tools instance still connected to the target
|
// If there's another flutter_tools instance still connected to the target
|
||||||
// application, DDS will already be running remotely and this call will fail.
|
// application, DDS will already be running remotely and this call will fail.
|
||||||
// We can ignore this and continue to use the remote DDS instance.
|
// We can ignore this and continue to use the remote DDS instance.
|
||||||
await device.dds.startDartDevelopmentService(
|
await device.dds.startDartDevelopmentService(Uri.parse(observatoryUri), ipv6);
|
||||||
Uri.parse(observatoryUri),
|
|
||||||
hostVmservicePort,
|
|
||||||
ipv6,
|
|
||||||
disableServiceAuthCodes,
|
|
||||||
);
|
|
||||||
} on dds.DartDevelopmentServiceException catch(_) {
|
} on dds.DartDevelopmentServiceException catch(_) {
|
||||||
globals.printTrace('Note: DDS is already connected to $observatoryUri.');
|
globals.printTrace('Note: DDS is already connected to $observatoryUri.');
|
||||||
}
|
}
|
||||||
@ -483,7 +478,7 @@ Future<LaunchResult> _startApp(
|
|||||||
debuggingOptions: DebuggingOptions.enabled(
|
debuggingOptions: DebuggingOptions.enabled(
|
||||||
command.getBuildInfo(),
|
command.getBuildInfo(),
|
||||||
startPaused: true,
|
startPaused: true,
|
||||||
hostVmServicePort: (webUri != null || command.disableDds) ? command.hostVmservicePort : 0,
|
hostVmServicePort: command.hostVmservicePort,
|
||||||
verboseSystemLogs: command.verboseSystemLogs,
|
verboseSystemLogs: command.verboseSystemLogs,
|
||||||
cacheSkSL: command.cacheSkSL,
|
cacheSkSL: command.cacheSkSL,
|
||||||
dumpSkpOnShaderCompilation: command.dumpSkpOnShaderCompilation,
|
dumpSkpOnShaderCompilation: command.dumpSkpOnShaderCompilation,
|
||||||
|
@ -66,12 +66,7 @@ abstract class RunCommandBase extends FlutterCommand with DeviceBasedDevelopment
|
|||||||
help: 'A file to write the attached vmservice uri to after an'
|
help: 'A file to write the attached vmservice uri to after an'
|
||||||
' application is started.',
|
' application is started.',
|
||||||
valueHelp: 'project/example/out.txt'
|
valueHelp: 'project/example/out.txt'
|
||||||
)
|
);
|
||||||
..addFlag('disable-service-auth-codes',
|
|
||||||
negatable: false,
|
|
||||||
hide: !verboseHelp,
|
|
||||||
help: 'No longer require an authentication code to connect to the VM '
|
|
||||||
'service (not recommended).');
|
|
||||||
usesWebOptions(hide: !verboseHelp);
|
usesWebOptions(hide: !verboseHelp);
|
||||||
usesTargetOption();
|
usesTargetOption();
|
||||||
usesPortOptions();
|
usesPortOptions();
|
||||||
@ -80,14 +75,13 @@ abstract class RunCommandBase extends FlutterCommand with DeviceBasedDevelopment
|
|||||||
usesTrackWidgetCreation(verboseHelp: verboseHelp);
|
usesTrackWidgetCreation(verboseHelp: verboseHelp);
|
||||||
addNullSafetyModeOptions(hide: !verboseHelp);
|
addNullSafetyModeOptions(hide: !verboseHelp);
|
||||||
usesDeviceUserOption();
|
usesDeviceUserOption();
|
||||||
addDdsOptions(verboseHelp: verboseHelp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool get traceStartup => boolArg('trace-startup');
|
bool get traceStartup => boolArg('trace-startup');
|
||||||
bool get cacheSkSL => boolArg('cache-sksl');
|
bool get cacheSkSL => boolArg('cache-sksl');
|
||||||
bool get dumpSkpOnShaderCompilation => boolArg('dump-skp-on-shader-compilation');
|
bool get dumpSkpOnShaderCompilation => boolArg('dump-skp-on-shader-compilation');
|
||||||
bool get purgePersistentCache => boolArg('purge-persistent-cache');
|
bool get purgePersistentCache => boolArg('purge-persistent-cache');
|
||||||
bool get disableServiceAuthCodes => boolArg('disable-service-auth-codes');
|
|
||||||
String get route => stringArg('route');
|
String get route => stringArg('route');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,6 +205,11 @@ class RunCommand extends RunCommandBase {
|
|||||||
'results out to "refresh_benchmark.json", and exit. This flag is '
|
'results out to "refresh_benchmark.json", and exit. This flag is '
|
||||||
'intended for use in generating automated flutter benchmarks.',
|
'intended for use in generating automated flutter benchmarks.',
|
||||||
)
|
)
|
||||||
|
..addFlag('disable-service-auth-codes',
|
||||||
|
negatable: false,
|
||||||
|
hide: !verboseHelp,
|
||||||
|
help: 'No longer require an authentication code to connect to the VM '
|
||||||
|
'service (not recommended).')
|
||||||
..addFlag('web-initialize-platform',
|
..addFlag('web-initialize-platform',
|
||||||
negatable: true,
|
negatable: true,
|
||||||
defaultsTo: true,
|
defaultsTo: true,
|
||||||
@ -227,6 +226,7 @@ class RunCommand extends RunCommandBase {
|
|||||||
'Currently this is only supported on Android devices. This option '
|
'Currently this is only supported on Android devices. This option '
|
||||||
'cannot be paired with --use-application-binary.'
|
'cannot be paired with --use-application-binary.'
|
||||||
);
|
);
|
||||||
|
addDdsOptions(verboseHelp: verboseHelp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -130,7 +130,6 @@ class TestCommand extends FlutterCommand {
|
|||||||
'This flag is ignored if --start-paused or coverage are requested. '
|
'This flag is ignored if --start-paused or coverage are requested. '
|
||||||
'The vmservice will be enabled no matter what in those cases.'
|
'The vmservice will be enabled no matter what in those cases.'
|
||||||
);
|
);
|
||||||
addDdsOptions(verboseHelp: verboseHelp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The interface for starting and configuring the tester.
|
/// The interface for starting and configuring the tester.
|
||||||
@ -255,7 +254,6 @@ class TestCommand extends FlutterCommand {
|
|||||||
enableObservatory: collector != null || startPaused || boolArg('enable-vmservice'),
|
enableObservatory: collector != null || startPaused || boolArg('enable-vmservice'),
|
||||||
startPaused: startPaused,
|
startPaused: startPaused,
|
||||||
disableServiceAuthCodes: disableServiceAuthCodes,
|
disableServiceAuthCodes: disableServiceAuthCodes,
|
||||||
disableDds: disableDds,
|
|
||||||
ipv6: boolArg('ipv6'),
|
ipv6: boolArg('ipv6'),
|
||||||
machine: machine,
|
machine: machine,
|
||||||
buildMode: BuildMode.debug,
|
buildMode: BuildMode.debug,
|
||||||
|
@ -134,7 +134,7 @@ abstract class DesktopDevice extends Device {
|
|||||||
}
|
}
|
||||||
final ProtocolDiscovery observatoryDiscovery = ProtocolDiscovery.observatory(_deviceLogReader,
|
final ProtocolDiscovery observatoryDiscovery = ProtocolDiscovery.observatory(_deviceLogReader,
|
||||||
devicePort: debuggingOptions?.deviceVmServicePort,
|
devicePort: debuggingOptions?.deviceVmServicePort,
|
||||||
hostPort: (debuggingOptions?.disableDds ?? false) ? debuggingOptions?.hostVmServicePort : 0,
|
hostPort: debuggingOptions?.hostVmServicePort,
|
||||||
ipv6: ipv6,
|
ipv6: ipv6,
|
||||||
);
|
);
|
||||||
try {
|
try {
|
||||||
|
@ -55,14 +55,8 @@ Future<vm_service.VmService> _kDefaultFuchsiaIsolateDiscoveryConnector(Uri uri)
|
|||||||
Future<void> _kDefaultDartDevelopmentServiceStarter(
|
Future<void> _kDefaultDartDevelopmentServiceStarter(
|
||||||
Device device,
|
Device device,
|
||||||
Uri observatoryUri,
|
Uri observatoryUri,
|
||||||
bool disableServiceAuthCodes,
|
|
||||||
) async {
|
) async {
|
||||||
await device.dds.startDartDevelopmentService(
|
await device.dds.startDartDevelopmentService(observatoryUri, true);
|
||||||
observatoryUri,
|
|
||||||
0,
|
|
||||||
true,
|
|
||||||
disableServiceAuthCodes,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Read the log for a particular device.
|
/// Read the log for a particular device.
|
||||||
@ -744,7 +738,7 @@ class FuchsiaIsolateDiscoveryProtocol {
|
|||||||
final String _isolateName;
|
final String _isolateName;
|
||||||
final Completer<Uri> _foundUri = Completer<Uri>();
|
final Completer<Uri> _foundUri = Completer<Uri>();
|
||||||
final Future<vm_service.VmService> Function(Uri) _vmServiceConnector;
|
final Future<vm_service.VmService> Function(Uri) _vmServiceConnector;
|
||||||
final Future<void> Function(Device, Uri, bool) _ddsStarter;
|
final Future<void> Function(Device, Uri) _ddsStarter;
|
||||||
// whether to only poll once.
|
// whether to only poll once.
|
||||||
final bool _pollOnce;
|
final bool _pollOnce;
|
||||||
Timer _pollingTimer;
|
Timer _pollingTimer;
|
||||||
@ -787,8 +781,8 @@ class FuchsiaIsolateDiscoveryProtocol {
|
|||||||
final int localPort = await _device.portForwarder.forward(port);
|
final int localPort = await _device.portForwarder.forward(port);
|
||||||
try {
|
try {
|
||||||
final Uri uri = Uri.parse('http://[$_ipv6Loopback]:$localPort');
|
final Uri uri = Uri.parse('http://[$_ipv6Loopback]:$localPort');
|
||||||
await _ddsStarter(_device, uri, true);
|
await _ddsStarter(_device, uri);
|
||||||
service = await _vmServiceConnector(_device.dds.uri);
|
service = await _vmServiceConnector(uri);
|
||||||
_ports[port] = service;
|
_ports[port] = service;
|
||||||
} on SocketException catch (err) {
|
} on SocketException catch (err) {
|
||||||
globals.printTrace('Failed to connect to $localPort: $err');
|
globals.printTrace('Failed to connect to $localPort: $err');
|
||||||
|
@ -399,7 +399,7 @@ class IOSDevice extends Device {
|
|||||||
observatoryDiscovery = ProtocolDiscovery.observatory(
|
observatoryDiscovery = ProtocolDiscovery.observatory(
|
||||||
getLogReader(app: package),
|
getLogReader(app: package),
|
||||||
portForwarder: portForwarder,
|
portForwarder: portForwarder,
|
||||||
hostPort: debuggingOptions.disableDds ? debuggingOptions.hostVmServicePort : 0,
|
hostPort: debuggingOptions.hostVmServicePort,
|
||||||
devicePort: debuggingOptions.deviceVmServicePort,
|
devicePort: debuggingOptions.deviceVmServicePort,
|
||||||
ipv6: ipv6,
|
ipv6: ipv6,
|
||||||
);
|
);
|
||||||
@ -436,7 +436,7 @@ class IOSDevice extends Device {
|
|||||||
assumedDevicePort: assumedObservatoryPort,
|
assumedDevicePort: assumedObservatoryPort,
|
||||||
device: this,
|
device: this,
|
||||||
usesIpv6: ipv6,
|
usesIpv6: ipv6,
|
||||||
hostVmservicePort: debuggingOptions.disableDds ? debuggingOptions.hostVmServicePort : 0,
|
hostVmservicePort: debuggingOptions.hostVmServicePort,
|
||||||
packageId: packageId,
|
packageId: packageId,
|
||||||
packageName: FlutterProject.current().manifest.appName,
|
packageName: FlutterProject.current().manifest.appName,
|
||||||
);
|
);
|
||||||
|
@ -424,11 +424,8 @@ class IOSSimulator extends Device {
|
|||||||
if (debuggingOptions.skiaDeterministicRendering) '--skia-deterministic-rendering',
|
if (debuggingOptions.skiaDeterministicRendering) '--skia-deterministic-rendering',
|
||||||
if (debuggingOptions.useTestFonts) '--use-test-fonts',
|
if (debuggingOptions.useTestFonts) '--use-test-fonts',
|
||||||
if (debuggingOptions.traceAllowlist != null) '--trace-allowlist="${debuggingOptions.traceAllowlist}"',
|
if (debuggingOptions.traceAllowlist != null) '--trace-allowlist="${debuggingOptions.traceAllowlist}"',
|
||||||
if (dartVmFlags.isNotEmpty) '--dart-flags=$dartVmFlags',
|
if (dartVmFlags.isNotEmpty) '--dart-flags=$dartVmFlags'
|
||||||
if (debuggingOptions.disableDds)
|
'--observatory-port=${debuggingOptions.hostVmServicePort ?? 0}',
|
||||||
'--observatory-port=${debuggingOptions.hostVmServicePort ?? 0}'
|
|
||||||
else
|
|
||||||
'--observatory-port=0'
|
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -437,7 +434,7 @@ class IOSSimulator extends Device {
|
|||||||
observatoryDiscovery = ProtocolDiscovery.observatory(
|
observatoryDiscovery = ProtocolDiscovery.observatory(
|
||||||
getLogReader(app: package),
|
getLogReader(app: package),
|
||||||
ipv6: ipv6,
|
ipv6: ipv6,
|
||||||
hostPort: debuggingOptions.disableDds ? debuggingOptions.hostVmServicePort : 0,
|
hostPort: debuggingOptions.hostVmServicePort,
|
||||||
devicePort: debuggingOptions.deviceVmServicePort,
|
devicePort: debuggingOptions.deviceVmServicePort,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -205,8 +205,6 @@ class FlutterDevice {
|
|||||||
ReloadMethod reloadMethod,
|
ReloadMethod reloadMethod,
|
||||||
GetSkSLMethod getSkSLMethod,
|
GetSkSLMethod getSkSLMethod,
|
||||||
PrintStructuredErrorLogMethod printStructuredErrorLogMethod,
|
PrintStructuredErrorLogMethod printStructuredErrorLogMethod,
|
||||||
int hostVmServicePort,
|
|
||||||
bool disableServiceAuthCodes = false,
|
|
||||||
bool disableDds = false,
|
bool disableDds = false,
|
||||||
bool ipv6 = false,
|
bool ipv6 = false,
|
||||||
}) {
|
}) {
|
||||||
@ -222,14 +220,12 @@ class FlutterDevice {
|
|||||||
if (!disableDds) {
|
if (!disableDds) {
|
||||||
await device.dds.startDartDevelopmentService(
|
await device.dds.startDartDevelopmentService(
|
||||||
observatoryUri,
|
observatoryUri,
|
||||||
hostVmServicePort,
|
|
||||||
ipv6,
|
ipv6,
|
||||||
disableServiceAuthCodes,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
service = await connectToVmService(
|
service = await connectToVmService(
|
||||||
disableDds ? observatoryUri : device.dds.uri,
|
observatoryUri,
|
||||||
reloadSources: reloadSources,
|
reloadSources: reloadSources,
|
||||||
restart: restart,
|
restart: restart,
|
||||||
compileExpression: compileExpression,
|
compileExpression: compileExpression,
|
||||||
@ -1236,12 +1232,10 @@ abstract class ResidentRunner {
|
|||||||
restart: restart,
|
restart: restart,
|
||||||
compileExpression: compileExpression,
|
compileExpression: compileExpression,
|
||||||
disableDds: debuggingOptions.disableDds,
|
disableDds: debuggingOptions.disableDds,
|
||||||
hostVmServicePort: debuggingOptions.hostVmServicePort,
|
|
||||||
reloadMethod: reloadMethod,
|
reloadMethod: reloadMethod,
|
||||||
getSkSLMethod: getSkSLMethod,
|
getSkSLMethod: getSkSLMethod,
|
||||||
printStructuredErrorLogMethod: printStructuredErrorLog,
|
printStructuredErrorLogMethod: printStructuredErrorLog,
|
||||||
ipv6: ipv6,
|
ipv6: ipv6,
|
||||||
disableServiceAuthCodes: debuggingOptions.disableServiceAuthCodes
|
|
||||||
);
|
);
|
||||||
// This will wait for at least one flutter view before returning.
|
// This will wait for at least one flutter view before returning.
|
||||||
final Status status = globals.logger.startProgress(
|
final Status status = globals.logger.startProgress(
|
||||||
|
@ -312,8 +312,6 @@ abstract class FlutterCommand extends Command<void> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool get disableDds => boolArg('disable-dds');
|
|
||||||
|
|
||||||
/// Gets the vmservice port provided to in the 'observatory-port' or
|
/// Gets the vmservice port provided to in the 'observatory-port' or
|
||||||
/// 'host-vmservice-port option.
|
/// 'host-vmservice-port option.
|
||||||
///
|
///
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:dds/dds.dart';
|
|
||||||
import 'package:meta/meta.dart';
|
import 'package:meta/meta.dart';
|
||||||
import 'package:package_config/package_config.dart';
|
import 'package:package_config/package_config.dart';
|
||||||
import 'package:stream_channel/stream_channel.dart';
|
import 'package:stream_channel/stream_channel.dart';
|
||||||
@ -53,7 +52,6 @@ FlutterPlatform installHook({
|
|||||||
bool machine = false,
|
bool machine = false,
|
||||||
bool startPaused = false,
|
bool startPaused = false,
|
||||||
bool disableServiceAuthCodes = false,
|
bool disableServiceAuthCodes = false,
|
||||||
bool disableDds = false,
|
|
||||||
int port = 0,
|
int port = 0,
|
||||||
String precompiledDillPath,
|
String precompiledDillPath,
|
||||||
Map<String, String> precompiledDillFiles,
|
Map<String, String> precompiledDillFiles,
|
||||||
@ -91,7 +89,6 @@ FlutterPlatform installHook({
|
|||||||
enableObservatory: enableObservatory,
|
enableObservatory: enableObservatory,
|
||||||
startPaused: startPaused,
|
startPaused: startPaused,
|
||||||
disableServiceAuthCodes: disableServiceAuthCodes,
|
disableServiceAuthCodes: disableServiceAuthCodes,
|
||||||
disableDds: disableDds,
|
|
||||||
explicitObservatoryPort: observatoryPort,
|
explicitObservatoryPort: observatoryPort,
|
||||||
host: _kHosts[serverType],
|
host: _kHosts[serverType],
|
||||||
port: port,
|
port: port,
|
||||||
@ -236,7 +233,6 @@ class FlutterPlatform extends PlatformPlugin {
|
|||||||
this.machine,
|
this.machine,
|
||||||
this.startPaused,
|
this.startPaused,
|
||||||
this.disableServiceAuthCodes,
|
this.disableServiceAuthCodes,
|
||||||
this.disableDds,
|
|
||||||
this.explicitObservatoryPort,
|
this.explicitObservatoryPort,
|
||||||
this.host,
|
this.host,
|
||||||
this.port,
|
this.port,
|
||||||
@ -259,7 +255,6 @@ class FlutterPlatform extends PlatformPlugin {
|
|||||||
final bool machine;
|
final bool machine;
|
||||||
final bool startPaused;
|
final bool startPaused;
|
||||||
final bool disableServiceAuthCodes;
|
final bool disableServiceAuthCodes;
|
||||||
final bool disableDds;
|
|
||||||
final int explicitObservatoryPort;
|
final int explicitObservatoryPort;
|
||||||
final InternetAddress host;
|
final InternetAddress host;
|
||||||
final int port;
|
final int port;
|
||||||
@ -407,7 +402,7 @@ class FlutterPlatform extends PlatformPlugin {
|
|||||||
controllerSinkClosed = true;
|
controllerSinkClosed = true;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// Prepare our WebSocket server to talk to the engine subprocess.
|
// Prepare our WebSocket server to talk to the engine subproces.
|
||||||
final HttpServer server = await bind(host, port);
|
final HttpServer server = await bind(host, port);
|
||||||
finalizers.add(() async {
|
finalizers.add(() async {
|
||||||
globals.printTrace('test $ourTestCount: shutting down test harness socket server');
|
globals.printTrace('test $ourTestCount: shutting down test harness socket server');
|
||||||
@ -501,16 +496,15 @@ class FlutterPlatform extends PlatformPlugin {
|
|||||||
assert(processObservatoryUri == null);
|
assert(processObservatoryUri == null);
|
||||||
assert(explicitObservatoryPort == null ||
|
assert(explicitObservatoryPort == null ||
|
||||||
explicitObservatoryPort == detectedUri.port);
|
explicitObservatoryPort == detectedUri.port);
|
||||||
if (!disableDds) {
|
if (startPaused && !machine) {
|
||||||
final DartDevelopmentService dds = await DartDevelopmentService.startDartDevelopmentService(
|
globals.printStatus('The test process has been started.');
|
||||||
detectedUri,
|
globals.printStatus('You can now connect to it using observatory. To connect, load the following Web site in your browser:');
|
||||||
enableAuthCodes: !disableServiceAuthCodes,
|
globals.printStatus(' $detectedUri');
|
||||||
);
|
globals.printStatus('You should first set appropriate breakpoints, then resume the test in the debugger.');
|
||||||
processObservatoryUri = dds.uri;
|
|
||||||
globals.printTrace('Dart Development Service started at ${dds.uri}, forwarding to VM service at ${dds.remoteVmServiceUri}.');
|
|
||||||
} else {
|
} else {
|
||||||
processObservatoryUri = detectedUri;
|
globals.printTrace('test $ourTestCount: using observatory uri $detectedUri from pid ${process.pid}');
|
||||||
}
|
}
|
||||||
|
processObservatoryUri = detectedUri;
|
||||||
{
|
{
|
||||||
globals.printTrace('Connecting to service protocol: $processObservatoryUri');
|
globals.printTrace('Connecting to service protocol: $processObservatoryUri');
|
||||||
final Future<vm_service.VmService> localVmService = connectToVmService(processObservatoryUri,
|
final Future<vm_service.VmService> localVmService = connectToVmService(processObservatoryUri,
|
||||||
@ -519,14 +513,6 @@ class FlutterPlatform extends PlatformPlugin {
|
|||||||
globals.printTrace('Successfully connected to service protocol: $processObservatoryUri');
|
globals.printTrace('Successfully connected to service protocol: $processObservatoryUri');
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
if (startPaused && !machine) {
|
|
||||||
globals.printStatus('The test process has been started.');
|
|
||||||
globals.printStatus('You can now connect to it using observatory. To connect, load the following Web site in your browser:');
|
|
||||||
globals.printStatus(' $processObservatoryUri');
|
|
||||||
globals.printStatus('You should first set appropriate breakpoints, then resume the test in the debugger.');
|
|
||||||
} else {
|
|
||||||
globals.printTrace('test $ourTestCount: using observatory uri $processObservatoryUri from pid ${process.pid}');
|
|
||||||
}
|
|
||||||
gotProcessObservatoryUri.complete();
|
gotProcessObservatoryUri.complete();
|
||||||
watcher?.handleStartedProcess(
|
watcher?.handleStartedProcess(
|
||||||
ProcessEvent(ourTestCount, process, processObservatoryUri));
|
ProcessEvent(ourTestCount, process, processObservatoryUri));
|
||||||
|
@ -36,7 +36,6 @@ abstract class FlutterTestRunner {
|
|||||||
bool enableObservatory = false,
|
bool enableObservatory = false,
|
||||||
bool startPaused = false,
|
bool startPaused = false,
|
||||||
bool disableServiceAuthCodes = false,
|
bool disableServiceAuthCodes = false,
|
||||||
bool disableDds = false,
|
|
||||||
bool ipv6 = false,
|
bool ipv6 = false,
|
||||||
bool machine = false,
|
bool machine = false,
|
||||||
String precompiledDillPath,
|
String precompiledDillPath,
|
||||||
@ -72,7 +71,6 @@ class _FlutterTestRunnerImpl implements FlutterTestRunner {
|
|||||||
bool enableObservatory = false,
|
bool enableObservatory = false,
|
||||||
bool startPaused = false,
|
bool startPaused = false,
|
||||||
bool disableServiceAuthCodes = false,
|
bool disableServiceAuthCodes = false,
|
||||||
bool disableDds = false,
|
|
||||||
bool ipv6 = false,
|
bool ipv6 = false,
|
||||||
bool machine = false,
|
bool machine = false,
|
||||||
String precompiledDillPath,
|
String precompiledDillPath,
|
||||||
@ -171,7 +169,6 @@ class _FlutterTestRunnerImpl implements FlutterTestRunner {
|
|||||||
machine: machine,
|
machine: machine,
|
||||||
startPaused: startPaused,
|
startPaused: startPaused,
|
||||||
disableServiceAuthCodes: disableServiceAuthCodes,
|
disableServiceAuthCodes: disableServiceAuthCodes,
|
||||||
disableDds: disableDds,
|
|
||||||
serverType: serverType,
|
serverType: serverType,
|
||||||
precompiledDillPath: precompiledDillPath,
|
precompiledDillPath: precompiledDillPath,
|
||||||
precompiledDillFiles: precompiledDillFiles,
|
precompiledDillFiles: precompiledDillFiles,
|
||||||
|
@ -178,7 +178,7 @@ class FlutterTesterDevice extends Device {
|
|||||||
if (debuggingOptions.disableServiceAuthCodes)
|
if (debuggingOptions.disableServiceAuthCodes)
|
||||||
'--disable-service-auth-codes',
|
'--disable-service-auth-codes',
|
||||||
if (debuggingOptions.hasObservatoryPort)
|
if (debuggingOptions.hasObservatoryPort)
|
||||||
'--observatory-port=${debuggingOptions.disableDds ? debuggingOptions.hostVmServicePort : 0}',
|
'--observatory-port=${debuggingOptions.hostVmServicePort}',
|
||||||
applicationKernelFilePath
|
applicationKernelFilePath
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -205,7 +205,7 @@ class FlutterTesterDevice extends Device {
|
|||||||
|
|
||||||
observatoryDiscovery = ProtocolDiscovery.observatory(
|
observatoryDiscovery = ProtocolDiscovery.observatory(
|
||||||
getLogReader(),
|
getLogReader(),
|
||||||
hostPort: debuggingOptions.disableDds ? debuggingOptions.hostVmServicePort : 0,
|
hostPort: debuggingOptions.hostVmServicePort,
|
||||||
devicePort: debuggingOptions.deviceVmServicePort,
|
devicePort: debuggingOptions.deviceVmServicePort,
|
||||||
ipv6: ipv6,
|
ipv6: ipv6,
|
||||||
);
|
);
|
||||||
|
@ -90,8 +90,8 @@ void main() {
|
|||||||
when(portForwarder.unforward(any))
|
when(portForwarder.unforward(any))
|
||||||
.thenAnswer((_) async {});
|
.thenAnswer((_) async {});
|
||||||
when(device.dds).thenReturn(mockDds);
|
when(device.dds).thenReturn(mockDds);
|
||||||
when(mockDds.startDartDevelopmentService(any, any, false, any)).thenReturn(null);
|
when(mockDds.startDartDevelopmentService(any, false)).thenReturn(null);
|
||||||
when(mockDds.uri).thenReturn(Uri.parse('http://localhost:8181'));
|
|
||||||
final HttpClientRequest httpClientRequest = MockHttpClientRequest();
|
final HttpClientRequest httpClientRequest = MockHttpClientRequest();
|
||||||
httpClient = MockHttpClient();
|
httpClient = MockHttpClient();
|
||||||
when(httpClient.putUrl(any))
|
when(httpClient.putUrl(any))
|
||||||
@ -317,8 +317,7 @@ void main() {
|
|||||||
)).thenReturn(mockHotRunner);
|
)).thenReturn(mockHotRunner);
|
||||||
when(mockHotRunner.exited).thenReturn(false);
|
when(mockHotRunner.exited).thenReturn(false);
|
||||||
when(mockHotRunner.isWaitingForObservatory).thenReturn(false);
|
when(mockHotRunner.isWaitingForObservatory).thenReturn(false);
|
||||||
when(mockDds.startDartDevelopmentService(any, any, false, any)).thenReturn(null);
|
when(mockDds.startDartDevelopmentService(any, false)).thenReturn(null);
|
||||||
when(mockDds.uri).thenReturn(Uri.parse('http://localhost:8181'));
|
|
||||||
|
|
||||||
testDeviceManager.addDevice(device);
|
testDeviceManager.addDevice(device);
|
||||||
when(device.getLogReader(includePastLogs: anyNamed('includePastLogs')))
|
when(device.getLogReader(includePastLogs: anyNamed('includePastLogs')))
|
||||||
@ -397,8 +396,7 @@ void main() {
|
|||||||
)).thenReturn(mockHotRunner);
|
)).thenReturn(mockHotRunner);
|
||||||
when(mockHotRunner.exited).thenReturn(false);
|
when(mockHotRunner.exited).thenReturn(false);
|
||||||
when(mockHotRunner.isWaitingForObservatory).thenReturn(false);
|
when(mockHotRunner.isWaitingForObservatory).thenReturn(false);
|
||||||
when(mockDds.startDartDevelopmentService(any, any, false, any)).thenReturn(null);
|
when(mockDds.startDartDevelopmentService(any, false)).thenReturn(null);
|
||||||
when(mockDds.uri).thenReturn(Uri.parse('http://localhost:8181'));
|
|
||||||
|
|
||||||
testDeviceManager.addDevice(device);
|
testDeviceManager.addDevice(device);
|
||||||
|
|
||||||
@ -444,9 +442,8 @@ void main() {
|
|||||||
.thenAnswer((_) async {});
|
.thenAnswer((_) async {});
|
||||||
when(device.dds)
|
when(device.dds)
|
||||||
.thenReturn(mockDds);
|
.thenReturn(mockDds);
|
||||||
when(mockDds.startDartDevelopmentService(any, any, any, any))
|
when(mockDds.startDartDevelopmentService(any, any))
|
||||||
.thenReturn(null);
|
.thenReturn(null);
|
||||||
when(mockDds.uri).thenReturn(Uri.parse('http://localhost:8181'));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
testUsingContext('succeeds in ipv4 mode', () async {
|
testUsingContext('succeeds in ipv4 mode', () async {
|
||||||
|
@ -71,8 +71,7 @@ void main() {
|
|||||||
void applyDdsMocks(Device device) {
|
void applyDdsMocks(Device device) {
|
||||||
final MockDartDevelopmentService mockDds = MockDartDevelopmentService();
|
final MockDartDevelopmentService mockDds = MockDartDevelopmentService();
|
||||||
when(device.dds).thenReturn(mockDds);
|
when(device.dds).thenReturn(mockDds);
|
||||||
when(mockDds.startDartDevelopmentService(any, any, any, any)).thenReturn(null);
|
when(mockDds.startDartDevelopmentService(any, any)).thenReturn(null);
|
||||||
when(mockDds.uri).thenReturn(Uri.parse('http://localhost:8181'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
testUsingContext('returns 1 when test file is not found', () async {
|
testUsingContext('returns 1 when test file is not found', () async {
|
||||||
|
@ -168,7 +168,6 @@ class FakeFlutterTestRunner implements FlutterTestRunner {
|
|||||||
String excludeTags,
|
String excludeTags,
|
||||||
bool enableObservatory = false,
|
bool enableObservatory = false,
|
||||||
bool startPaused = false,
|
bool startPaused = false,
|
||||||
bool disableDds = false,
|
|
||||||
bool disableServiceAuthCodes = false,
|
bool disableServiceAuthCodes = false,
|
||||||
bool ipv6 = false,
|
bool ipv6 = false,
|
||||||
bool machine = false,
|
bool machine = false,
|
||||||
|
@ -140,8 +140,6 @@ class TestFlutterDevice extends FlutterDevice {
|
|||||||
GetSkSLMethod getSkSLMethod,
|
GetSkSLMethod getSkSLMethod,
|
||||||
PrintStructuredErrorLogMethod printStructuredErrorLogMethod,
|
PrintStructuredErrorLogMethod printStructuredErrorLogMethod,
|
||||||
bool disableDds = false,
|
bool disableDds = false,
|
||||||
bool disableServiceAuthCodes = false,
|
|
||||||
int hostVmServicePort,
|
|
||||||
bool ipv6 = false,
|
bool ipv6 = false,
|
||||||
}) async {
|
}) async {
|
||||||
throw exception;
|
throw exception;
|
||||||
|
@ -10,7 +10,6 @@ import 'package:flutter_tools/src/application_package.dart';
|
|||||||
import 'package:flutter_tools/src/artifacts.dart';
|
import 'package:flutter_tools/src/artifacts.dart';
|
||||||
import 'package:flutter_tools/src/base/common.dart';
|
import 'package:flutter_tools/src/base/common.dart';
|
||||||
import 'package:flutter_tools/src/base/context.dart';
|
import 'package:flutter_tools/src/base/context.dart';
|
||||||
import 'package:flutter_tools/src/base/dds.dart';
|
|
||||||
import 'package:flutter_tools/src/base/file_system.dart';
|
import 'package:flutter_tools/src/base/file_system.dart';
|
||||||
import 'package:flutter_tools/src/base/io.dart';
|
import 'package:flutter_tools/src/base/io.dart';
|
||||||
import 'package:flutter_tools/src/base/logger.dart';
|
import 'package:flutter_tools/src/base/logger.dart';
|
||||||
@ -770,13 +769,10 @@ void main() {
|
|||||||
fuchsiaDevice,
|
fuchsiaDevice,
|
||||||
expectedIsolateName,
|
expectedIsolateName,
|
||||||
(Uri uri) async => fakeVmServiceHost.vmService,
|
(Uri uri) async => fakeVmServiceHost.vmService,
|
||||||
(Device device, Uri uri, bool enableServiceAuthCodes) => null,
|
(Device device, Uri uri) => null,
|
||||||
true, // only poll once.
|
true, // only poll once.
|
||||||
);
|
);
|
||||||
final MockDartDevelopmentService mockDds = MockDartDevelopmentService();
|
|
||||||
when(fuchsiaDevice.dds).thenReturn(mockDds);
|
|
||||||
when(mockDds.startDartDevelopmentService(any, any, any, any)).thenReturn(null);
|
|
||||||
when(mockDds.uri).thenReturn(Uri.parse('example'));
|
|
||||||
when(fuchsiaDevice.servicePorts())
|
when(fuchsiaDevice.servicePorts())
|
||||||
.thenAnswer((Invocation invocation) async => <int>[1]);
|
.thenAnswer((Invocation invocation) async => <int>[1]);
|
||||||
when(portForwarder.forward(1))
|
when(portForwarder.forward(1))
|
||||||
@ -1604,6 +1600,5 @@ class MockFuchsiaSdk extends Mock implements FuchsiaSdk {
|
|||||||
final FuchsiaDevFinder fuchsiaDevFinder;
|
final FuchsiaDevFinder fuchsiaDevFinder;
|
||||||
}
|
}
|
||||||
|
|
||||||
class MockDartDevelopmentService extends Mock implements DartDevelopmentService {}
|
|
||||||
class MockFuchsiaWorkflow extends Mock implements FuchsiaWorkflow {}
|
class MockFuchsiaWorkflow extends Mock implements FuchsiaWorkflow {}
|
||||||
class MockCache extends Mock implements Cache {}
|
class MockCache extends Mock implements Cache {}
|
||||||
|
@ -578,10 +578,8 @@ class TestFlutterDevice extends FlutterDevice {
|
|||||||
ReloadMethod reloadMethod,
|
ReloadMethod reloadMethod,
|
||||||
GetSkSLMethod getSkSLMethod,
|
GetSkSLMethod getSkSLMethod,
|
||||||
PrintStructuredErrorLogMethod printStructuredErrorLogMethod,
|
PrintStructuredErrorLogMethod printStructuredErrorLogMethod,
|
||||||
bool disableServiceAuthCodes = false,
|
|
||||||
bool disableDds = false,
|
bool disableDds = false,
|
||||||
bool ipv6 = false,
|
bool ipv6 = false,
|
||||||
int hostVmServicePort
|
|
||||||
}) async {
|
}) async {
|
||||||
throw exception;
|
throw exception;
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,6 @@ import 'dart:async';
|
|||||||
import 'package:file/memory.dart';
|
import 'package:file/memory.dart';
|
||||||
import 'package:flutter_tools/src/application_package.dart';
|
import 'package:flutter_tools/src/application_package.dart';
|
||||||
import 'package:flutter_tools/src/artifacts.dart';
|
import 'package:flutter_tools/src/artifacts.dart';
|
||||||
import 'package:flutter_tools/src/base/dds.dart';
|
|
||||||
import 'package:flutter_tools/src/base/file_system.dart';
|
import 'package:flutter_tools/src/base/file_system.dart';
|
||||||
import 'package:flutter_tools/src/base/io.dart' as io;
|
import 'package:flutter_tools/src/base/io.dart' as io;
|
||||||
import 'package:flutter_tools/src/base/logger.dart';
|
import 'package:flutter_tools/src/base/logger.dart';
|
||||||
@ -136,8 +135,7 @@ void main() {
|
|||||||
when(MDnsObservatoryDiscovery.instance.getObservatoryUri(
|
when(MDnsObservatoryDiscovery.instance.getObservatoryUri(
|
||||||
any,
|
any,
|
||||||
any,
|
any,
|
||||||
usesIpv6: anyNamed('usesIpv6'),
|
usesIpv6: anyNamed('usesIpv6')
|
||||||
hostVmservicePort: anyNamed('hostVmservicePort')
|
|
||||||
)).thenAnswer((Invocation invocation) async => uri);
|
)).thenAnswer((Invocation invocation) async => uri);
|
||||||
|
|
||||||
final LaunchResult launchResult = await device.startApp(iosApp,
|
final LaunchResult launchResult = await device.startApp(iosApp,
|
||||||
@ -369,7 +367,6 @@ void main() {
|
|||||||
any,
|
any,
|
||||||
any,
|
any,
|
||||||
usesIpv6: anyNamed('usesIpv6'),
|
usesIpv6: anyNamed('usesIpv6'),
|
||||||
hostVmservicePort: anyNamed('hostVmservicePort')
|
|
||||||
)).thenAnswer((Invocation invocation) async => uri);
|
)).thenAnswer((Invocation invocation) async => uri);
|
||||||
|
|
||||||
final LaunchResult launchResult = await device.startApp(iosApp,
|
final LaunchResult launchResult = await device.startApp(iosApp,
|
||||||
@ -457,4 +454,3 @@ class MockMDnsObservatoryDiscovery extends Mock implements MDnsObservatoryDiscov
|
|||||||
class MockArtifacts extends Mock implements Artifacts {}
|
class MockArtifacts extends Mock implements Artifacts {}
|
||||||
class MockCache extends Mock implements Cache {}
|
class MockCache extends Mock implements Cache {}
|
||||||
class MockVmService extends Mock implements VmService {}
|
class MockVmService extends Mock implements VmService {}
|
||||||
class MockDartDevelopmentService extends Mock implements DartDevelopmentService {}
|
|
@ -2095,8 +2095,7 @@ void main() {
|
|||||||
final MockDeviceLogReader mockLogReader = MockDeviceLogReader();
|
final MockDeviceLogReader mockLogReader = MockDeviceLogReader();
|
||||||
when(mockDevice.getLogReader(app: anyNamed('app'))).thenReturn(mockLogReader);
|
when(mockDevice.getLogReader(app: anyNamed('app'))).thenReturn(mockLogReader);
|
||||||
when(mockDevice.dds).thenReturn(mockDds);
|
when(mockDevice.dds).thenReturn(mockDds);
|
||||||
when(mockDds.startDartDevelopmentService(any, any, any, any)).thenReturn(null);
|
when(mockDds.startDartDevelopmentService(any, any)).thenReturn(null);
|
||||||
when(mockDds.uri).thenReturn(Uri.parse('http://localhost:8181'));
|
|
||||||
|
|
||||||
final TestFlutterDevice flutterDevice = TestFlutterDevice(
|
final TestFlutterDevice flutterDevice = TestFlutterDevice(
|
||||||
mockDevice,
|
mockDevice,
|
||||||
@ -2183,12 +2182,10 @@ class FakeFlutterDevice extends FlutterDevice {
|
|||||||
ReloadSources reloadSources,
|
ReloadSources reloadSources,
|
||||||
Restart restart,
|
Restart restart,
|
||||||
bool disableDds = false,
|
bool disableDds = false,
|
||||||
bool disableServiceAuthCodes = false,
|
|
||||||
bool ipv6 = false,
|
bool ipv6 = false,
|
||||||
CompileExpression compileExpression,
|
CompileExpression compileExpression,
|
||||||
ReloadMethod reloadMethod,
|
ReloadMethod reloadMethod,
|
||||||
GetSkSLMethod getSkSLMethod,
|
GetSkSLMethod getSkSLMethod,
|
||||||
int hostVmServicePort,
|
|
||||||
PrintStructuredErrorLogMethod printStructuredErrorLogMethod,
|
PrintStructuredErrorLogMethod printStructuredErrorLogMethod,
|
||||||
}) async { }
|
}) async { }
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ import 'dart:async';
|
|||||||
import 'dart:io'; // ignore: dart_io_import
|
import 'dart:io'; // ignore: dart_io_import
|
||||||
|
|
||||||
import 'package:file/file.dart';
|
import 'package:file/file.dart';
|
||||||
|
import 'package:flutter_tools/src/base/dds.dart';
|
||||||
import 'package:flutter_tools/src/base/file_system.dart';
|
import 'package:flutter_tools/src/base/file_system.dart';
|
||||||
import 'package:matcher/matcher.dart';
|
import 'package:matcher/matcher.dart';
|
||||||
import 'package:vm_service/vm_service.dart';
|
import 'package:vm_service/vm_service.dart';
|
||||||
@ -46,7 +47,7 @@ void main() {
|
|||||||
for (final Protocol protocol in protocolList.protocols) {
|
for (final Protocol protocol in protocolList.protocols) {
|
||||||
expect(protocol.protocolName, anyOf('VM Service', 'DDS'));
|
expect(protocol.protocolName, anyOf('VM Service', 'DDS'));
|
||||||
}
|
}
|
||||||
});
|
}, skip: DartDevelopmentService.ddsDisabled);
|
||||||
|
|
||||||
test('flutterVersion can be called', () async {
|
test('flutterVersion can be called', () async {
|
||||||
final Response response =
|
final Response response =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user