reassemble_test.dart 796 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
@TestOn('!chrome')
8 9 10
import 'dart:async';

import 'package:flutter/foundation.dart';
11
import '../flutter_test_alternative.dart';
12 13 14 15 16

class TestFoundationFlutterBinding extends BindingBase {
  bool wasLocked;

  @override
17
  Future<void> performReassemble() async {
18 19 20 21 22
    wasLocked = locked;
    return super.performReassemble();
  }
}

23
TestFoundationFlutterBinding binding = TestFoundationFlutterBinding();
24 25

void main() {
26
  binding ??= TestFoundationFlutterBinding();
27 28 29 30 31

  test('Pointer events are locked during reassemble', () async {
    await binding.reassembleApplication();
    expect(binding.wasLocked, isTrue);
  });
32
}