mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
[tool] remove some temporary printTrace calls (#151074)
Cleans up printTrace calls added while investigating https://github.com/flutter/flutter/issues/146879. Also makes[ this `catch` clause ](https://github.com/flutter/flutter/pull/151074/files#diff-214723283174eb75e740a102252215723aa56716226ea92d084ef8a5bea4e931L578-R581)more precise.
This commit is contained in:
parent
d07a165d22
commit
271e0427e3
@ -11,7 +11,7 @@ dependencies:
|
||||
string_scanner: 1.2.0
|
||||
url_launcher: 6.3.0
|
||||
cupertino_icons: 1.0.8
|
||||
video_player: 2.9.0
|
||||
video_player: 2.9.1
|
||||
scoped_model: 2.0.0
|
||||
shrine_images: 2.0.2
|
||||
|
||||
@ -271,4 +271,4 @@ flutter:
|
||||
- asset: packages/flutter_gallery_assets/fonts/merriweather/Merriweather-Regular.ttf
|
||||
- asset: packages/flutter_gallery_assets/fonts/merriweather/Merriweather-Light.ttf
|
||||
|
||||
# PUBSPEC CHECKSUM: f518
|
||||
# PUBSPEC CHECKSUM: e619
|
||||
|
||||
@ -172,7 +172,11 @@ class ResidentWebRunner extends ResidentRunner {
|
||||
final vmservice.VmService? service = _connectionResult?.vmService;
|
||||
final Uri websocketUri = Uri.parse(_connectionResult!.debugConnection!.uri);
|
||||
final Uri httpUri = _httpUriFromWebsocketUri(websocketUri);
|
||||
return _instance ??= FlutterVmService(service!, wsAddress: websocketUri, httpAddress: httpUri, logger: _logger);
|
||||
return _instance ??= FlutterVmService(
|
||||
service!,
|
||||
wsAddress: websocketUri,
|
||||
httpAddress: httpUri,
|
||||
);
|
||||
}
|
||||
|
||||
FlutterVmService? _instance;
|
||||
|
||||
@ -417,7 +417,7 @@ Future<FlutterVmService> _connect(
|
||||
// This call is to ensure we are able to establish a connection instead of
|
||||
// keeping on trucking and failing farther down the process.
|
||||
await delegateService.getVersion();
|
||||
return FlutterVmService(service, httpAddress: httpUri, wsAddress: wsUri, logger: logger);
|
||||
return FlutterVmService(service, httpAddress: httpUri, wsAddress: wsUri);
|
||||
}
|
||||
|
||||
String _validateRpcStringParam(String methodName, Map<String, Object?> params, String paramName) {
|
||||
@ -486,13 +486,11 @@ class FlutterVmService {
|
||||
this.service, {
|
||||
this.wsAddress,
|
||||
this.httpAddress,
|
||||
required Logger logger,
|
||||
}) : _logger = logger;
|
||||
});
|
||||
|
||||
final vm_service.VmService service;
|
||||
final Uri? wsAddress;
|
||||
final Uri? httpAddress;
|
||||
final Logger _logger;
|
||||
|
||||
Future<vm_service.Response?> callMethodWrapper(
|
||||
String method, {
|
||||
@ -571,22 +569,19 @@ class FlutterVmService {
|
||||
required Uri main,
|
||||
required Uri assetsDirectory,
|
||||
}) async {
|
||||
_logger.printTrace('Running $main in view $viewId...');
|
||||
try {
|
||||
await service.streamListen(vm_service.EventStreams.kIsolate);
|
||||
} on vm_service.RPCError catch (e) {
|
||||
_logger.printTrace(
|
||||
'Unable to listen to VM service stream "${vm_service.EventStreams.kIsolate}".\n'
|
||||
'Error: $e',
|
||||
);
|
||||
// Do nothing, since the tool is already subscribed.
|
||||
// Do nothing if the tool is already subscribed.
|
||||
const int streamAlreadySubscribed = 103;
|
||||
if (e.code != streamAlreadySubscribed) {
|
||||
rethrow;
|
||||
}
|
||||
}
|
||||
|
||||
final Future<void> onRunnable = service.onIsolateEvent.firstWhere((vm_service.Event event) {
|
||||
_logger.printTrace('runInView VM service onIsolateEvent listener received $event');
|
||||
return event.kind == vm_service.EventKind.kIsolateRunnable;
|
||||
});
|
||||
_logger.printTrace('Calling $kRunInViewMethod...');
|
||||
await callMethodWrapper(
|
||||
kRunInViewMethod,
|
||||
args: <String, Object>{
|
||||
@ -595,9 +590,7 @@ class FlutterVmService {
|
||||
'assetDirectory': assetsDirectory.toString(),
|
||||
},
|
||||
);
|
||||
_logger.printTrace('Finished $kRunInViewMethod');
|
||||
await onRunnable;
|
||||
_logger.printTrace('Finished running $main in view $viewId');
|
||||
}
|
||||
|
||||
/// Renders the last frame with additional raster tracing enabled.
|
||||
|
||||
@ -167,7 +167,7 @@ void main() {
|
||||
|
||||
testWithoutContext('setAssetDirectory forwards arguments correctly', () async {
|
||||
final MockVMService mockVMService = MockVMService();
|
||||
final FlutterVmService flutterVmService = FlutterVmService(mockVMService, logger: BufferLogger.test());
|
||||
final FlutterVmService flutterVmService = FlutterVmService(mockVMService);
|
||||
|
||||
await flutterVmService.setAssetDirectory(
|
||||
assetsDirectory: Uri(path: 'abc', scheme: 'file'),
|
||||
@ -186,7 +186,7 @@ void main() {
|
||||
|
||||
testWithoutContext('setAssetDirectory forwards arguments correctly - windows', () async {
|
||||
final MockVMService mockVMService = MockVMService();
|
||||
final FlutterVmService flutterVmService = FlutterVmService(mockVMService, logger: BufferLogger.test());
|
||||
final FlutterVmService flutterVmService = FlutterVmService(mockVMService);
|
||||
|
||||
await flutterVmService.setAssetDirectory(
|
||||
assetsDirectory: Uri(path: 'C:/Users/Tester/AppData/Local/Temp/hello_worldb42a6da5/hello_world/build/flutter_assets', scheme: 'file'),
|
||||
@ -207,7 +207,7 @@ void main() {
|
||||
|
||||
testWithoutContext('getSkSLs forwards arguments correctly', () async {
|
||||
final MockVMService mockVMService = MockVMService();
|
||||
final FlutterVmService flutterVmService = FlutterVmService(mockVMService, logger: BufferLogger.test());
|
||||
final FlutterVmService flutterVmService = FlutterVmService(mockVMService);
|
||||
|
||||
await flutterVmService.getSkSLs(viewId: 'abc');
|
||||
|
||||
@ -220,7 +220,7 @@ void main() {
|
||||
|
||||
testWithoutContext('flushUIThreadTasks forwards arguments correctly', () async {
|
||||
final MockVMService mockVMService = MockVMService();
|
||||
final FlutterVmService flutterVmService = FlutterVmService(mockVMService, logger: BufferLogger.test());
|
||||
final FlutterVmService flutterVmService = FlutterVmService(mockVMService);
|
||||
|
||||
await flutterVmService.flushUIThreadTasks(uiIsolateId: 'def');
|
||||
|
||||
|
||||
@ -4,7 +4,6 @@
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter_tools/src/base/logger.dart';
|
||||
import 'package:flutter_tools/src/convert.dart';
|
||||
import 'package:flutter_tools/src/vmservice.dart';
|
||||
import 'package:test/test.dart' hide test;
|
||||
@ -23,7 +22,7 @@ class FakeVmServiceHost {
|
||||
_vmService = FlutterVmService(vm_service.VmService(
|
||||
_input.stream,
|
||||
_output.add,
|
||||
), httpAddress: httpAddress, wsAddress: wsAddress, logger: BufferLogger.test());
|
||||
), httpAddress: httpAddress, wsAddress: wsAddress);
|
||||
_applyStreamListen();
|
||||
_output.stream.listen((String data) {
|
||||
final Map<String, Object?> request = json.decode(data) as Map<String, Object?>;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user