Fix crash in Linux platform channel example. (#155735)
When running this example it was crashing, so investigated a fixed a couple of bugs.
This commit is contained in:
15
examples/platform_channel/test/platform_channel_test.dart
Normal file
15
examples/platform_channel/test/platform_channel_test.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:platform_channel/main.dart' as platform_channel;
|
||||
|
||||
void main() {
|
||||
testWidgets('Platform channel smoke test', (WidgetTester tester) async {
|
||||
platform_channel.main(); // builds the app and schedules a frame but doesn't trigger one
|
||||
await tester.pump(); // triggers a frame
|
||||
|
||||
expect(find.textContaining('Battery level: '), findsOneWidget);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user