frame_policy_test.dart 1.08 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
Future<void> main() => driver.integrationDriver(
10
  responseDataCallback: (Map<String, dynamic>? data) async {
11
    final Map<String, dynamic> benchmarkLiveResult =
12
        data?['benchmarkLive'] as Map<String,dynamic>;
13
    final Map<String, dynamic> fullyLiveResult =
14
        data?['fullyLive'] as Map<String,dynamic>;
15 16 17

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