Unverified Commit 2089eacc authored by Nate Bosch's avatar Nate Bosch Committed by GitHub

Switch imports from test_api to focused libaries (#125854)

Move imports of API available in `hooks.dart` or `scaffolding.dart` to use those more narrow libraries.

Move imports of APIs from `package:matcher` to import directly. The next major version of `test_api` will remove the exports of `matcher` APIs.
parent f309eadf
...@@ -9,8 +9,7 @@ import 'dart:io'; ...@@ -9,8 +9,7 @@ import 'dart:io';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:path/path.dart' as path; import 'package:path/path.dart' as path;
// ignore: deprecated_member_use import 'package:test_api/scaffolding.dart' as test_package;
import 'package:test_api/test_api.dart' as test_package;
import 'binding.dart'; import 'binding.dart';
......
...@@ -13,9 +13,9 @@ import 'package:flutter/rendering.dart'; ...@@ -13,9 +13,9 @@ import 'package:flutter/rendering.dart';
import 'package:flutter/scheduler.dart'; import 'package:flutter/scheduler.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:matcher/expect.dart' show fail;
import 'package:stack_trace/stack_trace.dart' as stack_trace; import 'package:stack_trace/stack_trace.dart' as stack_trace;
import 'package:test_api/expect.dart' show fail; import 'package:test_api/scaffolding.dart' as test_package show Timeout;
import 'package:test_api/test_api.dart' as test_package show Timeout; // ignore: deprecated_member_use
import 'package:vector_math/vector_math_64.dart'; import 'package:vector_math/vector_math_64.dart';
import '_binding_io.dart' if (dart.library.html) '_binding_web.dart' as binding; import '_binding_io.dart' if (dart.library.html) '_binding_web.dart' as binding;
......
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
import 'dart:typed_data'; import 'dart:typed_data';
import 'package:matcher/expect.dart' show Description;
import 'package:matcher/src/expect/async_matcher.dart'; // ignore: implementation_imports import 'package:matcher/src/expect/async_matcher.dart'; // ignore: implementation_imports
// ignore: deprecated_member_use import 'package:test_api/hooks.dart' show TestFailure;
import 'package:test_api/test_api.dart' show Description, TestFailure;
import 'goldens.dart'; import 'goldens.dart';
......
...@@ -6,7 +6,6 @@ import 'dart:typed_data'; ...@@ -6,7 +6,6 @@ import 'dart:typed_data';
import 'dart:ui'; import 'dart:ui';
import 'package:path/path.dart' as path; import 'package:path/path.dart' as path;
import 'package:test_api/test_api.dart'; // ignore: deprecated_member_use
import '_goldens_io.dart' if (dart.library.html) '_goldens_web.dart' as goldens; import '_goldens_io.dart' if (dart.library.html) '_goldens_web.dart' as goldens;
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
import 'dart:async'; import 'dart:async';
import 'package:meta/meta.dart'; import 'package:meta/meta.dart';
import 'package:test_api/scaffolding.dart' show Timeout;
import 'package:test_api/src/backend/declarer.dart'; // ignore: implementation_imports import 'package:test_api/src/backend/declarer.dart'; // ignore: implementation_imports
import 'package:test_api/src/backend/group.dart'; // ignore: implementation_imports import 'package:test_api/src/backend/group.dart'; // ignore: implementation_imports
import 'package:test_api/src/backend/group_entry.dart'; // ignore: implementation_imports import 'package:test_api/src/backend/group_entry.dart'; // ignore: implementation_imports
...@@ -16,8 +17,6 @@ import 'package:test_api/src/backend/state.dart'; // ignore: implementation_impo ...@@ -16,8 +17,6 @@ import 'package:test_api/src/backend/state.dart'; // ignore: implementation_impo
import 'package:test_api/src/backend/suite.dart'; // ignore: implementation_imports import 'package:test_api/src/backend/suite.dart'; // ignore: implementation_imports
import 'package:test_api/src/backend/suite_platform.dart'; // ignore: implementation_imports import 'package:test_api/src/backend/suite_platform.dart'; // ignore: implementation_imports
import 'package:test_api/src/backend/test.dart'; // ignore: implementation_imports import 'package:test_api/src/backend/test.dart'; // ignore: implementation_imports
// ignore: deprecated_member_use
import 'package:test_api/test_api.dart';
// ignore: deprecated_member_use // ignore: deprecated_member_use
export 'package:test_api/fake.dart' show Fake; export 'package:test_api/fake.dart' show Fake;
......
...@@ -4,9 +4,7 @@ ...@@ -4,9 +4,7 @@
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:stack_trace/stack_trace.dart' as stack_trace; import 'package:stack_trace/stack_trace.dart' as stack_trace;
import 'package:test_api/scaffolding.dart' as test_package;
// ignore: deprecated_member_use
import 'package:test_api/test_api.dart' as test_package;
/// Signature for the [reportTestException] callback. /// Signature for the [reportTestException] callback.
typedef TestExceptionReporter = void Function(FlutterErrorDetails details, String testDescription); typedef TestExceptionReporter = void Function(FlutterErrorDetails details, String testDescription);
......
...@@ -11,10 +11,7 @@ import 'package:flutter/scheduler.dart'; ...@@ -11,10 +11,7 @@ import 'package:flutter/scheduler.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:matcher/expect.dart' as matcher_expect; import 'package:matcher/expect.dart' as matcher_expect;
import 'package:meta/meta.dart'; import 'package:meta/meta.dart';
import 'package:test_api/scaffolding.dart' as test_package;
// The test_api package is not for general use... it's literally for our use.
// ignore: deprecated_member_use
import 'package:test_api/test_api.dart' as test_package;
import 'all_elements.dart'; import 'all_elements.dart';
import 'binding.dart'; import 'binding.dart';
...@@ -686,7 +683,7 @@ class WidgetTester extends WidgetController implements HitTestDispatcher, Ticker ...@@ -686,7 +683,7 @@ class WidgetTester extends WidgetController implements HitTestDispatcher, Ticker
final WidgetsBinding binding = this.binding; final WidgetsBinding binding = this.binding;
if (binding is LiveTestWidgetsFlutterBinding && if (binding is LiveTestWidgetsFlutterBinding &&
binding.framePolicy == LiveTestWidgetsFlutterBindingFramePolicy.benchmark) { binding.framePolicy == LiveTestWidgetsFlutterBindingFramePolicy.benchmark) {
test_package.fail( matcher_expect.fail(
'When using LiveTestWidgetsFlutterBindingFramePolicy.benchmark, ' 'When using LiveTestWidgetsFlutterBindingFramePolicy.benchmark, '
'hasScheduledFrame is never set to true. This means that pumpAndSettle() ' 'hasScheduledFrame is never set to true. This means that pumpAndSettle() '
'cannot be used, because it has no way to know if the application has ' 'cannot be used, because it has no way to know if the application has '
......
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