Revert "Revert "Roll engine to fed2ea458ed49088d33eddabc546ba56d600c717 (includes dart roll) again (#19277)" (#19295)" (#19322)

This reverts commit cc122f1672.
This commit is contained in:
Alexander Aprelev
2018-07-12 14:59:22 -07:00
committed by GitHub
parent e22f99743b
commit 7ebf2728dc
41 changed files with 153 additions and 140 deletions

View File

@@ -101,7 +101,7 @@ class BuildAotCommand extends BuildSubCommand {
// Build AOT snapshot.
if (platform == TargetPlatform.ios) {
// Determine which iOS architectures to build for.
final Iterable<IOSArch> buildArchs = argResults['ios-arch'].map(getIOSArchForName);
final Iterable<IOSArch> buildArchs = argResults['ios-arch'].map<IOSArch>(getIOSArchForName);
final Map<IOSArch, String> iosBuilds = <IOSArch, String>{};
for (IOSArch arch in buildArchs)
iosBuilds[arch] = fs.path.join(outputPath, getNameForIOSArch(arch));

View File

@@ -102,7 +102,7 @@ class FlutterManifest {
/// Properties defining how to expose this Flutter project as a module
/// for integration into an unspecified host app.
Map<String, dynamic> get moduleDescriptor {
YamlMap get moduleDescriptor {
return _flutterDescriptor.containsKey('module')
? _flutterDescriptor['module'] ?? const <String, dynamic>{}
: null;

View File

@@ -93,7 +93,8 @@ Future<Null> downloadStartupTrace(VMService observatory) async {
);
int extractInstantEventTimestamp(String eventName) {
final List<Map<String, dynamic>> events = timeline['traceEvents'];
final List<Map<String, dynamic>> events =
new List<Map<String, dynamic>>.from(timeline['traceEvents']);
final Map<String, dynamic> event = events.firstWhere(
(Map<String, dynamic> event) => event['name'] == eventName, orElse: () => null
);

View File

@@ -161,8 +161,10 @@ class VMService {
if (expression is! String || expression.isEmpty)
throw new rpc.RpcException.invalidParams(
'Invalid \'expression\': $expression');
final List<String> definitions = params['definitions'].asList;
final List<String> typeDefinitions = params['typeDefinitions'].asList;
final List<String> definitions =
new List<String>.from(params['definitions'].asList);
final List<String> typeDefinitions =
new List<String>.from(params['typeDefinitions'].asList);
final String libraryUri = params['libraryUri'].asString;
final String klass = params['klass'].exists ? params['klass'].asString : null;
final bool isStatic = params['isStatic'].asBoolOr(false);
@@ -350,6 +352,7 @@ class VMService {
// If the VM doesn't yet have a view, wait for one to show up.
printTrace('Waiting for Flutter view');
await new Future<Null>.delayed(new Duration(seconds: attemptSeconds));
await getVM();
await vm.refreshViews();
}
}

View File

@@ -5,18 +5,18 @@ author: Flutter Authors <flutter-dev@googlegroups.com>
dependencies:
# To update these, use "flutter update-packages --force-upgrade".
analyzer: 0.31.2-alpha.2
analyzer: 0.32.3
archive: 2.0.0
args: 1.4.3
cli_util: 0.1.3
coverage: 0.11.0
coverage: 0.12.1
crypto: 2.0.5
file: 5.0.1
http: 0.11.3+16
intl: 0.15.6
json_rpc_2: 2.0.8
json_schema: 1.0.9
linter: 0.1.53
linter: 0.1.56
meta: 1.1.5
mustache: 1.0.1
package_config: 1.0.3
@@ -42,14 +42,14 @@ dependencies:
charcode: 1.1.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
convert: 2.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
csslib: 0.14.4 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
front_end: 0.1.0-alpha.12 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
front_end: 0.1.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
glob: 1.1.6 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
html: 0.13.3+1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
http_multi_server: 2.0.5 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
http_parser: 3.1.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
io: 0.3.2+1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
js: 0.6.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
kernel: 0.3.0-alpha.12 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
kernel: 0.3.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
logging: 0.11.3+1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
matcher: 0.12.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
mime: 0.9.6+1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
@@ -82,4 +82,4 @@ dartdoc:
# Exclude this package from the hosted API docs.
nodoc: true
# PUBSPEC CHECKSUM: fdfe
# PUBSPEC CHECKSUM: 7504

View File

@@ -39,7 +39,7 @@ void main() {
when(device.portForwarder).thenReturn(portForwarder);
when(portForwarder.forward(devicePort, hostPort: anyNamed('hostPort'))).thenAnswer((_) async => hostPort);
when(portForwarder.forwardedPorts).thenReturn(<ForwardedPort>[new ForwardedPort(hostPort, devicePort)]);
when(portForwarder.unforward).thenReturn((ForwardedPort _) async => null);
when(portForwarder.unforward(any)).thenAnswer((_) async => null);
testDeviceManager.addDevice(device);
final AttachCommand command = new AttachCommand();
@@ -60,7 +60,7 @@ void main() {
when(device.portForwarder).thenReturn(portForwarder);
when(portForwarder.forward(devicePort)).thenAnswer((_) async => hostPort);
when(portForwarder.forwardedPorts).thenReturn(<ForwardedPort>[new ForwardedPort(hostPort, devicePort)]);
when(portForwarder.unforward).thenReturn((ForwardedPort _) async => null);
when(portForwarder.unforward(any)).thenAnswer((_) async => null);
testDeviceManager.addDevice(device);
final AttachCommand command = new AttachCommand();

View File

@@ -113,7 +113,8 @@ void testUsingContext(String description, dynamic testMethod(), {
},
);
});
}, timeout: timeout, testOn: testOn, skip: skip);
}, timeout: timeout != null ? timeout : const Timeout(const Duration(seconds: 60)),
testOn: testOn, skip: skip);
}
void _printBufferedErrors(AppContext testContext) {

View File

@@ -31,32 +31,6 @@ void main() {
setUp(() {
mockProcessManager = new MockProcessManager();
mockCache = new MockCache();
when(mockProcessManager.runSync(
<String>['git', 'rev-parse', '--abbrev-ref', '--symbolic', '@{u}'],
workingDirectory: anyNamed('workingDirectory'),
environment: anyNamed('environment'),
)).thenReturn(new ProcessResult(101, 0, 'master', ''));
when(mockProcessManager.runSync(
<String>['git', 'rev-parse', '--abbrev-ref', 'HEAD'],
workingDirectory: anyNamed('workingDirectory'),
environment: anyNamed('environment'),
)).thenReturn(new ProcessResult(102, 0, 'branch', ''));
when(mockProcessManager.runSync(
<String>['git', 'log', '-n', '1', '--pretty=format:%H'],
workingDirectory: anyNamed('workingDirectory'),
environment: anyNamed('environment'),
)).thenReturn(new ProcessResult(103, 0, '1234abcd', ''));
when(mockProcessManager.runSync(
<String>['git', 'log', '-n', '1', '--pretty=format:%ar'],
workingDirectory: anyNamed('workingDirectory'),
environment: anyNamed('environment'),
)).thenReturn(new ProcessResult(104, 0, '1 second ago', ''));
when(mockProcessManager.runSync(
<String>['git', 'describe', '--match', 'v*.*.*', '--first-parent', '--long', '--tags'],
workingDirectory: anyNamed('workingDirectory'),
environment: anyNamed('environment'),
)).thenReturn(new ProcessResult(105, 0, 'v0.1.2-3-1234abcd', ''));
});
group('$FlutterVersion', () {
@@ -83,8 +57,6 @@ void main() {
});
testUsingContext('prints nothing when Flutter installation looks out-of-date by is actually up-to-date', () async {
final FlutterVersion version = FlutterVersion.instance;
fakeData(
mockProcessManager,
mockCache,
@@ -97,6 +69,7 @@ void main() {
expectSetStamp: true,
expectServerPing: true,
);
final FlutterVersion version = FlutterVersion.instance;
await version.checkFlutterVersionFreshness();
_expectVersionMessage('');
@@ -107,8 +80,6 @@ void main() {
});
testUsingContext('does not ping server when version stamp is up-to-date', () async {
final FlutterVersion version = FlutterVersion.instance;
fakeData(
mockProcessManager,
mockCache,
@@ -120,6 +91,7 @@ void main() {
expectSetStamp: true,
);
final FlutterVersion version = FlutterVersion.instance;
await version.checkFlutterVersionFreshness();
_expectVersionMessage(FlutterVersion.newVersionAvailableMessage());
}, overrides: <Type, Generator>{
@@ -129,8 +101,6 @@ void main() {
});
testUsingContext('does not print warning if printed recently', () async {
final FlutterVersion version = FlutterVersion.instance;
fakeData(
mockProcessManager,
mockCache,
@@ -142,6 +112,7 @@ void main() {
expectSetStamp: true,
);
final FlutterVersion version = FlutterVersion.instance;
await version.checkFlutterVersionFreshness();
_expectVersionMessage(FlutterVersion.newVersionAvailableMessage());
expect((await VersionCheckStamp.load()).lastTimeWarningWasPrinted, _testClock.now());
@@ -155,8 +126,6 @@ void main() {
});
testUsingContext('pings server when version stamp is missing then does not', () async {
final FlutterVersion version = FlutterVersion.instance;
fakeData(
mockProcessManager,
mockCache,
@@ -165,6 +134,7 @@ void main() {
expectSetStamp: true,
expectServerPing: true,
);
final FlutterVersion version = FlutterVersion.instance;
await version.checkFlutterVersionFreshness();
_expectVersionMessage(FlutterVersion.newVersionAvailableMessage());
@@ -185,8 +155,6 @@ void main() {
});
testUsingContext('pings server when version stamp is out-of-date', () async {
final FlutterVersion version = FlutterVersion.instance;
fakeData(
mockProcessManager,
mockCache,
@@ -199,6 +167,7 @@ void main() {
expectSetStamp: true,
expectServerPing: true,
);
final FlutterVersion version = FlutterVersion.instance;
await version.checkFlutterVersionFreshness();
_expectVersionMessage(FlutterVersion.newVersionAvailableMessage());
@@ -209,8 +178,6 @@ void main() {
});
testUsingContext('does not print warning when unable to connect to server if not out of date', () async {
final FlutterVersion version = FlutterVersion.instance;
fakeData(
mockProcessManager,
mockCache,
@@ -219,6 +186,7 @@ void main() {
expectServerPing: true,
expectSetStamp: true,
);
final FlutterVersion version = FlutterVersion.instance;
await version.checkFlutterVersionFreshness();
_expectVersionMessage('');
@@ -229,8 +197,6 @@ void main() {
});
testUsingContext('prints warning when unable to connect to server if really out of date', () async {
final FlutterVersion version = FlutterVersion.instance;
fakeData(
mockProcessManager,
mockCache,
@@ -239,6 +205,7 @@ void main() {
expectServerPing: true,
expectSetStamp: true
);
final FlutterVersion version = FlutterVersion.instance;
await version.checkFlutterVersionFreshness();
_expectVersionMessage(FlutterVersion.versionOutOfDateMessage(_testClock.now().difference(_outOfDateVersion)));
@@ -249,13 +216,23 @@ void main() {
});
testUsingContext('versions comparison', () async {
fakeData(
mockProcessManager,
mockCache,
localCommitDate: _outOfDateVersion,
errorOnFetch: true,
expectServerPing: true,
expectSetStamp: true
);
final FlutterVersion version = FlutterVersion.instance;
when(mockProcessManager.runSync(
<String>['git', 'merge-base', '--is-ancestor', 'abcdef', '123456'],
workingDirectory: anyNamed('workingDirectory'),
)).thenReturn(new ProcessResult(1, 0, '', ''));
expect(
FlutterVersion.instance.checkRevisionAncestry(
version.checkRevisionAncestry(
tentativeDescendantRevision: '123456',
tentativeAncestorRevision: 'abcdef',
),
@@ -456,6 +433,32 @@ void fakeData(
when(pm.run(any, workingDirectory: anyNamed('workingDirectory'))).thenAnswer((Invocation invocation) async {
return syncAnswer(invocation);
});
when(pm.runSync(
<String>['git', 'rev-parse', '--abbrev-ref', '--symbolic', '@{u}'],
workingDirectory: anyNamed('workingDirectory'),
environment: anyNamed('environment'),
)).thenReturn(new ProcessResult(101, 0, 'master', ''));
when(pm.runSync(
<String>['git', 'rev-parse', '--abbrev-ref', 'HEAD'],
workingDirectory: anyNamed('workingDirectory'),
environment: anyNamed('environment'),
)).thenReturn(new ProcessResult(102, 0, 'branch', ''));
when(pm.runSync(
<String>['git', 'log', '-n', '1', '--pretty=format:%H'],
workingDirectory: anyNamed('workingDirectory'),
environment: anyNamed('environment'),
)).thenReturn(new ProcessResult(103, 0, '1234abcd', ''));
when(pm.runSync(
<String>['git', 'log', '-n', '1', '--pretty=format:%ar'],
workingDirectory: anyNamed('workingDirectory'),
environment: anyNamed('environment'),
)).thenReturn(new ProcessResult(104, 0, '1 second ago', ''));
when(pm.runSync(
<String>['git', 'describe', '--match', 'v*.*.*', '--first-parent', '--long', '--tags'],
workingDirectory: anyNamed('workingDirectory'),
environment: anyNamed('environment'),
)).thenReturn(new ProcessResult(105, 0, 'v0.1.2-3-1234abcd', ''));
}
class MockProcessManager extends Mock implements ProcessManager {}