sort_constructors_first (#22575)
This commit is contained in:
committed by
GitHub
parent
a68b03e9ce
commit
2ea1d81cdc
@@ -510,18 +510,17 @@ class FakeGroupedDoctorWithStatus extends Doctor {
|
||||
/// A doctor that takes any two validators. Used to check behavior when
|
||||
/// merging ValidationTypes (installed, missing, partial).
|
||||
class FakeSmallGroupDoctor extends Doctor {
|
||||
List<DoctorValidator> _validators;
|
||||
FakeSmallGroupDoctor(DoctorValidator val1, DoctorValidator val2) {
|
||||
_validators = <DoctorValidator>[GroupedValidator(<DoctorValidator>[val1, val2])];
|
||||
}
|
||||
|
||||
List<DoctorValidator> _validators;
|
||||
|
||||
@override
|
||||
List<DoctorValidator> get validators => _validators;
|
||||
}
|
||||
|
||||
class VsCodeValidatorTestTargets extends VsCodeValidator {
|
||||
static final String validInstall = fs.path.join('test', 'data', 'vscode', 'application');
|
||||
static final String validExtensions = fs.path.join('test', 'data', 'vscode', 'extensions');
|
||||
static final String missingExtensions = fs.path.join('test', 'data', 'vscode', 'notExtensions');
|
||||
VsCodeValidatorTestTargets._(String installDirectory, String extensionDirectory, {String edition})
|
||||
: super(VsCode.fromDirectory(installDirectory, extensionDirectory, edition: edition));
|
||||
|
||||
@@ -533,4 +532,8 @@ class VsCodeValidatorTestTargets extends VsCodeValidator {
|
||||
|
||||
static VsCodeValidatorTestTargets get installedWithoutExtension =>
|
||||
VsCodeValidatorTestTargets._(validInstall, missingExtensions);
|
||||
|
||||
static final String validInstall = fs.path.join('test', 'data', 'vscode', 'application');
|
||||
static final String validExtensions = fs.path.join('test', 'data', 'vscode', 'extensions');
|
||||
static final String missingExtensions = fs.path.join('test', 'data', 'vscode', 'notExtensions');
|
||||
}
|
||||
|
||||
@@ -251,13 +251,13 @@ class MockFile implements File {
|
||||
}
|
||||
|
||||
class MockDirectory implements Directory {
|
||||
static bool findCache = false;
|
||||
|
||||
MockDirectory(this.path);
|
||||
|
||||
@override
|
||||
final String path;
|
||||
|
||||
static bool findCache = false;
|
||||
|
||||
@override
|
||||
bool existsSync() => findCache && path.endsWith('.pub-cache');
|
||||
|
||||
|
||||
@@ -424,14 +424,14 @@ void main() {
|
||||
}
|
||||
|
||||
class MockVMService extends BasicMock implements VMService {
|
||||
Uri _httpAddress;
|
||||
HttpServer _server;
|
||||
MockVM _vm;
|
||||
|
||||
MockVMService() {
|
||||
_vm = MockVM(this);
|
||||
}
|
||||
|
||||
Uri _httpAddress;
|
||||
HttpServer _server;
|
||||
MockVM _vm;
|
||||
|
||||
@override
|
||||
Uri get httpAddress => _httpAddress;
|
||||
|
||||
@@ -468,14 +468,14 @@ class MockVMService extends BasicMock implements VMService {
|
||||
}
|
||||
|
||||
class MockVM implements VM {
|
||||
MockVM(this._service);
|
||||
|
||||
final MockVMService _service;
|
||||
final Uri _baseUri = Uri.parse('file:///tmp/devfs/test');
|
||||
bool _devFSExists = false;
|
||||
|
||||
static const int kFileSystemAlreadyExists = 1001;
|
||||
|
||||
MockVM(this._service);
|
||||
|
||||
@override
|
||||
Future<Map<String, dynamic>> createDevFS(String fsName) async {
|
||||
_service.messages.add('create $fsName');
|
||||
|
||||
@@ -39,10 +39,10 @@ void main() {
|
||||
}
|
||||
|
||||
class TestDeviceManager extends DeviceManager {
|
||||
final List<Device> allDevices;
|
||||
|
||||
TestDeviceManager(this.allDevices);
|
||||
|
||||
final List<Device> allDevices;
|
||||
|
||||
@override
|
||||
Stream<Device> getAllConnectedDevices() {
|
||||
return Stream<Device>.fromIterable(allDevices);
|
||||
@@ -50,11 +50,11 @@ class TestDeviceManager extends DeviceManager {
|
||||
}
|
||||
|
||||
class _MockDevice extends Device {
|
||||
_MockDevice(this.name, String id) : super(id);
|
||||
|
||||
@override
|
||||
final String name;
|
||||
|
||||
_MockDevice(this.name, String id) : super(id);
|
||||
|
||||
@override
|
||||
void noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
|
||||
}
|
||||
|
||||
@@ -152,10 +152,10 @@ void main() {
|
||||
}
|
||||
|
||||
class TestEmulatorManager extends EmulatorManager {
|
||||
final List<Emulator> allEmulators;
|
||||
|
||||
TestEmulatorManager(this.allEmulators);
|
||||
|
||||
final List<Emulator> allEmulators;
|
||||
|
||||
@override
|
||||
Future<List<Emulator>> getAllAvailableEmulators() {
|
||||
return Future<List<Emulator>>.value(allEmulators);
|
||||
|
||||
@@ -135,10 +135,10 @@ class MockDevice extends Mock implements Device {
|
||||
}
|
||||
|
||||
class TestHotRunnerConfig extends HotRunnerConfig {
|
||||
bool successfulSetup;
|
||||
|
||||
TestHotRunnerConfig({@required this.successfulSetup});
|
||||
|
||||
bool successfulSetup;
|
||||
|
||||
@override
|
||||
Future<bool> setupHotRestart() async {
|
||||
return successfulSetup;
|
||||
|
||||
@@ -223,9 +223,10 @@ void main() {
|
||||
}
|
||||
|
||||
class MockPortForwarder extends DevicePortForwarder {
|
||||
final int availablePort;
|
||||
MockPortForwarder([this.availablePort]);
|
||||
|
||||
final int availablePort;
|
||||
|
||||
@override
|
||||
Future<int> forward(int devicePort, {int hostPort}) async {
|
||||
hostPort ??= 0;
|
||||
|
||||
@@ -308,12 +308,12 @@ class MockStdio extends Stdio {
|
||||
}
|
||||
|
||||
class MockPollingDeviceDiscovery extends PollingDeviceDiscovery {
|
||||
MockPollingDeviceDiscovery() : super('mock');
|
||||
|
||||
final List<Device> _devices = <Device>[];
|
||||
final StreamController<Device> _onAddedController = StreamController<Device>.broadcast();
|
||||
final StreamController<Device> _onRemovedController = StreamController<Device>.broadcast();
|
||||
|
||||
MockPollingDeviceDiscovery() : super('mock');
|
||||
|
||||
@override
|
||||
Future<List<Device>> pollingGetDevices() async => _devices;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user