From 02bb8a4355060da2c285f6ffe42df1afd447ba32 Mon Sep 17 00:00:00 2001 From: Alexander Dahlberg Date: Tue, 24 Aug 2021 00:32:44 +0200 Subject: [PATCH] Fixed leak and removed no-shuffle tag in platform_channel_test.dart (#88432) Co-authored-by: Alexander Dahlberg 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. --- packages/flutter/test/services/platform_channel_test.dart | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/flutter/test/services/platform_channel_test.dart b/packages/flutter/test/services/platform_channel_test.dart index 98ec187f4f5..8994fca9aa7 100644 --- a/packages/flutter/test/services/platform_channel_test.dart +++ b/packages/flutter/test/services/platform_channel_test.dart @@ -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(['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 {