flutter/dev/benchmarks/metrics_center/test/google_benchmark_test.dart
Yuqian Li ac1ebf4889
Migrate the rest of the metrics center library (#73875)
Some notable changes are:
- Add SkiaPerfDestination
- Add LegacyFlutterDestination (for backup options during transitions).
- Add GcsLock

Related issue: https://github.com/flutter/flutter/issues/73872
2021-01-15 13:15:05 -08:00

39 lines
1.1 KiB
Dart

// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:metrics_center/src/common.dart';
import 'package:metrics_center/src/google_benchmark.dart';
import 'common.dart';
import 'utility.dart';
void main() {
test('GoogleBenchmarkParser parses example json.', () async {
final List<MetricPoint> points =
await GoogleBenchmarkParser.parse('test/example_google_benchmark.json');
expect(points.length, 6);
expectSetMatch(
points.map((MetricPoint p) => p.value),
<int>[101, 101, 4460, 4460, 6548, 6548],
);
expectSetMatch(
points.map((MetricPoint p) => p.tags[kSubResultKey]),
<String>[
'cpu_time',
'real_time',
'cpu_coefficient',
'real_coefficient',
],
);
expectSetMatch(
points.map((MetricPoint p) => p.tags[kNameKey]),
<String>[
'BM_PaintRecordInit',
'BM_ParagraphShortLayout',
'BM_ParagraphStylesBigO_BigO',
],
);
});
}