Commit aba60954 authored by Yegor's avatar Yegor Committed by GitHub

make zero-device test hermetic (#9891)

parent 21712a49
......@@ -2,10 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:convert';
import 'dart:io';
import 'package:flutter_tools/src/android/android_sdk.dart';
import 'package:flutter_tools/src/cache.dart';
import 'package:flutter_tools/src/commands/devices.dart';
import 'package:flutter_tools/src/device.dart';
import 'package:mockito/mockito.dart';
import 'package:process/process.dart';
import 'package:test/test.dart';
import 'src/common.dart';
......@@ -29,6 +34,22 @@ void main() {
}, overrides: <Type, Generator>{
AndroidSdk: () => null,
DeviceManager: () => new DeviceManager(),
ProcessManager: () => new MockProcessManager(),
});
});
}
class MockProcessManager extends Mock implements ProcessManager {
@override
ProcessResult runSync(
List<dynamic> command, {
String workingDirectory,
Map<String, String> environment,
bool includeParentEnvironment: true,
bool runInShell: false,
Encoding stdoutEncoding: SYSTEM_ENCODING,
Encoding stderrEncoding: SYSTEM_ENCODING,
}) {
return new ProcessResult(0, 0, '', '');
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment