mirror of
https://github.com/flutter/flutter
synced 2024-10-13 19:52:53 +00:00
Revert "Allow FlutterTester to be provided with the working directory for execution (#21119)" (#21453)
This reverts commit 857bdc7a9a
.
This commit is contained in:
parent
857bdc7a9a
commit
409baff3ac
|
@ -41,9 +41,8 @@ class FlutterTesterApp extends ApplicationPackage {
|
|||
|
||||
// TODO(scheglov): This device does not currently work with full restarts.
|
||||
class FlutterTesterDevice extends Device {
|
||||
FlutterTesterDevice(String deviceId, { this.workingDirectory }) : super(deviceId);
|
||||
FlutterTesterDevice(String deviceId) : super(deviceId);
|
||||
|
||||
final String workingDirectory;
|
||||
Process _process;
|
||||
final DevicePortForwarder _portForwarder = new _NoopPortForwarder();
|
||||
|
||||
|
@ -152,7 +151,6 @@ class FlutterTesterDevice extends Device {
|
|||
environment: <String, String>{
|
||||
'FLUTTER_TEST': 'true',
|
||||
},
|
||||
workingDirectory: workingDirectory,
|
||||
);
|
||||
// Setting a bool can't fail in the callback.
|
||||
_process.exitCode.then((_) => _isRunning = false); // ignore: unawaited_futures
|
||||
|
|
|
@ -15,20 +15,27 @@ import '../src/context.dart';
|
|||
import 'test_utils.dart';
|
||||
|
||||
void main() {
|
||||
|
||||
group('FlutterTesterDevice', () {
|
||||
Directory tempDir;
|
||||
FlutterTesterDevice device;
|
||||
Directory oldCurrentDir;
|
||||
|
||||
setUp(() async {
|
||||
tempDir = fs.systemTempDirectory.createTempSync('flutter_tester_device_test.');
|
||||
device = new FlutterTesterDevice('flutter-tester', workingDirectory: tempDir.path);
|
||||
oldCurrentDir = fs.currentDirectory;
|
||||
fs.currentDirectory = tempDir;
|
||||
});
|
||||
|
||||
tearDown(() {
|
||||
fs.currentDirectory = oldCurrentDir;
|
||||
tryToDelete(tempDir);
|
||||
});
|
||||
|
||||
group('FlutterTesterDevice', () {
|
||||
FlutterTesterDevice device;
|
||||
|
||||
setUp(() {
|
||||
device = new FlutterTesterDevice('flutter-tester');
|
||||
});
|
||||
|
||||
Future<LaunchResult> start(String mainPath) async {
|
||||
return await device.startApp(
|
||||
null,
|
||||
|
@ -43,7 +50,7 @@ void main() {
|
|||
writePubspec(tempDir.path);
|
||||
writePackages(tempDir.path);
|
||||
|
||||
final String mainPath = fs.path.join(tempDir.path, 'lib', 'main.dart');
|
||||
final String mainPath = fs.path.join('lib', 'main.dart');
|
||||
writeFile(mainPath, r'''
|
||||
import 'dart:async';
|
||||
void main() {
|
||||
|
|
Loading…
Reference in a new issue