Unverified Commit 02bb8a43 authored by Alexander Dahlberg's avatar Alexander Dahlberg Committed by GitHub

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

Co-authored-by: 's avatarAlexander 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.
parent 86d7ec45
...@@ -2,12 +2,6 @@ ...@@ -2,12 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // 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/services.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
...@@ -232,6 +226,7 @@ void main() { ...@@ -232,6 +226,7 @@ void main() {
.having((PlatformException e) => e.message, 'message', equals('sayHello failed')), .having((PlatformException e) => e.message, 'message', equals('sayHello failed')),
), ),
); );
channel.setMethodCallHandler(null);
}); });
test('can handle method call with other error result', () async { test('can handle method call with other error result', () async {
...@@ -251,6 +246,7 @@ void main() { ...@@ -251,6 +246,7 @@ void main() {
.having((PlatformException e) => e.message, 'message', equals('Invalid argument(s): bad')), .having((PlatformException e) => e.message, 'message', equals('Invalid argument(s): bad')),
), ),
); );
channel.setMethodCallHandler(null);
}); });
test('can check the mock handler', () async { test('can check the mock handler', () async {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment