Add missing trailing commas (#28673)
* add trailing commas on list/map/parameters * add trailing commas on Invocation with nb of arg>1 * add commas for widget containing widgets * add trailing commas if instantiation contains trailing comma * revert bad change
This commit is contained in:
committed by
GitHub
parent
046f960ae2
commit
387f885481
@@ -150,7 +150,7 @@ void main() {
|
||||
'timeout': _kSerializedTestTimeout,
|
||||
'finderType': 'ByValueKey',
|
||||
'keyValueString': 'foo',
|
||||
'keyValueType': 'String'
|
||||
'keyValueType': 'String',
|
||||
});
|
||||
return makeMockResponse(<String, dynamic>{});
|
||||
});
|
||||
@@ -189,10 +189,10 @@ void main() {
|
||||
'timeout': _kSerializedTestTimeout,
|
||||
'finderType': 'ByValueKey',
|
||||
'keyValueString': '123',
|
||||
'keyValueType': 'int'
|
||||
'keyValueType': 'int',
|
||||
});
|
||||
return makeMockResponse(<String, String>{
|
||||
'text': 'hello'
|
||||
'text': 'hello',
|
||||
});
|
||||
});
|
||||
final String result = await driver.getText(find.byValueKey(123), timeout: _kTestTimeout);
|
||||
@@ -274,8 +274,8 @@ void main() {
|
||||
return <String, dynamic> {
|
||||
'traceEvents': <dynamic>[
|
||||
<String, String>{
|
||||
'name': 'test event'
|
||||
}
|
||||
'name': 'test event',
|
||||
},
|
||||
],
|
||||
};
|
||||
});
|
||||
@@ -333,8 +333,8 @@ void main() {
|
||||
return <String, dynamic> {
|
||||
'traceEvents': <dynamic>[
|
||||
<String, String>{
|
||||
'name': 'test event'
|
||||
}
|
||||
'name': 'test event',
|
||||
},
|
||||
],
|
||||
};
|
||||
});
|
||||
@@ -345,7 +345,7 @@ void main() {
|
||||
streams: const <TimelineStream>[
|
||||
TimelineStream.dart,
|
||||
TimelineStream.gc,
|
||||
TimelineStream.compiler
|
||||
TimelineStream.compiler,
|
||||
],
|
||||
retainPriorEvents: true);
|
||||
|
||||
@@ -376,7 +376,7 @@ void main() {
|
||||
test('remote error', () async {
|
||||
when(mockIsolate.invokeExtension(any, any)).thenAnswer((Invocation i) {
|
||||
return makeMockResponse(<String, dynamic>{
|
||||
'message': 'This is a failure'
|
||||
'message': 'This is a failure',
|
||||
}, isError: true);
|
||||
});
|
||||
try {
|
||||
@@ -432,7 +432,7 @@ Future<Map<String, dynamic>> makeMockResponse(
|
||||
}) {
|
||||
return Future<Map<String, dynamic>>.value(<String, dynamic>{
|
||||
'isError': isError,
|
||||
'response': response
|
||||
'response': response,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -21,15 +21,15 @@ void main() {
|
||||
}
|
||||
|
||||
Map<String, dynamic> build(int timeStamp, int duration) => <String, dynamic>{
|
||||
'name': 'Frame', 'ph': 'X', 'ts': timeStamp, 'dur': duration
|
||||
'name': 'Frame', 'ph': 'X', 'ts': timeStamp, 'dur': duration,
|
||||
};
|
||||
|
||||
Map<String, dynamic> begin(int timeStamp) => <String, dynamic>{
|
||||
'name': 'GPURasterizer::Draw', 'ph': 'B', 'ts': timeStamp
|
||||
'name': 'GPURasterizer::Draw', 'ph': 'B', 'ts': timeStamp,
|
||||
};
|
||||
|
||||
Map<String, dynamic> end(int timeStamp) => <String, dynamic>{
|
||||
'name': 'GPURasterizer::Draw', 'ph': 'E', 'ts': timeStamp
|
||||
'name': 'GPURasterizer::Draw', 'ph': 'E', 'ts': timeStamp,
|
||||
};
|
||||
|
||||
List<Map<String, dynamic>> rasterizeTimeSequenceInMillis(List<int> sequence) {
|
||||
@@ -50,7 +50,7 @@ void main() {
|
||||
build(1000, 1000),
|
||||
build(3000, 2000),
|
||||
]).countFrames(),
|
||||
2
|
||||
2,
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -59,7 +59,7 @@ void main() {
|
||||
test('throws when there is no data', () {
|
||||
expect(
|
||||
() => summarize(<Map<String, dynamic>>[]).computeAverageFrameBuildTimeMillis(),
|
||||
throwsA(predicate<ArgumentError>((ArgumentError e) => e.message == 'durations is empty!'))
|
||||
throwsA(predicate<ArgumentError>((ArgumentError e) => e.message == 'durations is empty!')),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -69,7 +69,7 @@ void main() {
|
||||
build(1000, 1000),
|
||||
build(3000, 2000),
|
||||
]).computeAverageFrameBuildTimeMillis(),
|
||||
1.5
|
||||
1.5,
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -78,7 +78,7 @@ void main() {
|
||||
test('throws when there is no data', () {
|
||||
expect(
|
||||
() => summarize(<Map<String, dynamic>>[]).computeWorstFrameBuildTimeMillis(),
|
||||
throwsA(predicate<ArgumentError>((ArgumentError e) => e.message == 'durations is empty!'))
|
||||
throwsA(predicate<ArgumentError>((ArgumentError e) => e.message == 'durations is empty!')),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -88,14 +88,14 @@ void main() {
|
||||
build(1000, 1000),
|
||||
build(3000, 2000),
|
||||
]).computeWorstFrameBuildTimeMillis(),
|
||||
2.0
|
||||
2.0,
|
||||
);
|
||||
expect(
|
||||
summarize(<Map<String, dynamic>>[
|
||||
build(3000, 2000),
|
||||
build(1000, 1000),
|
||||
]).computeWorstFrameBuildTimeMillis(),
|
||||
2.0
|
||||
2.0,
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -117,7 +117,7 @@ void main() {
|
||||
test('throws when there is no data', () {
|
||||
expect(
|
||||
() => summarize(<Map<String, dynamic>>[]).computeAverageFrameRasterizerTimeMillis(),
|
||||
throwsA(predicate<ArgumentError>((ArgumentError e) => e.message == 'durations is empty!'))
|
||||
throwsA(predicate<ArgumentError>((ArgumentError e) => e.message == 'durations is empty!')),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -127,7 +127,7 @@ void main() {
|
||||
begin(1000), end(2000),
|
||||
begin(3000), end(5000),
|
||||
]).computeAverageFrameRasterizerTimeMillis(),
|
||||
1.5
|
||||
1.5,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -137,7 +137,7 @@ void main() {
|
||||
end(1000),
|
||||
begin(2000), end(4000),
|
||||
]).computeAverageFrameRasterizerTimeMillis(),
|
||||
2.0
|
||||
2.0,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -147,7 +147,7 @@ void main() {
|
||||
begin(2000), end(4000),
|
||||
begin(5000),
|
||||
]).computeAverageFrameRasterizerTimeMillis(),
|
||||
2.0
|
||||
2.0,
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -156,7 +156,7 @@ void main() {
|
||||
test('throws when there is no data', () {
|
||||
expect(
|
||||
() => summarize(<Map<String, dynamic>>[]).computeWorstFrameRasterizerTimeMillis(),
|
||||
throwsA(predicate<ArgumentError>((ArgumentError e) => e.message == 'durations is empty!'))
|
||||
throwsA(predicate<ArgumentError>((ArgumentError e) => e.message == 'durations is empty!')),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -167,14 +167,14 @@ void main() {
|
||||
begin(1000), end(2000),
|
||||
begin(3000), end(5000),
|
||||
]).computeWorstFrameRasterizerTimeMillis(),
|
||||
2.0
|
||||
2.0,
|
||||
);
|
||||
expect(
|
||||
summarize(<Map<String, dynamic>>[
|
||||
begin(3000), end(5000),
|
||||
begin(1000), end(2000),
|
||||
]).computeWorstFrameRasterizerTimeMillis(),
|
||||
2.0
|
||||
2.0,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -184,7 +184,7 @@ void main() {
|
||||
end(1000),
|
||||
begin(2000), end(4000),
|
||||
]).computeWorstFrameRasterizerTimeMillis(),
|
||||
2.0
|
||||
2.0,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -194,7 +194,7 @@ void main() {
|
||||
begin(2000), end(4000),
|
||||
begin(5000),
|
||||
]).computeWorstFrameRasterizerTimeMillis(),
|
||||
2.0
|
||||
2.0,
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -203,7 +203,7 @@ void main() {
|
||||
test('throws when there is no data', () {
|
||||
expect(
|
||||
() => summarize(<Map<String, dynamic>>[]).computePercentileFrameRasterizerTimeMillis(90.0),
|
||||
throwsA(predicate<ArgumentError>((ArgumentError e) => e.message == 'durations is empty!'))
|
||||
throwsA(predicate<ArgumentError>((ArgumentError e) => e.message == 'durations is empty!')),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -211,20 +211,20 @@ void main() {
|
||||
const List<List<int>> sequences = <List<int>>[
|
||||
<int>[1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
|
||||
<int>[1, 2, 3, 4, 5],
|
||||
<int>[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
|
||||
<int>[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20],
|
||||
];
|
||||
|
||||
const List<int> p90s = <int>[
|
||||
9,
|
||||
5,
|
||||
18
|
||||
18,
|
||||
];
|
||||
|
||||
test('computes 90th frame rasterizer time in milliseconds', () {
|
||||
for(int i = 0; i < sequences.length; ++i) {
|
||||
expect(
|
||||
summarize(rasterizeTimeSequenceInMillis(sequences[i])).computePercentileFrameRasterizerTimeMillis(90.0),
|
||||
p90s[i]
|
||||
p90s[i],
|
||||
);
|
||||
}
|
||||
});
|
||||
@@ -236,7 +236,7 @@ void main() {
|
||||
}
|
||||
expect(
|
||||
summarize(rasterizeTimeSequenceInMillis(sequence)).computePercentileFrameRasterizerTimeMillis(99.0),
|
||||
99
|
||||
99,
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -278,7 +278,7 @@ void main() {
|
||||
'frame_count': 3,
|
||||
'frame_build_times': <int>[17000, 9000, 19000],
|
||||
'frame_rasterizer_times': <int>[18000, 10000, 20000],
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -23,11 +23,11 @@ void main() {
|
||||
'tts': 567,
|
||||
'args': <String, dynamic>{
|
||||
'arg1': true,
|
||||
}
|
||||
},
|
||||
},
|
||||
// Tests that we don't choke on missing data
|
||||
<String, dynamic>{}
|
||||
]
|
||||
<String, dynamic>{},
|
||||
],
|
||||
});
|
||||
|
||||
expect(timeline.events, hasLength(2));
|
||||
|
||||
Reference in New Issue
Block a user