Revert "Fix issue where DevTools would not be immediately available when using --start-paused" (#128117)
Reverts flutter/flutter#126698 There are a bunch of tool crashes on CI that start with this commit. I'm not sure this PR is the cause because there is no backtrace from the tool on the crashes. The only error message is `Oops; flutter has exited unexpectedly: "Null check operator used on a null value`.
This commit is contained in:
@@ -156,7 +156,6 @@ void main() {
|
||||
},
|
||||
),
|
||||
listViews,
|
||||
listViews,
|
||||
const FakeVmServiceRequest(
|
||||
method: 'ext.flutter.activeDevToolsServerAddress',
|
||||
args: <String, Object>{
|
||||
@@ -164,6 +163,7 @@ void main() {
|
||||
'value': 'http://localhost:8080',
|
||||
},
|
||||
),
|
||||
listViews,
|
||||
const FakeVmServiceRequest(
|
||||
method: 'ext.flutter.connectedVmServiceUri',
|
||||
args: <String, Object>{
|
||||
@@ -314,7 +314,6 @@ void main() {
|
||||
},
|
||||
),
|
||||
listViews,
|
||||
listViews,
|
||||
const FakeVmServiceRequest(
|
||||
method: 'ext.flutter.activeDevToolsServerAddress',
|
||||
args: <String, Object>{
|
||||
@@ -322,6 +321,7 @@ void main() {
|
||||
'value': 'http://localhost:8080',
|
||||
},
|
||||
),
|
||||
listViews,
|
||||
const FakeVmServiceRequest(
|
||||
method: 'ext.flutter.connectedVmServiceUri',
|
||||
args: <String, Object>{
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
// 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 'dart:async';
|
||||
|
||||
import 'package:flutter_tools/src/base/file_system.dart';
|
||||
import 'package:flutter_tools/src/base/io.dart';
|
||||
import 'package:flutter_tools/src/convert.dart';
|
||||
|
||||
import '../src/common.dart';
|
||||
import 'test_data/basic_project.dart';
|
||||
import 'test_utils.dart';
|
||||
|
||||
void main() {
|
||||
late Directory tempDir;
|
||||
final BasicProject project = BasicProject();
|
||||
|
||||
setUp(() async {
|
||||
tempDir = createResolvedTempDirectorySync('run_test.');
|
||||
await project.setUpIn(tempDir);
|
||||
});
|
||||
|
||||
tearDown(() async {
|
||||
tryToDelete(tempDir);
|
||||
});
|
||||
|
||||
// Regression test for https://github.com/flutter/flutter/issues/126691
|
||||
testWithoutContext('flutter run --start-paused prints DevTools URI', () async {
|
||||
final Completer<void> completer = Completer<void>();
|
||||
final RegExp matcher = RegExp(r'The Flutter DevTools debugger and profiler on');
|
||||
|
||||
final String flutterBin = fileSystem.path.join(getFlutterRoot(), 'bin', 'flutter');
|
||||
final Process process = await processManager.start(<String>[
|
||||
flutterBin,
|
||||
'run',
|
||||
'--start-paused',
|
||||
'-d',
|
||||
'flutter-tester',
|
||||
], workingDirectory: tempDir.path);
|
||||
|
||||
late StreamSubscription<String> sub;
|
||||
sub = process.stdout.transform(utf8.decoder).listen((String message) {
|
||||
if (message.contains(matcher)) {
|
||||
completer.complete();
|
||||
sub.cancel();
|
||||
}
|
||||
});
|
||||
await completer.future;
|
||||
process.kill();
|
||||
await process.exitCode;
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user