Replace path_provider_linux widget tests with simple unit tests (#3812)
diff --git a/packages/path_provider/path_provider_linux/example/test/widget_test.dart b/packages/path_provider/path_provider_linux/example/test/widget_test.dart
deleted file mode 100644
index 59f839d..0000000
--- a/packages/path_provider/path_provider_linux/example/test/widget_test.dart
+++ /dev/null
@@ -1,97 +0,0 @@
-// Copyright 2013 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.
-
-// This is a basic Flutter widget test.
-//
-// To perform an interaction with a widget in your test, use the WidgetTester
-// utility that Flutter provides. For example, you can send tap and scroll
-// gestures. You can also use WidgetTester to find child widgets in the widget
-// tree, read text, and verify that the values of widget properties are correct.
-
-import 'package:flutter/material.dart';
-import 'package:flutter_test/flutter_test.dart';
-
-import 'package:pathproviderexample/main.dart';
-
-void main() {
- group('Test linux path provider example', () {
- setUpAll(() async {
- WidgetsFlutterBinding.ensureInitialized();
- });
-
- testWidgets('Finds tmp directory', (WidgetTester tester) async {
- // Build our app and trigger a frame.
- await tester.runAsync(() async {
- await tester.pumpWidget(MyApp());
- await Future<void>.delayed(const Duration(milliseconds: 20));
- await tester.pump();
-
- // Verify that temporary directory is retrieved.
- expect(
- find.byWidgetPredicate(
- (Widget widget) =>
- widget is Text &&
- widget.data!.startsWith('Temp Directory: /tmp'),
- ),
- findsOneWidget,
- );
- });
- });
- testWidgets('Finds documents directory', (WidgetTester tester) async {
- // Build our app and trigger a frame.
- await tester.runAsync(() async {
- await tester.pumpWidget(MyApp());
- await Future<void>.delayed(const Duration(milliseconds: 20));
- await tester.pump();
-
- // Verify that documents directory is retrieved.
- expect(
- find.byWidgetPredicate(
- (Widget widget) =>
- widget is Text &&
- widget.data!.startsWith('Documents Directory: /'),
- ),
- findsOneWidget,
- );
- });
- });
- testWidgets('Finds downloads directory', (WidgetTester tester) async {
- // Build our app and trigger a frame.
- await tester.runAsync(() async {
- await tester.pumpWidget(MyApp());
- await Future<void>.delayed(const Duration(milliseconds: 20));
- await tester.pump();
-
- // Verify that downloads directory is retrieved.
- expect(
- find.byWidgetPredicate(
- (Widget widget) =>
- widget is Text &&
- widget.data!.startsWith('Downloads Directory: /'),
- ),
- findsOneWidget,
- );
- });
- });
- testWidgets('Finds application support directory',
- (WidgetTester tester) async {
- // Build our app and trigger a frame.
- await tester.runAsync(() async {
- await tester.pumpWidget(MyApp());
- await Future<void>.delayed(const Duration(milliseconds: 20));
- await tester.pump();
-
- // Verify that Application Support Directory is retrieved.
- expect(
- find.byWidgetPredicate(
- (Widget widget) =>
- widget is Text &&
- widget.data!.startsWith('Application Support Directory: /'),
- ),
- findsOneWidget,
- );
- });
- });
- });
-}
diff --git a/packages/path_provider/path_provider_linux/test/path_provider_linux_test.dart b/packages/path_provider/path_provider_linux/test/path_provider_linux_test.dart
index 9ab75ff..3384a3d 100644
--- a/packages/path_provider/path_provider_linux/test/path_provider_linux_test.dart
+++ b/packages/path_provider/path_provider_linux/test/path_provider_linux_test.dart
@@ -17,4 +17,19 @@
final PathProviderPlatform plugin = PathProviderPlatform.instance;
expect(await plugin.getTemporaryPath(), '/tmp');
});
+
+ test('getApplicationSupportPath', () async {
+ final PathProviderPlatform plugin = PathProviderPlatform.instance;
+ expect(await plugin.getApplicationSupportPath(), startsWith('/'));
+ });
+
+ test('getApplicationDocumentsPath', () async {
+ final PathProviderPlatform plugin = PathProviderPlatform.instance;
+ expect(await plugin.getApplicationDocumentsPath(), startsWith('/'));
+ });
+
+ test('getDownloadsPath', () async {
+ final PathProviderPlatform plugin = PathProviderPlatform.instance;
+ expect(await plugin.getDownloadsPath(), startsWith('/'));
+ });
}