Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
buenaflor committed Jun 18, 2024
1 parent 3ad6033 commit 9aaaf4d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions flutter/test/span_frame_metrics_collector_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ void main() {
expect(sut.isFrameTrackingRegistered, isFalse);
});

test('does not capture frame metrics if refresh rate is not available', () async {
test('does not capture frame metrics if refresh rate is not available',
() async {
final sut = fixture.sut;
fixture.options.tracesSampleRate = 1.0;
fixture.options.addPerformanceCollector(sut);
Expand Down Expand Up @@ -74,7 +75,8 @@ void main() {
.map((duration) => _isWithinRange(duration.inMilliseconds))));
});

test('onSpanFinished removes frames older than span start timestamp', () async {
test('onSpanFinished removes frames older than span start timestamp',
() async {
// We add 2 spans here because onSpanFinished also removes the span from the
// internal list and if that is empty then we just clear the whole tracker
// So we need multiple spans to test the removal of frames
Expand Down Expand Up @@ -157,8 +159,8 @@ void main() {

sut.frames[startTimestamp.add(Duration(milliseconds: 1))] = 500;

final frameMetrics = sut.computeFrameMetrics(
tracer, startTimestamp.add(Duration(milliseconds: 10)), displayRefreshRate);
final frameMetrics = sut.computeFrameMetrics(tracer,
startTimestamp.add(Duration(milliseconds: 10)), displayRefreshRate);

expect(frameMetrics.isEmpty, isTrue);
});
Expand Down

0 comments on commit 9aaaf4d

Please sign in to comment.