animated_image_test.dart 814 Bytes
Newer Older
1 2 3 4 5 6 7 8
// 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:flutter_driver/flutter_driver.dart';
import 'package:test/test.dart' hide TypeMatcher, isInstanceOf;

Future<void> main() async {
9
  const String fileName = 'animated_image';
10 11 12 13 14 15 16 17 18 19 20 21 22

  test('Animate for 250 frames', () async {
    final FlutterDriver driver = await FlutterDriver.connect();
    await driver.forceGC();


    final Timeline timeline = await driver.traceAction(() async {
      await driver.requestData('waitForAnimation');
    });
    final TimelineSummary summary = TimelineSummary.summarize(timeline);
    await summary.writeTimelineToFile(fileName, pretty: true);

    await driver.close();
23
  }, timeout: Timeout.none);
24
}