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

import 'package:flutter/foundation.dart';
9
import '../flutter_test_alternative.dart';
10 11 12 13 14

class TestFoundationFlutterBinding extends BindingBase {
  bool wasLocked;

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

21
TestFoundationFlutterBinding binding = TestFoundationFlutterBinding();
22 23

void main() {
24
  binding ??= TestFoundationFlutterBinding();
25 26 27 28 29

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