frame_policy_test.dart 1.12 KB
Newer Older
1 2 3 4 5 6
// 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 'dart:io';

7
import 'package:integration_test/integration_test_driver.dart' as driver;
8

9 10 11 12 13 14 15
Future<void> main() => driver.integrationDriver(
  timeout: const Duration(minutes: 1),
  responseDataCallback: (Map<String, dynamic> data) async {
    final Map<String, dynamic> benchmarkLiveResult =
        data['benchmarkLive'] as Map<String,dynamic>;
    final Map<String, dynamic> fullyLiveResult =
        data['fullyLive'] as Map<String,dynamic>;
16 17 18 19 20 21 22 23

    if(benchmarkLiveResult['frame_count'] as int < 10
       || fullyLiveResult['frame_count'] as int < 10) {
      print('Failure Details:\nNot Enough frames collected:'
            'benchmarkLive ${benchmarkLiveResult['frameCount']},'
            '${fullyLiveResult['frameCount']}.');
      exit(1);
    }
24
    await driver.writeResponseData(
25 26 27 28
      <String, dynamic>{
        'benchmarkLive': benchmarkLiveResult,
        'fullyLive': fullyLiveResult,
      },
29 30
      testOutputFilename: 'frame_policy_event_delay',
    );
31
  }
32
);