some formatting of map, parameters and spaces (#29760)
This commit is contained in:
committed by
GitHub
parent
ecfdd7e1ea
commit
bfa1d25bf9
@@ -113,7 +113,7 @@ Future<void> main(List<String> args) async {
|
||||
platformKernelDill: platformKernelDill,
|
||||
flutterPatchedSdk: flutterPatchedSdk,
|
||||
),
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -588,7 +588,8 @@ class AndroidSdk {
|
||||
}
|
||||
|
||||
class AndroidSdkVersion implements Comparable<AndroidSdkVersion> {
|
||||
AndroidSdkVersion._(this.sdk, {
|
||||
AndroidSdkVersion._(
|
||||
this.sdk, {
|
||||
@required this.sdkLevel,
|
||||
@required this.platformName,
|
||||
@required this.buildToolsVersion,
|
||||
|
||||
@@ -30,9 +30,13 @@ final RegExp _dotHomeStudioVersionMatcher =
|
||||
String get javaPath => androidStudio?.javaPath;
|
||||
|
||||
class AndroidStudio implements Comparable<AndroidStudio> {
|
||||
AndroidStudio(this.directory,
|
||||
{Version version, this.configured, this.studioAppName = 'AndroidStudio', this.presetPluginsPath})
|
||||
: version = version ?? Version.unknown {
|
||||
AndroidStudio(
|
||||
this.directory, {
|
||||
Version version,
|
||||
this.configured,
|
||||
this.studioAppName = 'AndroidStudio',
|
||||
this.presetPluginsPath,
|
||||
}) : version = version ?? Version.unknown {
|
||||
_init();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,9 @@ import 'globals.dart';
|
||||
|
||||
/// Information about a build to be performed or used.
|
||||
class BuildInfo {
|
||||
const BuildInfo(this.mode, this.flavor, {
|
||||
const BuildInfo(
|
||||
this.mode,
|
||||
this.flavor, {
|
||||
this.trackWidgetCreation = false,
|
||||
this.compilationTraceFilePath,
|
||||
this.createBaseline = false,
|
||||
|
||||
@@ -119,7 +119,8 @@ class BuildRunner extends CodeGenerator {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<CodegenDaemon> daemon(FlutterProject flutterProject, {
|
||||
Future<CodegenDaemon> daemon(
|
||||
FlutterProject flutterProject, {
|
||||
String mainPath,
|
||||
bool linkPlatformKernelIn = false,
|
||||
bool targetProductVm = false,
|
||||
|
||||
@@ -528,7 +528,7 @@ class AppDomain extends Domain {
|
||||
return app.stop().then<bool>(
|
||||
(void value) => true,
|
||||
onError: (dynamic error, StackTrace stack) {
|
||||
_sendAppEvent(app, 'log', <String, dynamic>{ 'log': '$error', 'error': true });
|
||||
_sendAppEvent(app, 'log', <String, dynamic>{'log': '$error', 'error': true});
|
||||
app.closeLogger();
|
||||
_apps.remove(app);
|
||||
return false;
|
||||
@@ -546,7 +546,7 @@ class AppDomain extends Domain {
|
||||
return app.detach().then<bool>(
|
||||
(void value) => true,
|
||||
onError: (dynamic error, StackTrace stack) {
|
||||
_sendAppEvent(app, 'log', <String, dynamic>{ 'log': '$error', 'error': true });
|
||||
_sendAppEvent(app, 'log', <String, dynamic>{'log': '$error', 'error': true});
|
||||
app.closeLogger();
|
||||
_apps.remove(app);
|
||||
return false;
|
||||
@@ -559,7 +559,7 @@ class AppDomain extends Domain {
|
||||
}
|
||||
|
||||
void _sendAppEvent(AppInstance app, String name, [ Map<String, dynamic> args ]) {
|
||||
final Map<String, dynamic> eventArgs = <String, dynamic> {'appId': app.id};
|
||||
final Map<String, dynamic> eventArgs = <String, dynamic>{'appId': app.id};
|
||||
if (args != null)
|
||||
eventArgs.addAll(args);
|
||||
sendEvent('app.$name', eventArgs);
|
||||
@@ -951,7 +951,7 @@ class _AppRunLogger extends Logger {
|
||||
if (parent != null) {
|
||||
parent.printTrace(message);
|
||||
} else {
|
||||
_sendLogEvent(<String, dynamic>{ 'log': message, 'trace': true });
|
||||
_sendLogEvent(<String, dynamic>{'log': message, 'trace': true});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ abstract class RunCommandBase extends FlutterCommand {
|
||||
)
|
||||
..addFlag('verbose-system-logs',
|
||||
negatable: false,
|
||||
help: 'Include verbose logging from the flutter engine.'
|
||||
help: 'Include verbose logging from the flutter engine.',
|
||||
)
|
||||
..addOption('route',
|
||||
help: 'Which route to load when running the app.',
|
||||
@@ -203,7 +203,7 @@ class RunCommand extends RunCommandBase {
|
||||
? getNameForTargetPlatform(await devices[0].targetPlatform)
|
||||
: 'multiple';
|
||||
|
||||
return <String, String>{ 'cd3': '$isEmulator', 'cd4': deviceType };
|
||||
return <String, String>{'cd3': '$isEmulator', 'cd4': deviceType};
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -909,7 +909,10 @@ class PubspecHeader extends PubspecLine {
|
||||
|
||||
/// A dependency, as represented by a line (or two) from a pubspec.yaml file.
|
||||
class PubspecDependency extends PubspecLine {
|
||||
PubspecDependency(String line, this.name, this.suffix, {
|
||||
PubspecDependency(
|
||||
String line,
|
||||
this.name,
|
||||
this.suffix, {
|
||||
@required this.isTransitive,
|
||||
DependencyKind kind,
|
||||
this.version,
|
||||
|
||||
@@ -412,7 +412,8 @@ class _RejectRequest extends _CompilationRequest {
|
||||
/// The wrapper is intended to stay resident in memory as user changes, reloads,
|
||||
/// restarts the Flutter app.
|
||||
class ResidentCompiler {
|
||||
ResidentCompiler(this._sdkRoot, {
|
||||
ResidentCompiler(
|
||||
this._sdkRoot, {
|
||||
bool trackWidgetCreation = false,
|
||||
String packagesPath,
|
||||
List<String> fileSystemRoots,
|
||||
|
||||
@@ -76,7 +76,7 @@ Future<void> pubGet({
|
||||
bool upgrade = false,
|
||||
bool offline = false,
|
||||
bool checkLastModified = true,
|
||||
bool skipPubspecYamlCheck = false
|
||||
bool skipPubspecYamlCheck = false,
|
||||
}) async {
|
||||
directory ??= fs.currentDirectory.path;
|
||||
|
||||
|
||||
@@ -241,7 +241,7 @@ class ServiceProtocolDevFSOperations implements DevFSOperations {
|
||||
try {
|
||||
return await vmService.vm.invokeRpcRaw(
|
||||
'_writeDevFSFile',
|
||||
params: <String, dynamic> {
|
||||
params: <String, dynamic>{
|
||||
'fsName': fsName,
|
||||
'uri': deviceUri.toString(),
|
||||
'fileContents': fileContents,
|
||||
@@ -337,8 +337,11 @@ class _DevFSHttpWriter {
|
||||
|
||||
// Basic statistics for DevFS update operation.
|
||||
class UpdateFSReport {
|
||||
UpdateFSReport({bool success = false,
|
||||
int invalidatedSourcesCount = 0, int syncedBytes = 0}) {
|
||||
UpdateFSReport({
|
||||
bool success = false,
|
||||
int invalidatedSourcesCount = 0,
|
||||
int syncedBytes = 0,
|
||||
}) {
|
||||
_success = success;
|
||||
_invalidatedSourcesCount = invalidatedSourcesCount;
|
||||
_syncedBytes = syncedBytes;
|
||||
|
||||
@@ -364,7 +364,8 @@ abstract class Device {
|
||||
}
|
||||
|
||||
class DebuggingOptions {
|
||||
DebuggingOptions.enabled(this.buildInfo, {
|
||||
DebuggingOptions.enabled(
|
||||
this.buildInfo, {
|
||||
this.startPaused = false,
|
||||
this.enableSoftwareRendering = false,
|
||||
this.skiaDeterministicRendering = false,
|
||||
|
||||
@@ -213,8 +213,7 @@ class FuchsiaDevice extends Device {
|
||||
_FuchsiaPortForwarder _portForwarder;
|
||||
|
||||
@override
|
||||
void clearLogs() {
|
||||
}
|
||||
void clearLogs() { }
|
||||
|
||||
@override
|
||||
bool get supportsScreenshot => false;
|
||||
@@ -306,7 +305,9 @@ class FuchsiaDevice extends Device {
|
||||
}
|
||||
|
||||
class FuchsiaIsolateDiscoveryProtocol {
|
||||
FuchsiaIsolateDiscoveryProtocol(this._device, this._isolateName, [
|
||||
FuchsiaIsolateDiscoveryProtocol(
|
||||
this._device,
|
||||
this._isolateName, [
|
||||
this._vmServiceConnector = _kDefaultFuchsiaIsolateDiscoveryConnector,
|
||||
this._pollOnce = false,
|
||||
]);
|
||||
|
||||
@@ -163,7 +163,7 @@ Future<Map<String, String>> getCodeSigningIdentityDevelopmentTeam({
|
||||
if (await opensslProcess.exitCode != 0)
|
||||
return null;
|
||||
|
||||
return <String, String> {
|
||||
return <String, String>{
|
||||
'DEVELOPMENT_TEAM': _certificateOrganizationalUnitExtractionPattern
|
||||
.firstMatch(opensslOutput)
|
||||
?.group(1),
|
||||
|
||||
@@ -389,8 +389,7 @@ class IOSDevice extends Device {
|
||||
DevicePortForwarder get portForwarder => _portForwarder ??= _IOSDevicePortForwarder(this);
|
||||
|
||||
@override
|
||||
void clearLogs() {
|
||||
}
|
||||
void clearLogs() { }
|
||||
|
||||
@override
|
||||
bool get supportsScreenshot => iMobileDevice.isInstalled;
|
||||
|
||||
@@ -625,15 +625,13 @@ Future<void> diagnoseXcodeBuildFailure(XcodeBuildResult result) async {
|
||||
}
|
||||
|
||||
class XcodeBuildResult {
|
||||
XcodeBuildResult(
|
||||
{
|
||||
@required this.success,
|
||||
this.output,
|
||||
this.stdout,
|
||||
this.stderr,
|
||||
this.xcodeBuildExecution,
|
||||
}
|
||||
);
|
||||
XcodeBuildResult({
|
||||
@required this.success,
|
||||
this.output,
|
||||
this.stdout,
|
||||
this.stderr,
|
||||
this.xcodeBuildExecution,
|
||||
});
|
||||
|
||||
final bool success;
|
||||
final String output;
|
||||
@@ -645,14 +643,12 @@ class XcodeBuildResult {
|
||||
|
||||
/// Describes an invocation of a Xcode build command.
|
||||
class XcodeBuildExecution {
|
||||
XcodeBuildExecution(
|
||||
{
|
||||
@required this.buildCommands,
|
||||
@required this.appDirectory,
|
||||
@required this.buildForPhysicalDevice,
|
||||
@required this.buildSettings,
|
||||
}
|
||||
);
|
||||
XcodeBuildExecution({
|
||||
@required this.buildCommands,
|
||||
@required this.appDirectory,
|
||||
@required this.buildForPhysicalDevice,
|
||||
@required this.buildSettings,
|
||||
});
|
||||
|
||||
/// The original list of Xcode build commands used to produce this build result.
|
||||
final List<String> buildCommands;
|
||||
|
||||
@@ -9,7 +9,7 @@ import '../base/file_system.dart';
|
||||
import '../globals.dart';
|
||||
import '../ios/plist_utils.dart' as plist;
|
||||
|
||||
/// Tests whether a [FileSystemEntity] is an macOS bundle directory
|
||||
/// Tests whether a [FileSystemEntity] is an macOS bundle directory
|
||||
bool _isBundleDirectory(FileSystemEntity entity) =>
|
||||
entity is Directory && entity.path.endsWith('.app');
|
||||
|
||||
|
||||
@@ -28,7 +28,8 @@ import 'run_hot.dart';
|
||||
import 'vmservice.dart';
|
||||
|
||||
class FlutterDevice {
|
||||
FlutterDevice(this.device, {
|
||||
FlutterDevice(
|
||||
this.device, {
|
||||
@required this.trackWidgetCreation,
|
||||
this.dillOutputPath,
|
||||
this.fileSystemRoots,
|
||||
@@ -48,7 +49,8 @@ class FlutterDevice {
|
||||
);
|
||||
|
||||
/// Create a [FlutterDevice] with optional code generation enabled.
|
||||
static Future<FlutterDevice> create(Device device, {
|
||||
static Future<FlutterDevice> create(
|
||||
Device device, {
|
||||
@required bool trackWidgetCreation,
|
||||
String dillOutputPath,
|
||||
List<String> fileSystemRoots,
|
||||
@@ -482,7 +484,8 @@ class FlutterDevice {
|
||||
|
||||
// Shared code between different resident application runners.
|
||||
abstract class ResidentRunner {
|
||||
ResidentRunner(this.flutterDevices, {
|
||||
ResidentRunner(
|
||||
this.flutterDevices, {
|
||||
this.target,
|
||||
this.debuggingOptions,
|
||||
this.usesTerminalUI = true,
|
||||
|
||||
@@ -93,8 +93,11 @@ class HotRunner extends ResidentRunner {
|
||||
benchmarkData[name].add(value);
|
||||
}
|
||||
|
||||
Future<void> _reloadSourcesService(String isolateId,
|
||||
{ bool force = false, bool pause = false }) async {
|
||||
Future<void> _reloadSourcesService(
|
||||
String isolateId, {
|
||||
bool force = false,
|
||||
bool pause = false,
|
||||
}) async {
|
||||
// TODO(cbernaschina): check that isolateId is the id of the UI isolate.
|
||||
final OperationResult result = await restart(pauseAfterRestart: pause);
|
||||
if (!result.isOk) {
|
||||
@@ -589,7 +592,7 @@ class HotRunner extends ResidentRunner {
|
||||
}
|
||||
}
|
||||
|
||||
Future<OperationResult> _reloadSources({ bool pause = false, String reason, void Function(String message) onSlow, }) async {
|
||||
Future<OperationResult> _reloadSources({ bool pause = false, String reason, void Function(String message) onSlow }) async {
|
||||
final Map<String, String> analyticsParameters = <String, String>{};
|
||||
if (reason != null) {
|
||||
analyticsParameters[kEventReloadReasonParameterName] = reason;
|
||||
|
||||
@@ -424,8 +424,10 @@ abstract class ServiceObject {
|
||||
/// Factory constructor given a [ServiceObjectOwner] and a service map,
|
||||
/// upgrade the map into a proper [ServiceObject]. This function always
|
||||
/// returns a new instance and does not interact with caches.
|
||||
factory ServiceObject._fromMap(ServiceObjectOwner owner,
|
||||
Map<String, dynamic> map) {
|
||||
factory ServiceObject._fromMap(
|
||||
ServiceObjectOwner owner,
|
||||
Map<String, dynamic> map,
|
||||
) {
|
||||
if (map == null)
|
||||
return null;
|
||||
|
||||
@@ -873,7 +875,7 @@ class VM extends ServiceObjectOwner {
|
||||
|
||||
/// Create a new development file system on the device.
|
||||
Future<Map<String, dynamic>> createDevFS(String fsName) {
|
||||
return invokeRpcRaw('_createDevFS', params: <String, dynamic> {'fsName': fsName});
|
||||
return invokeRpcRaw('_createDevFS', params: <String, dynamic>{'fsName': fsName});
|
||||
}
|
||||
|
||||
/// List the development file system son the device.
|
||||
@@ -928,7 +930,7 @@ class VM extends ServiceObjectOwner {
|
||||
Uri assetsDirectory,
|
||||
) {
|
||||
return invokeRpc<ServiceMap>('_flutter.runInView',
|
||||
params: <String, dynamic> {
|
||||
params: <String, dynamic>{
|
||||
'viewId': viewId,
|
||||
'mainScript': main.toString(),
|
||||
'packagesFile': packages.toString(),
|
||||
|
||||
@@ -57,8 +57,11 @@ class VsCode {
|
||||
}
|
||||
}
|
||||
|
||||
factory VsCode.fromDirectory(String installPath, String extensionDirectory,
|
||||
{ String edition }) {
|
||||
factory VsCode.fromDirectory(
|
||||
String installPath,
|
||||
String extensionDirectory, {
|
||||
String edition,
|
||||
}) {
|
||||
final String packageJsonPath =
|
||||
fs.path.join(installPath, 'resources', 'app', 'package.json');
|
||||
final String versionString = _getVersionFromPackageJson(packageJsonPath);
|
||||
|
||||
@@ -35,7 +35,7 @@ void main() {
|
||||
artifacts.getArtifactPath(Artifact.flutterTester),
|
||||
fs.path.join(tempDir.path, 'bin', 'cache', 'artifacts', 'engine', 'linux-x64', 'flutter_tester'),
|
||||
);
|
||||
}, overrides: <Type, Generator> {
|
||||
}, overrides: <Type, Generator>{
|
||||
Cache: () => Cache(rootOverride: tempDir),
|
||||
Platform: () => FakePlatform(operatingSystem: 'linux'),
|
||||
});
|
||||
@@ -53,7 +53,7 @@ void main() {
|
||||
artifacts.getEngineType(TargetPlatform.darwin_x64),
|
||||
'darwin-x64',
|
||||
);
|
||||
}, overrides: <Type, Generator> {
|
||||
}, overrides: <Type, Generator>{
|
||||
Cache: () => Cache(rootOverride: tempDir),
|
||||
Platform: () => FakePlatform(operatingSystem: 'linux'),
|
||||
});
|
||||
@@ -89,7 +89,7 @@ void main() {
|
||||
artifacts.getArtifactPath(Artifact.engineDartSdkPath),
|
||||
fs.path.join(tempDir.path, 'out', 'host_debug_unopt', 'dart-sdk'),
|
||||
);
|
||||
}, overrides: <Type, Generator> {
|
||||
}, overrides: <Type, Generator>{
|
||||
Platform: () => FakePlatform(operatingSystem: 'linux'),
|
||||
});
|
||||
|
||||
@@ -106,7 +106,7 @@ void main() {
|
||||
artifacts.getEngineType(TargetPlatform.darwin_x64),
|
||||
'android_debug_unopt',
|
||||
);
|
||||
}, overrides: <Type, Generator> {
|
||||
}, overrides: <Type, Generator>{
|
||||
Platform: () => FakePlatform(operatingSystem: 'linux'),
|
||||
});
|
||||
});
|
||||
|
||||
@@ -36,7 +36,7 @@ void main() {
|
||||
r'\[ (?: {0,2}\+[0-9]{1,3} ms| )\] Oooh, I do I do I do\n$'));
|
||||
expect(mockLogger.traceText, '');
|
||||
expect(mockLogger.errorText, matches( r'^\[ (?: {0,2}\+[0-9]{1,3} ms| )\] Helpless!\n$'));
|
||||
}, overrides: <Type, Generator> {
|
||||
}, overrides: <Type, Generator>{
|
||||
OutputPreferences: () => OutputPreferences(showColor: false),
|
||||
Platform: _kNoAnsiPlatform,
|
||||
});
|
||||
@@ -57,7 +57,7 @@ void main() {
|
||||
expect(
|
||||
mockLogger.errorText,
|
||||
matches('^$red' r'\[ (?: {0,2}\+[0-9]{1,3} ms| )\] ' '${bold}Helpless!$resetBold$resetColor' r'\n$'));
|
||||
}, overrides: <Type, Generator> {
|
||||
}, overrides: <Type, Generator>{
|
||||
OutputPreferences: () => OutputPreferences(showColor: true),
|
||||
Platform: () => FakePlatform()..stdoutSupportsAnsi = true,
|
||||
});
|
||||
|
||||
@@ -32,7 +32,7 @@ void main() {
|
||||
// rwxr--r--
|
||||
expect(mode.substring(0, 3), endsWith('x'));
|
||||
}
|
||||
}, overrides: <Type, Generator> {
|
||||
}, overrides: <Type, Generator>{
|
||||
OperatingSystemUtils: () => OperatingSystemUtils(),
|
||||
});
|
||||
});
|
||||
|
||||
@@ -44,7 +44,7 @@ void main() {
|
||||
equals('${AnsiTerminal.colorCode(color)}output${AnsiTerminal.resetColor}'),
|
||||
);
|
||||
}
|
||||
}, overrides: <Type, Generator> {
|
||||
}, overrides: <Type, Generator>{
|
||||
OutputPreferences: () => OutputPreferences(showColor: true),
|
||||
Platform: () => FakePlatform()..stdoutSupportsAnsi = true,
|
||||
});
|
||||
@@ -54,7 +54,7 @@ void main() {
|
||||
terminal.bolden('output'),
|
||||
equals('${AnsiTerminal.bold}output${AnsiTerminal.resetBold}'),
|
||||
);
|
||||
}, overrides: <Type, Generator> {
|
||||
}, overrides: <Type, Generator>{
|
||||
OutputPreferences: () => OutputPreferences(showColor: true),
|
||||
Platform: () => FakePlatform()..stdoutSupportsAnsi = true,
|
||||
});
|
||||
@@ -68,7 +68,7 @@ void main() {
|
||||
terminal.color('non-bold ${terminal.bolden('output')} also non-bold', TerminalColor.blue),
|
||||
equals('${AnsiTerminal.blue}non-bold ${AnsiTerminal.bold}output${AnsiTerminal.resetBold} also non-bold${AnsiTerminal.resetColor}'),
|
||||
);
|
||||
}, overrides: <Type, Generator> {
|
||||
}, overrides: <Type, Generator>{
|
||||
OutputPreferences: () => OutputPreferences(showColor: true),
|
||||
Platform: () => FakePlatform()..stdoutSupportsAnsi = true,
|
||||
});
|
||||
@@ -82,7 +82,7 @@ void main() {
|
||||
terminal.bolden('non-color ${terminal.color('output', TerminalColor.blue)} also non-color'),
|
||||
equals('${AnsiTerminal.bold}non-color ${AnsiTerminal.blue}output${AnsiTerminal.resetColor} also non-color${AnsiTerminal.resetBold}'),
|
||||
);
|
||||
}, overrides: <Type, Generator> {
|
||||
}, overrides: <Type, Generator>{
|
||||
OutputPreferences: () => OutputPreferences(showColor: true),
|
||||
Platform: () => FakePlatform()..stdoutSupportsAnsi = true,
|
||||
});
|
||||
@@ -96,7 +96,7 @@ void main() {
|
||||
terminal.color('magenta ${terminal.color('output', TerminalColor.blue)} also magenta', TerminalColor.magenta),
|
||||
equals('${AnsiTerminal.magenta}magenta ${AnsiTerminal.blue}output${AnsiTerminal.resetColor}${AnsiTerminal.magenta} also magenta${AnsiTerminal.resetColor}'),
|
||||
);
|
||||
}, overrides: <Type, Generator> {
|
||||
}, overrides: <Type, Generator>{
|
||||
OutputPreferences: () => OutputPreferences(showColor: true),
|
||||
Platform: () => FakePlatform()..stdoutSupportsAnsi = true,
|
||||
});
|
||||
@@ -110,7 +110,7 @@ void main() {
|
||||
terminal.bolden('bold ${terminal.bolden('output')} still bold'),
|
||||
equals('${AnsiTerminal.bold}bold output still bold${AnsiTerminal.resetBold}'),
|
||||
);
|
||||
}, overrides: <Type, Generator> {
|
||||
}, overrides: <Type, Generator>{
|
||||
OutputPreferences: () => OutputPreferences(showColor: true),
|
||||
Platform: () => FakePlatform()..stdoutSupportsAnsi = true,
|
||||
});
|
||||
|
||||
@@ -9,12 +9,10 @@ import 'src/common.dart';
|
||||
import 'src/context.dart';
|
||||
|
||||
void main() {
|
||||
setUpAll(() {
|
||||
});
|
||||
setUpAll(() { });
|
||||
|
||||
group('Validate build number', () {
|
||||
setUp(() async {
|
||||
});
|
||||
setUp(() async { });
|
||||
|
||||
testUsingContext('CFBundleVersion for iOS', () async {
|
||||
String buildName = validatedBuildNumberForPlatform(TargetPlatform.ios, 'xyz');
|
||||
@@ -34,8 +32,7 @@ void main() {
|
||||
});
|
||||
|
||||
group('Validate build name', () {
|
||||
setUp(() async {
|
||||
});
|
||||
setUp(() async { });
|
||||
|
||||
testUsingContext('CFBundleShortVersionString for iOS', () async {
|
||||
String buildName = validatedBuildNameForPlatform(TargetPlatform.ios, 'xyz');
|
||||
|
||||
@@ -24,7 +24,7 @@ import '../src/context.dart';
|
||||
const String frameworkRevision = '12345678';
|
||||
const String frameworkChannel = 'omega';
|
||||
final Generator _kNoColorTerminalPlatform = () => FakePlatform.fromPlatform(const LocalPlatform())..stdoutSupportsAnsi = false;
|
||||
final Map<Type, Generator> noColorTerminalOverride = <Type, Generator> {
|
||||
final Map<Type, Generator> noColorTerminalOverride = <Type, Generator>{
|
||||
Platform: _kNoColorTerminalPlatform,
|
||||
};
|
||||
const String samplesIndexJson = '''[
|
||||
@@ -900,7 +900,7 @@ void main() {
|
||||
final List<String> args = <String>[
|
||||
'create',
|
||||
'--list-samples',
|
||||
outputFile
|
||||
outputFile,
|
||||
];
|
||||
|
||||
await runner.run(args);
|
||||
@@ -918,7 +918,7 @@ void main() {
|
||||
final List<String> args = <String>[
|
||||
'create',
|
||||
'--list-samples',
|
||||
outputFile
|
||||
outputFile,
|
||||
];
|
||||
|
||||
await expectLater(runner.run(args), throwsToolExit(exitCode: 2, message: 'Failed to write samples'));
|
||||
|
||||
@@ -123,7 +123,7 @@ void main() {
|
||||
notifyingLogger: notifyingLogger,
|
||||
);
|
||||
|
||||
commands.add(<String, dynamic>{ 'id': 0, 'method': 'app.restart' });
|
||||
commands.add(<String, dynamic>{'id': 0, 'method': 'app.restart'});
|
||||
final Map<String, dynamic> response = await responses.stream.firstWhere(_notEvent);
|
||||
expect(response['id'], 0);
|
||||
expect(response['error'], contains('appId is required'));
|
||||
@@ -147,7 +147,7 @@ void main() {
|
||||
commands.add(<String, dynamic>{
|
||||
'id': 0,
|
||||
'method': 'app.callServiceExtension',
|
||||
'params': <String, String> {
|
||||
'params': <String, String>{
|
||||
'methodName': 'ext.flutter.debugPaint',
|
||||
},
|
||||
});
|
||||
@@ -171,7 +171,7 @@ void main() {
|
||||
notifyingLogger: notifyingLogger,
|
||||
);
|
||||
|
||||
commands.add(<String, dynamic>{ 'id': 0, 'method': 'app.stop' });
|
||||
commands.add(<String, dynamic>{'id': 0, 'method': 'app.stop'});
|
||||
final Map<String, dynamic> response = await responses.stream.firstWhere(_notEvent);
|
||||
expect(response['id'], 0);
|
||||
expect(response['error'], contains('appId is required'));
|
||||
@@ -258,7 +258,7 @@ void main() {
|
||||
notifyingLogger: notifyingLogger,
|
||||
);
|
||||
|
||||
commands.add(<String, dynamic>{ 'id': 0, 'method': 'emulator.launch' });
|
||||
commands.add(<String, dynamic>{'id': 0, 'method': 'emulator.launch'});
|
||||
final Map<String, dynamic> response = await responses.stream.firstWhere(_notEvent);
|
||||
expect(response['id'], 0);
|
||||
expect(response['error'], contains('emulatorId is required'));
|
||||
|
||||
@@ -108,12 +108,14 @@ class MockProcessManager extends Mock implements ProcessManager {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Process> start(List<dynamic> command,
|
||||
{String workingDirectory,
|
||||
Map<String, String> environment,
|
||||
bool includeParentEnvironment = true,
|
||||
bool runInShell = false,
|
||||
ProcessStartMode mode = ProcessStartMode.normal}) {
|
||||
Future<Process> start(
|
||||
List<dynamic> command, {
|
||||
String workingDirectory,
|
||||
Map<String, String> environment,
|
||||
bool includeParentEnvironment = true,
|
||||
bool runInShell = false,
|
||||
ProcessStartMode mode = ProcessStartMode.normal,
|
||||
}) {
|
||||
final Completer<Process> completer = Completer<Process>();
|
||||
completer.complete(MockProcess());
|
||||
return completer.future;
|
||||
|
||||
@@ -532,9 +532,12 @@ Future<void> _recompile(
|
||||
mockFrontendServerStdIn._stdInWrites.clear();
|
||||
}
|
||||
|
||||
Future<void> _accept(StreamController<List<int>> streamController,
|
||||
ResidentCompiler generator, MockStdIn mockFrontendServerStdIn,
|
||||
String expected) async {
|
||||
Future<void> _accept(
|
||||
StreamController<List<int>> streamController,
|
||||
ResidentCompiler generator,
|
||||
MockStdIn mockFrontendServerStdIn,
|
||||
String expected,
|
||||
) async {
|
||||
// Put content into the output stream after generator.recompile gets
|
||||
// going few lines below, resets completer.
|
||||
generator.accept();
|
||||
@@ -544,9 +547,13 @@ Future<void> _accept(StreamController<List<int>> streamController,
|
||||
mockFrontendServerStdIn._stdInWrites.clear();
|
||||
}
|
||||
|
||||
Future<void> _reject(StreamController<List<int>> streamController,
|
||||
ResidentCompiler generator, MockStdIn mockFrontendServerStdIn,
|
||||
String mockCompilerOutput, String expected) async {
|
||||
Future<void> _reject(
|
||||
StreamController<List<int>> streamController,
|
||||
ResidentCompiler generator,
|
||||
MockStdIn mockFrontendServerStdIn,
|
||||
String mockCompilerOutput,
|
||||
String expected,
|
||||
) async {
|
||||
// Put content into the output stream after generator.recompile gets
|
||||
// going few lines below, resets completer.
|
||||
scheduleMicrotask(() {
|
||||
|
||||
@@ -151,7 +151,7 @@ void main() {
|
||||
'version': 'test-version',
|
||||
},
|
||||
));
|
||||
}, overrides: <Type, Generator> {
|
||||
}, overrides: <Type, Generator>{
|
||||
Platform: () => FakePlatform(
|
||||
operatingSystem: 'linux',
|
||||
environment: <String, String>{
|
||||
|
||||
@@ -237,7 +237,7 @@ void main() {
|
||||
];
|
||||
await HotRunner(devices).cleanupAfterSignal();
|
||||
expect(shutdownTestingConfig.shutdownHookCalled, true);
|
||||
}, overrides: <Type, Generator> {
|
||||
}, overrides: <Type, Generator>{
|
||||
Artifacts: () => mockArtifacts,
|
||||
HotRunnerConfig: () => shutdownTestingConfig,
|
||||
});
|
||||
@@ -252,7 +252,7 @@ void main() {
|
||||
];
|
||||
await HotRunner(devices).preStop();
|
||||
expect(shutdownTestingConfig.shutdownHookCalled, true);
|
||||
}, overrides: <Type, Generator> {
|
||||
}, overrides: <Type, Generator>{
|
||||
Artifacts: () => mockArtifacts,
|
||||
HotRunnerConfig: () => shutdownTestingConfig,
|
||||
});
|
||||
|
||||
@@ -146,7 +146,7 @@ void main() {
|
||||
expect(testLogger.statusText, contains('iPhone Developer: Profile 1 (1111AAAA11)'));
|
||||
expect(testLogger.errorText, isEmpty);
|
||||
verify(mockStdIn.write('This is a mock certificate'));
|
||||
expect(signingConfigs, <String, String> {'DEVELOPMENT_TEAM': '3333CCCC33'});
|
||||
expect(signingConfigs, <String, String>{'DEVELOPMENT_TEAM': '3333CCCC33'});
|
||||
},
|
||||
overrides: <Type, Generator>{
|
||||
ProcessManager: () => mockProcessManager,
|
||||
@@ -217,7 +217,7 @@ void main() {
|
||||
);
|
||||
expect(testLogger.errorText, isEmpty);
|
||||
verify(mockOpenSslStdIn.write('This is a mock certificate'));
|
||||
expect(signingConfigs, <String, String> {'DEVELOPMENT_TEAM': '4444DDDD44'});
|
||||
expect(signingConfigs, <String, String>{'DEVELOPMENT_TEAM': '4444DDDD44'});
|
||||
|
||||
verify(config.setValue('ios-signing-cert', 'iPhone Developer: Profile 3 (3333CCCC33)'));
|
||||
},
|
||||
@@ -288,7 +288,7 @@ void main() {
|
||||
);
|
||||
expect(testLogger.errorText, isEmpty);
|
||||
verify(mockOpenSslStdIn.write('This is a mock certificate'));
|
||||
expect(signingConfigs, <String, String> {'DEVELOPMENT_TEAM': '5555EEEE55'});
|
||||
expect(signingConfigs, <String, String>{'DEVELOPMENT_TEAM': '5555EEEE55'});
|
||||
},
|
||||
overrides: <Type, Generator>{
|
||||
ProcessManager: () => mockProcessManager,
|
||||
@@ -360,7 +360,7 @@ void main() {
|
||||
);
|
||||
expect(testLogger.errorText, isEmpty);
|
||||
verify(mockOpenSslStdIn.write('This is a mock certificate'));
|
||||
expect(signingConfigs, <String, String> {'DEVELOPMENT_TEAM': '4444DDDD44'});
|
||||
expect(signingConfigs, <String, String>{'DEVELOPMENT_TEAM': '4444DDDD44'});
|
||||
},
|
||||
overrides: <Type, Generator>{
|
||||
ProcessManager: () => mockProcessManager,
|
||||
@@ -432,7 +432,7 @@ void main() {
|
||||
testLogger.statusText,
|
||||
contains('Certificate choice "iPhone Developer: Profile 3 (3333CCCC33)"'),
|
||||
);
|
||||
expect(signingConfigs, <String, String> {'DEVELOPMENT_TEAM': '4444DDDD44'});
|
||||
expect(signingConfigs, <String, String>{'DEVELOPMENT_TEAM': '4444DDDD44'});
|
||||
verify(config.setValue('ios-signing-cert', 'iPhone Developer: Profile 3 (3333CCCC33)'));
|
||||
},
|
||||
overrides: <Type, Generator>{
|
||||
|
||||
@@ -403,11 +403,12 @@ void main() {
|
||||
expect(GitTagVersion.parse('v1.2.3-4-gx$hash').frameworkVersionFor(hash), '0.0.0-unknown');
|
||||
expect(testLogger.statusText, '');
|
||||
expect(testLogger.errorText, '');
|
||||
expect(testLogger.traceText,
|
||||
expect(
|
||||
testLogger.traceText,
|
||||
'Could not interpret results of "git describe": x1.2.3-4-gabcdef\n'
|
||||
'Could not interpret results of "git describe": v1.0.0-unknown-0-gabcdef\n'
|
||||
'Could not interpret results of "git describe": beta-1-gabcdef\n'
|
||||
'Could not interpret results of "git describe": v1.2.3-4-gxabcdef\n'
|
||||
'Could not interpret results of "git describe": v1.2.3-4-gxabcdef\n',
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ Future<void> main() async {
|
||||
} else if (words.first == 'start') {
|
||||
_send(<String, dynamic>{
|
||||
'method': 'app.start',
|
||||
'params': <String, dynamic> {
|
||||
'params': <String, dynamic>{
|
||||
'deviceId': words[1],
|
||||
'projectDirectory': words[2],
|
||||
'launchMode': words[3],
|
||||
@@ -50,7 +50,7 @@ Future<void> main() async {
|
||||
if (words.length > 1) {
|
||||
_send(<String, dynamic>{
|
||||
'method': 'app.stop',
|
||||
'params': <String, dynamic> {'appId': words[1]},
|
||||
'params': <String, dynamic>{'appId': words[1]},
|
||||
});
|
||||
} else {
|
||||
_send(<String, dynamic>{'method': 'app.stop'});
|
||||
@@ -59,7 +59,7 @@ Future<void> main() async {
|
||||
if (words.length > 1) {
|
||||
_send(<String, dynamic>{
|
||||
'method': 'app.restart',
|
||||
'params': <String, dynamic> {'appId': words[1]},
|
||||
'params': <String, dynamic>{'appId': words[1]},
|
||||
});
|
||||
} else {
|
||||
_send(<String, dynamic>{'method': 'app.restart'});
|
||||
|
||||
Reference in New Issue
Block a user