Fixed leak and removed no-shuffle tag in platform_channel_test.dart (#88432)

Co-authored-by: Alexander Dahlberg <alexander.dahlberg@sigma.se>

This PR fixed the problem that prevented platform_channel_test.dart being shuffled. Part of #85160.

A couple of tests sets up callbacks through setMethodCallHandler() that gets unresolved and breaks other tests.

This PR clears those callbacks by passing null to setMethodCallHandler.
This commit is contained in:
Alexander Dahlberg 2021-08-24 00:32:44 +02:00 committed by GitHub
parent 86d7ec4548
commit 02bb8a4355
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,12 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// TODO(gspencergoog): Remove this tag once this test's state leaks/test
// dependencies have been fixed.
// https://github.com/flutter/flutter/issues/85160
// Fails with "flutter test --test-randomize-ordering-seed=456"
@Tags(<String>['no-shuffle'])
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
@ -232,6 +226,7 @@ void main() {
.having((PlatformException e) => e.message, 'message', equals('sayHello failed')),
),
);
channel.setMethodCallHandler(null);
});
test('can handle method call with other error result', () async {
@ -251,6 +246,7 @@ void main() {
.having((PlatformException e) => e.message, 'message', equals('Invalid argument(s): bad')),
),
);
channel.setMethodCallHandler(null);
});
test('can check the mock handler', () async {