debug_test.dart 929 Bytes
Newer Older
Ian Hickson's avatar
Ian Hickson committed
1
// Copyright 2014 The Flutter Authors. All rights reserved.
2 3 4
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5 6
// @dart = 2.8

7
import 'package:flutter/scheduler.dart';
8
import 'package:flutter_test/flutter_test.dart';
9 10 11 12 13

void main() {
  test('debugAssertAllSchedulerVarsUnset control test', () {
    expect(() {
      debugAssertAllSchedulerVarsUnset('Example test');
14
    }, isNot(throwsFlutterError));
15 16 17 18 19

    debugPrintBeginFrameBanner = true;

    expect(() {
      debugAssertAllSchedulerVarsUnset('Example test');
20
    }, throwsFlutterError);
21 22 23 24 25 26

    debugPrintBeginFrameBanner = false;
    debugPrintEndFrameBanner = true;

    expect(() {
      debugAssertAllSchedulerVarsUnset('Example test');
27
    }, throwsFlutterError);
28 29 30 31 32

    debugPrintEndFrameBanner = false;

    expect(() {
      debugAssertAllSchedulerVarsUnset('Example test');
33
    }, isNot(throwsFlutterError));
34 35
  });
}