Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
0cbe5975
Unverified
Commit
0cbe5975
authored
Mar 15, 2021
by
Ian Hickson
Committed by
GitHub
Mar 15, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Align more closely with package:test (#77118)
parent
5039594f
Changes
102
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
102 changed files
with
163 additions
and
311 deletions
+163
-311
analyze.dart
dev/bots/analyze.dart
+0
-76
common.dart
dev/bots/test/common.dart
+3
-7
common.dart
dev/devicelab/test/common.dart
+3
-7
common.dart
...ation_tests/android_semantics_testing/lib/src/common.dart
+1
-0
flutter_test_alternative.dart
...d_semantics_testing/lib/src/flutter_test_alternative.dart
+0
-14
matcher.dart
...tion_tests/android_semantics_testing/lib/src/matcher.dart
+2
-1
common.dart
dev/tools/test/common.dart
+5
-11
flutter_test_alternative.dart
packages/flutter/test/flutter_test_alternative.dart
+0
-19
assertions_test.dart
packages/flutter/test/foundation/assertions_test.dart
+1
-1
bit_field_test.dart
packages/flutter/test/foundation/bit_field_test.dart
+1
-1
caching_iterable_test.dart
packages/flutter/test/foundation/caching_iterable_test.dart
+1
-2
consolidate_response_test.dart
...es/flutter/test/foundation/consolidate_response_test.dart
+3
-2
constants_test.dart
packages/flutter/test/foundation/constants_test.dart
+1
-1
double_precision_test.dart
packages/flutter/test/foundation/double_precision_test.dart
+1
-1
error_reporting_test.dart
packages/flutter/test/foundation/error_reporting_test.dart
+2
-1
isolates_test.dart
packages/flutter/test/foundation/isolates_test.dart
+1
-2
licenses_test.dart
packages/flutter/test/foundation/licenses_test.dart
+1
-1
print_test.dart
packages/flutter/test/foundation/print_test.dart
+1
-1
reassemble_test.dart
packages/flutter/test/foundation/reassemble_test.dart
+1
-1
serialization_test.dart
packages/flutter/test/foundation/serialization_test.dart
+1
-1
service_extensions_test.dart
...ages/flutter/test/foundation/service_extensions_test.dart
+1
-1
stack_frame_test.dart
packages/flutter/test/foundation/stack_frame_test.dart
+1
-1
stack_trace_test.dart
packages/flutter/test/foundation/stack_trace_test.dart
+2
-1
synchronous_future_test.dart
...ages/flutter/test/foundation/synchronous_future_test.dart
+1
-1
arena_test.dart
packages/flutter/test/gestures/arena_test.dart
+1
-2
double_tap_test.dart
packages/flutter/test/gestures/double_tap_test.dart
+2
-2
gesture_binding_resample_event_test.dart
...er/test/gestures/gesture_binding_resample_event_test.dart
+1
-2
gesture_binding_test.dart
packages/flutter/test/gestures/gesture_binding_test.dart
+1
-2
gesture_tester.dart
packages/flutter/test/gestures/gesture_tester.dart
+2
-3
hit_test_test.dart
packages/flutter/test/gestures/hit_test_test.dart
+1
-2
locking_test.dart
packages/flutter/test/gestures/locking_test.dart
+1
-2
long_press_test.dart
packages/flutter/test/gestures/long_press_test.dart
+1
-1
lsq_solver_test.dart
packages/flutter/test/gestures/lsq_solver_test.dart
+1
-2
pointer_signal_resolver_test.dart
...s/flutter/test/gestures/pointer_signal_resolver_test.dart
+1
-2
resampler_test.dart
packages/flutter/test/gestures/resampler_test.dart
+1
-2
trivial_test.dart
packages/flutter/test/harness/trivial_test.dart
+1
-1
colors_test.dart
packages/flutter/test/material/colors_test.dart
+1
-2
box_fit_test.dart
packages/flutter/test/painting/box_fit_test.dart
+1
-2
decoration_test.dart
packages/flutter/test/painting/decoration_test.dart
+1
-1
geometry_test.dart
packages/flutter/test/painting/geometry_test.dart
+1
-1
image_cache_resize_test.dart
packages/flutter/test/painting/image_cache_resize_test.dart
+1
-1
image_cache_test.dart
packages/flutter/test/painting/image_cache_test.dart
+1
-1
image_decoder_test.dart
packages/flutter/test/painting/image_decoder_test.dart
+1
-1
strut_style_test.dart
packages/flutter/test/painting/strut_style_test.dart
+1
-1
text_style_test.dart
packages/flutter/test/painting/text_style_test.dart
+2
-2
near_equal_test.dart
packages/flutter/test/physics/near_equal_test.dart
+1
-2
annotated_region_test.dart
packages/flutter/test/rendering/annotated_region_test.dart
+1
-1
baseline_test.dart
packages/flutter/test/rendering/baseline_test.dart
+1
-1
cached_intrinsics_test.dart
packages/flutter/test/rendering/cached_intrinsics_test.dart
+1
-1
constraints_test.dart
packages/flutter/test/rendering/constraints_test.dart
+1
-1
debug_test.dart
packages/flutter/test/rendering/debug_test.dart
+1
-1
dynamic_intrinsics_test.dart
packages/flutter/test/rendering/dynamic_intrinsics_test.dart
+1
-1
first_frame_test.dart
packages/flutter/test/rendering/first_frame_test.dart
+1
-2
independent_layout_test.dart
packages/flutter/test/rendering/independent_layout_test.dart
+1
-1
intrinsic_width_test.dart
packages/flutter/test/rendering/intrinsic_width_test.dart
+1
-1
mouse_tracker_cursor_test.dart
...ges/flutter/test/rendering/mouse_tracker_cursor_test.dart
+1
-1
mouse_tracker_test.dart
packages/flutter/test/rendering/mouse_tracker_test.dart
+1
-1
mutations_test.dart
packages/flutter/test/rendering/mutations_test.dart
+1
-1
non_render_object_root_test.dart
...s/flutter/test/rendering/non_render_object_root_test.dart
+1
-1
offstage_test.dart
packages/flutter/test/rendering/offstage_test.dart
+1
-1
overflow_test.dart
packages/flutter/test/rendering/overflow_test.dart
+1
-1
paragraph_intrinsics_test.dart
...ges/flutter/test/rendering/paragraph_intrinsics_test.dart
+1
-1
positioned_box_test.dart
packages/flutter/test/rendering/positioned_box_test.dart
+1
-1
proxy_box_test.dart
packages/flutter/test/rendering/proxy_box_test.dart
+1
-1
proxy_getters_and_setters_test.dart
...lutter/test/rendering/proxy_getters_and_setters_test.dart
+1
-1
proxy_sliver_test.dart
packages/flutter/test/rendering/proxy_sliver_test.dart
+1
-1
reattach_test.dart
packages/flutter/test/rendering/reattach_test.dart
+1
-1
relative_rect_test.dart
packages/flutter/test/rendering/relative_rect_test.dart
+1
-1
repaint_boundary_test.dart
packages/flutter/test/rendering/repaint_boundary_test.dart
+1
-1
semantics_and_children_test.dart
...s/flutter/test/rendering/semantics_and_children_test.dart
+1
-2
simple_semantics_test.dart
packages/flutter/test/rendering/simple_semantics_test.dart
+1
-1
size_test.dart
packages/flutter/test/rendering/size_test.dart
+1
-1
sliver_cache_test.dart
packages/flutter/test/rendering/sliver_cache_test.dart
+1
-1
sliver_fixed_extent_layout_test.dart
...utter/test/rendering/sliver_fixed_extent_layout_test.dart
+1
-1
sliver_persistent_header_test.dart
...flutter/test/rendering/sliver_persistent_header_test.dart
+1
-1
slivers_block_test.dart
packages/flutter/test/rendering/slivers_block_test.dart
+1
-2
slivers_layout_test.dart
packages/flutter/test/rendering/slivers_layout_test.dart
+1
-1
stack_test.dart
packages/flutter/test/rendering/stack_test.dart
+1
-1
transform_test.dart
packages/flutter/test/rendering/transform_test.dart
+1
-1
animation_test.dart
packages/flutter/test/scheduler/animation_test.dart
+1
-2
priority_test.dart
packages/flutter/test/scheduler/priority_test.dart
+1
-2
scheduler_test.dart
packages/flutter/test/scheduler/scheduler_test.dart
+1
-1
custom_semantics_action_test.dart
.../flutter/test/semantics/custom_semantics_action_test.dart
+1
-2
semantics_service_test.dart
packages/flutter/test/semantics/semantics_service_test.dart
+1
-3
message_codecs_test.dart
packages/flutter/test/services/message_codecs_test.dart
+2
-1
message_codecs_testing.dart
packages/flutter/test/services/message_codecs_testing.dart
+1
-1
message_codecs_vm_test.dart
packages/flutter/test/services/message_codecs_vm_test.dart
+2
-1
platform_channel_test.dart
packages/flutter/test/services/platform_channel_test.dart
+1
-3
platform_views_test.dart
packages/flutter/test/services/platform_views_test.dart
+1
-2
text_input_test.dart
packages/flutter/test/services/text_input_test.dart
+1
-2
README.md
packages/flutter/test_private/README.md
+0
-1
animated_icons_private_test.dart.tmpl
...r/test_private/test/animated_icons_private_test.dart.tmpl
+1
-2
animated_icons_private_test.json
...lutter/test_private/test/animated_icons_private_test.json
+2
-4
common.dart
packages/flutter_driver/test/common.dart
+3
-7
_matchers_io.dart
packages/flutter_test/lib/src/_matchers_io.dart
+1
-2
_matchers_web.dart
packages/flutter_test/lib/src/_matchers_web.dart
+1
-2
matchers.dart
packages/flutter_test/lib/src/matchers.dart
+7
-7
widget_tester.dart
packages/flutter_test/lib/src/widget_tester.dart
+20
-7
generate_localizations_test.dart
...tools/test/general.shard/generate_localizations_test.dart
+1
-4
common.dart
packages/flutter_tools/test/src/common.dart
+18
-20
common.dart
packages/fuchsia_remote_debug_protocol/test/common.dart
+3
-7
failure_test.dart
...es/integration_test/example/test_driver/failure_test.dart
+1
-1
No files found.
dev/bots/analyze.dart
View file @
0cbe5975
...
...
@@ -61,9 +61,6 @@ Future<void> run(List<String> arguments) async {
print
(
'
$clock
Test imports...'
);
await
verifyNoTestImports
(
flutterRoot
);
print
(
'
$clock
Test package imports...'
);
await
verifyNoTestPackageImports
(
flutterRoot
);
print
(
'
$clock
Bad imports (framework)...'
);
await
verifyNoBadImportsInFlutter
(
flutterRoot
);
...
...
@@ -299,79 +296,6 @@ Future<void> verifyNoTestImports(String workingDirectory) async {
}
}
Future<void> verifyNoTestPackageImports(String workingDirectory) async {
// TODO(ianh): Remove this whole test once https://github.com/dart-lang/matcher/issues/98 is fixed.
final List<String> shims = <String>[];
final List<String> errors = (await _allFiles(workingDirectory, 'dart', minimumMatches: 2000).toList())
.map<String>((File file) {
final String name = Uri.file(path.relative(file.path,
from: workingDirectory)).toFilePath(windows: false);
if (name.startsWith('bin/cache') ||
name == 'dev/bots/test.dart' ||
name.startsWith('.pub-cache'))
return null;
final String data = file.readAsStringSync();
if (data.contains("
import
'package:test/test.dart'")) {
if (data.contains("
// Defines a 'package:test' shim.")) {
shims
.
add
(
'
$name
'
);
if
(!
data
.
contains
(
'https://github.com/dart-lang/matcher/issues/98'
))
return
'
$name
: Shims must link to the isInstanceOf issue.'
;
if
(
data
.
contains
(
"import 'package:test/test.dart' hide TypeMatcher, isInstanceOf;"
)
&&
data
.
contains
(
"export 'package:test/test.dart' hide TypeMatcher, isInstanceOf;"
))
return
null
;
return
'
$name
: Shim seems to be missing the expected import/export lines.'
;
}
final
int
count
=
'package:test'
.
allMatches
(
data
).
length
;
if
(
path
.
split
(
file
.
path
).
contains
(
'test_driver'
)
||
name
.
startsWith
(
'dev/missing_dependency_tests/'
)
||
name
.
startsWith
(
'dev/automated_tests/'
)
||
name
.
startsWith
(
'dev/snippets/'
)
||
name
.
startsWith
(
'packages/flutter/test/engine/'
)
||
name
.
startsWith
(
'examples/layers/test/smoketests/raw/'
)
||
name
.
startsWith
(
'examples/layers/test/smoketests/rendering/'
)
||
name
.
startsWith
(
'dev/integration_tests/flutter_gallery/test/calculator'
))
{
// We only exempt driver tests, some of our special trivial tests.
// Driver tests aren't typically expected to use TypeMatcher and company.
// The trivial tests don't typically do anything at all and it would be
// a pain to have to give them a shim.
if
(!
data
.
contains
(
"import 'package:test/test.dart' hide TypeMatcher, isInstanceOf;"
))
return
'
$name
: test does not hide TypeMatcher and isInstanceOf from package:test; consider using a shim instead.'
;
assert
(
count
>
0
);
if
(
count
==
1
)
return
null
;
return
"
$name
: uses 'package:test'
$count
times."
;
}
if
(
name
.
startsWith
(
'packages/flutter_test/'
))
{
// flutter_test has deep ties to package:test
return
null
;
}
if
(
data
.
contains
(
"import 'package:test/test.dart' as test_package;"
)
||
data
.
contains
(
"import 'package:test/test.dart' as test_package show "
))
{
if
(
count
==
1
)
return
null
;
}
return
"
$name
: uses 'package:test' directly"
;
}
return
null
;
})
.
where
((
String
line
)
=>
line
!=
null
)
.
toList
()
..
sort
();
// Fail if any errors
if
(
errors
.
isNotEmpty
)
{
final
String
s1
=
errors
.
length
==
1
?
's'
:
''
;
final
String
s2
=
errors
.
length
==
1
?
''
:
's'
;
exitWithError
(<
String
>[
"
${bold}
The following file
$s2
use
$s1
'package:test' incorrectly:
$reset
"
,
...
errors
,
"Rather than depending on 'package:test' directly, use one of the shims:"
,
...
shims
,
"This insulates us from breaking changes in 'package:test'."
]);
}
}
Future<void> verifyNoBadImportsInFlutter(String workingDirectory) async {
final List<String> errors = <String>[];
final String libPath = path.join(workingDirectory, 'packages', 'flutter', 'lib');
...
...
dev/bots/test/common.dart
View file @
0cbe5975
...
...
@@ -4,16 +4,12 @@
import
'dart:io'
;
import
'package:test/test.dart'
hide
TypeMatcher
,
isInstanceOf
;
import
'package:test/test.dart'
as
test_package
show
TypeMatcher
;
import
'package:test/test.dart'
;
export
'package:test/test.dart'
hide
TypeMatcher
,
isInstanceOf
;
// Defines a 'package:test' shim.
// TODO(ianh): Remove this file once https://github.com/dart-lang/matcher/issues/98 is fixed
export
'package:test/test.dart'
hide
isInstanceOf
;
/// A matcher that compares the type of the actual value to the type argument T.
test_package
.
TypeMatcher
<
T
>
isInstanceOf
<
T
>()
=>
isA
<
T
>();
TypeMatcher
<
T
>
isInstanceOf
<
T
>()
=>
isA
<
T
>();
void
tryToDelete
(
Directory
directory
)
{
// This should not be necessary, but it turns out that
...
...
dev/devicelab/test/common.dart
View file @
0cbe5975
...
...
@@ -2,13 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:test/test.dart'
hide
TypeMatcher
,
isInstanceOf
;
import
'package:test/test.dart'
as
test_package
show
TypeMatcher
;
import
'package:test/test.dart'
;
export
'package:test/test.dart'
hide
TypeMatcher
,
isInstanceOf
;
// Defines a 'package:test' shim.
// TODO(ianh): Remove this file once https://github.com/dart-lang/matcher/issues/98 is fixed
export
'package:test/test.dart'
hide
isInstanceOf
;
/// A matcher that compares the type of the actual value to the type argument T.
test_package
.
TypeMatcher
<
T
>
isInstanceOf
<
T
>()
=>
isA
<
T
>();
TypeMatcher
<
T
>
isInstanceOf
<
T
>()
=>
isA
<
T
>();
dev/integration_tests/android_semantics_testing/lib/src/common.dart
View file @
0cbe5975
...
...
@@ -5,6 +5,7 @@
import
'dart:convert'
;
import
'package:meta/meta.dart'
;
import
'constants.dart'
;
/// A semantics node created from Android accessibility information.
...
...
dev/integration_tests/android_semantics_testing/lib/src/flutter_test_alternative.dart
deleted
100644 → 0
View file @
5039594f
// 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.
// Defines a 'package:test' shim.
// TODO(ianh): Remove this file once https://github.com/dart-lang/matcher/issues/98 is fixed
import
'package:test/test.dart'
hide
TypeMatcher
,
isInstanceOf
;
import
'package:test/test.dart'
as
test_package
show
TypeMatcher
;
export
'package:test/test.dart'
hide
TypeMatcher
,
isInstanceOf
;
/// A matcher that compares the type of the actual value to the type argument T.
test_package
.
TypeMatcher
<
T
>
isInstanceOf
<
T
>()
=>
isA
<
T
>();
dev/integration_tests/android_semantics_testing/lib/src/matcher.dart
View file @
0cbe5975
...
...
@@ -2,9 +2,10 @@
// 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
'common.dart'
;
import
'constants.dart'
;
import
'flutter_test_alternative.dart'
;
/// Matches an [AndroidSemanticsNode].
///
...
...
dev/tools/test/common.dart
View file @
0cbe5975
...
...
@@ -4,21 +4,15 @@
import
'dart:io'
;
import
'package:file/file.dart'
;
import
'package:test/test.dart'
hide
TypeMatcher
,
isInstanceOf
;
import
'package:test/test.dart'
as
test_package
show
TypeMatcher
;
import
'package:dev_tools/stdio.dart'
;
import
'package:args/args.dart'
;
import
'package:dev_tools/stdio.dart'
;
import
'package:file/file.dart'
;
import
'package:test/test.dart'
;
export
'package:test/test.dart'
hide
TypeMatcher
,
isInstanceOf
;
// Defines a 'package:test' shim.
// TODO(ianh): Remove this file once https://github.com/dart-lang/matcher/issues/98 is fixed
export
'package:test/test.dart'
hide
isInstanceOf
;
/// A matcher that compares the type of the actual value to the type argument T.
test_package
.
TypeMatcher
<
T
>
isInstanceOf
<
T
>()
=>
isA
<
T
>();
TypeMatcher
<
T
>
isInstanceOf
<
T
>()
=>
isA
<
T
>();
void
tryToDelete
(
Directory
directory
)
{
// This should not be necessary, but it turns out that
...
...
packages/flutter/test/flutter_test_alternative.dart
deleted
100644 → 0
View file @
5039594f
// 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.
// Defines a 'package:test' shim.
// TODO(ianh): Remove this file once https://github.com/dart-lang/matcher/issues/98 is fixed
import
'package:test_api/test_api.dart'
hide
TypeMatcher
,
isInstanceOf
;
// ignore: deprecated_member_use
import
'package:test_api/test_api.dart'
as
test_package
show
TypeMatcher
;
// ignore: deprecated_member_use
export
'package:test_api/test_api.dart'
hide
TypeMatcher
,
isInstanceOf
;
// ignore: deprecated_member_use
export
'package:test_api/fake.dart'
;
// ignore: deprecated_member_use
export
'package:flutter_test/flutter_test.dart'
show
createTestImage
;
/// A matcher that compares the type of the actual value to the type argument T.
test_package
.
TypeMatcher
<
T
>
isInstanceOf
<
T
>()
=>
isA
<
T
>();
/// Whether we are running in a web browser.
const
bool
isBrowser
=
identical
(
0
,
0.0
);
packages/flutter/test/foundation/assertions_test.dart
View file @
0cbe5975
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/foundation.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
import
'capture_output.dart'
;
...
...
packages/flutter/test/foundation/bit_field_test.dart
View file @
0cbe5975
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/foundation.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
// ignore: unused_field
enum
_TestEnum
{
a
,
b
,
c
,
d
,
e
,
f
,
g
,
h
}
...
...
packages/flutter/test/foundation/caching_iterable_test.dart
View file @
0cbe5975
...
...
@@ -3,8 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/foundation.dart'
;
import
'../flutter_test_alternative.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
int
yieldCount
=
0
;
...
...
packages/flutter/test/foundation/consolidate_response_test.dart
View file @
0cbe5975
...
...
@@ -3,16 +3,17 @@
// found in the LICENSE file.
@TestOn
(
'!chrome'
)
import
'dart:async'
;
import
'dart:io'
;
import
'dart:typed_data'
;
import
'package:flutter/foundation.dart'
;
import
'../flutter_test_alternative.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
final
Uint8List
chunkOne
=
Uint8List
.
fromList
(<
int
>[
0
,
1
,
2
,
3
,
4
,
5
]);
final
Uint8List
chunkTwo
=
Uint8List
.
fromList
(<
int
>[
6
,
7
,
8
,
9
,
10
]);
void
main
(
)
{
group
(
consolidateHttpClientResponseBytes
,
()
{
late
MockHttpClientResponse
response
;
...
...
packages/flutter/test/foundation/constants_test.dart
View file @
0cbe5975
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/foundation.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
void
main
(
)
{
test
(
'isWeb is false for flutter tester'
,
()
{
...
...
packages/flutter/test/foundation/double_precision_test.dart
View file @
0cbe5975
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/foundation.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
void
main
(
)
{
test
(
'debugFormatDouble formats doubles'
,
()
{
...
...
packages/flutter/test/foundation/error_reporting_test.dart
View file @
0cbe5975
...
...
@@ -3,8 +3,9 @@
// found in the LICENSE file.
@TestOn
(
'!chrome'
)
import
'package:flutter/foundation.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
Object
getAssertionErrorWithMessage
(
)
{
try
{
...
...
packages/flutter/test/foundation/isolates_test.dart
View file @
0cbe5975
...
...
@@ -3,8 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/foundation.dart'
;
import
'../flutter_test_alternative.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
int
test1
(
int
value
)
{
return
value
+
1
;
...
...
packages/flutter/test/foundation/licenses_test.dart
View file @
0cbe5975
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/foundation.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
void
main
(
)
{
test
(
'LicenseEntryWithLineBreaks - most cases'
,
()
{
...
...
packages/flutter/test/foundation/print_test.dart
View file @
0cbe5975
...
...
@@ -4,7 +4,7 @@
import
'package:flutter/foundation.dart'
;
import
'package:fake_async/fake_async.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
import
'capture_output.dart'
;
...
...
packages/flutter/test/foundation/reassemble_test.dart
View file @
0cbe5975
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/foundation.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
class
TestFoundationFlutterBinding
extends
BindingBase
{
bool
?
wasLocked
;
...
...
packages/flutter/test/foundation/serialization_test.dart
View file @
0cbe5975
...
...
@@ -5,7 +5,7 @@
import
'dart:typed_data'
;
import
'package:flutter/foundation.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
void
main
(
)
{
group
(
'Write and read buffer round-trip'
,
()
{
...
...
packages/flutter/test/foundation/service_extensions_test.dart
View file @
0cbe5975
...
...
@@ -12,7 +12,7 @@ import 'package:flutter/rendering.dart';
import
'package:flutter/scheduler.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter/widgets.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
class
TestServiceExtensionsBinding
extends
BindingBase
with
SchedulerBinding
,
...
...
packages/flutter/test/foundation/stack_frame_test.dart
View file @
0cbe5975
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/foundation.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
void
main
(
)
{
test
(
'Parses line'
,
()
{
...
...
packages/flutter/test/foundation/stack_trace_test.dart
View file @
0cbe5975
...
...
@@ -3,8 +3,9 @@
// found in the LICENSE file.
@TestOn
(
'!chrome'
)
import
'package:flutter/foundation.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
void
main
(
)
{
// TODO(ianh): These tests and the filtering mechanism should be revisited to
...
...
packages/flutter/test/foundation/synchronous_future_test.dart
View file @
0cbe5975
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/foundation.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
void
main
(
)
{
test
(
'SynchronousFuture control test'
,
()
async
{
...
...
packages/flutter/test/gestures/arena_test.dart
View file @
0cbe5975
...
...
@@ -3,8 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/gestures.dart'
;
import
'../flutter_test_alternative.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
typedef
GestureArenaCallback
=
void
Function
(
Object
key
);
...
...
packages/flutter/test/gestures/double_tap_test.dart
View file @
0cbe5975
...
...
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter/gestures.dart'
;
import
'package:fake_async/fake_async.dart'
;
import
'package:flutter/gestures.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'../flutter_test_alternative.dart'
;
import
'gesture_tester.dart'
;
class
TestGestureArenaMember
extends
GestureArenaMember
{
...
...
packages/flutter/test/gestures/gesture_binding_resample_event_test.dart
View file @
0cbe5975
...
...
@@ -9,8 +9,7 @@ import 'package:fake_async/fake_async.dart';
import
'package:flutter/foundation.dart'
;
import
'package:flutter/gestures.dart'
;
import
'package:flutter/scheduler.dart'
;
import
'../flutter_test_alternative.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
typedef
HandleEventCallback
=
void
Function
(
PointerEvent
event
);
...
...
packages/flutter/test/gestures/gesture_binding_test.dart
View file @
0cbe5975
...
...
@@ -7,8 +7,7 @@ import 'dart:ui' as ui;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/gestures.dart'
;
import
'package:flutter/scheduler.dart'
;
import
'../flutter_test_alternative.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
typedef
HandleEventCallback
=
void
Function
(
PointerEvent
event
);
...
...
packages/flutter/test/gestures/gesture_tester.dart
View file @
0cbe5975
...
...
@@ -2,12 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:fake_async/fake_async.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/gestures.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:meta/meta.dart'
;
import
'package:fake_async/fake_async.dart'
;
import
'../flutter_test_alternative.dart'
;
class
TestGestureFlutterBinding
extends
BindingBase
with
GestureBinding
{
}
...
...
packages/flutter/test/gestures/hit_test_test.dart
View file @
0cbe5975
...
...
@@ -3,10 +3,9 @@
// found in the LICENSE file.
import
'package:flutter/gestures.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:vector_math/vector_math_64.dart'
;
import
'../flutter_test_alternative.dart'
;
void
main
(
)
{
test
(
'wrapped HitTestResult gets HitTestEntry added to wrapping HitTestResult'
,
()
async
{
final
HitTestEntry
entry1
=
HitTestEntry
(
_DummyHitTestTarget
());
...
...
packages/flutter/test/gestures/locking_test.dart
View file @
0cbe5975
...
...
@@ -6,8 +6,7 @@ import 'dart:ui' as ui;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/gestures.dart'
;
import
'../flutter_test_alternative.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
typedef
HandleEventCallback
=
void
Function
(
PointerEvent
event
);
...
...
packages/flutter/test/gestures/long_press_test.dart
View file @
0cbe5975
...
...
@@ -3,8 +3,8 @@
// found in the LICENSE file.
import
'package:flutter/gestures.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'../flutter_test_alternative.dart'
;
import
'gesture_tester.dart'
;
// Down/move/up pair 1: normal tap sequence
...
...
packages/flutter/test/gestures/lsq_solver_test.dart
View file @
0cbe5975
...
...
@@ -3,8 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/gestures.dart'
;
import
'../flutter_test_alternative.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
void
main
(
)
{
bool
approx
(
double
value
,
double
expectation
)
{
...
...
packages/flutter/test/gestures/pointer_signal_resolver_test.dart
View file @
0cbe5975
...
...
@@ -3,10 +3,9 @@
// found in the LICENSE file.
import
'package:flutter/gestures.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:vector_math/vector_math_64.dart'
;
import
'../flutter_test_alternative.dart'
;
class
TestPointerSignalListener
{
TestPointerSignalListener
(
this
.
event
);
...
...
packages/flutter/test/gestures/resampler_test.dart
View file @
0cbe5975
...
...
@@ -3,8 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/gestures.dart'
;
import
'../flutter_test_alternative.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
void
main
(
)
{
PointerEvent
_createSimulatedPointerAddedEvent
(
...
...
packages/flutter/test/harness/trivial_test.dart
View file @
0cbe5975
...
...
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
void
main
(
)
{
test
(
'should pass'
,
()
{
...
...
packages/flutter/test/material/colors_test.dart
View file @
0cbe5975
...
...
@@ -3,8 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/material.dart'
;
import
'../flutter_test_alternative.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
const
List
<
int
>
primaryKeys
=
<
int
>[
50
,
100
,
200
,
300
,
400
,
500
,
600
,
700
,
800
,
900
];
const
List
<
int
>
accentKeys
=
<
int
>[
100
,
200
,
400
,
700
];
...
...
packages/flutter/test/painting/box_fit_test.dart
View file @
0cbe5975
...
...
@@ -3,8 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/painting.dart'
;
import
'../flutter_test_alternative.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
void
main
(
)
{
test
(
'applyBoxFit'
,
()
{
...
...
packages/flutter/test/painting/decoration_test.dart
View file @
0cbe5975
...
...
@@ -9,8 +9,8 @@ import 'dart:ui' as ui show Image, ColorFilter;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/painting.dart'
;
import
'package:fake_async/fake_async.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'../flutter_test_alternative.dart'
;
import
'../image_data.dart'
;
import
'../painting/mocks_for_image_cache.dart'
;
import
'../rendering/rendering_tester.dart'
;
...
...
packages/flutter/test/painting/geometry_test.dart
View file @
0cbe5975
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/painting.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
void
main
(
)
{
test
(
'positionDependentBox'
,
()
{
...
...
packages/flutter/test/painting/image_cache_resize_test.dart
View file @
0cbe5975
...
...
@@ -5,7 +5,7 @@
import
'dart:ui'
as
ui
;
import
'package:flutter/painting.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
import
'../rendering/rendering_tester.dart'
;
import
'mocks_for_image_cache.dart'
;
...
...
packages/flutter/test/painting/image_cache_test.dart
View file @
0cbe5975
...
...
@@ -8,8 +8,8 @@ import 'dart:ui' as ui;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/painting.dart'
;
import
'package:flutter/scheduler.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'../flutter_test_alternative.dart'
;
import
'../rendering/rendering_tester.dart'
;
import
'mocks_for_image_cache.dart'
;
...
...
packages/flutter/test/painting/image_decoder_test.dart
View file @
0cbe5975
...
...
@@ -6,8 +6,8 @@ import 'dart:typed_data';
import
'dart:ui'
as
ui
;
import
'package:flutter/painting.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'../flutter_test_alternative.dart'
;
import
'../image_data.dart'
;
import
'painting_utils.dart'
;
...
...
packages/flutter/test/painting/strut_style_test.dart
View file @
0cbe5975
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/painting.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
void
main
(
)
{
test
(
'StrutStyle diagnostics test'
,
()
{
...
...
packages/flutter/test/painting/text_style_test.dart
View file @
0cbe5975
...
...
@@ -4,9 +4,9 @@
import
'dart:ui'
as
ui
show
TextStyle
,
ParagraphStyle
,
FontFeature
,
Shadow
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/painting.dart'
;
import
'package:flutter/src/foundation/constants.dart'
;
import
'../flutter_test_alternative.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
// This matcher verifies ui.TextStyle.toString (from dart:ui) reports a superset
// of the given TextStyle's (from painting.dart) properties.
...
...
packages/flutter/test/physics/near_equal_test.dart
View file @
0cbe5975
...
...
@@ -3,8 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/physics.dart'
;
import
'../flutter_test_alternative.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
void
main
(
)
{
test
(
'test_friction'
,
()
{
...
...
packages/flutter/test/rendering/annotated_region_test.dart
View file @
0cbe5975
...
...
@@ -4,7 +4,7 @@
import
'package:flutter/rendering.dart'
;
import
'package:flutter/widgets.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
void
main
(
)
{
group
(
'
$AnnotatedRegion
find'
,
()
{
...
...
packages/flutter/test/rendering/baseline_test.dart
View file @
0cbe5975
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/rendering.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
import
'rendering_tester.dart'
;
...
...
packages/flutter/test/rendering/cached_intrinsics_test.dart
View file @
0cbe5975
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/rendering.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
class
RenderTestBox
extends
RenderBox
{
double
value
=
0.0
;
...
...
packages/flutter/test/rendering/constraints_test.dart
View file @
0cbe5975
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/rendering.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
import
'rendering_tester.dart'
;
...
...
packages/flutter/test/rendering/debug_test.dart
View file @
0cbe5975
...
...
@@ -5,8 +5,8 @@
import
'package:flutter/foundation.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:vector_math/vector_math_64.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'../flutter_test_alternative.dart'
;
import
'mock_canvas.dart'
;
import
'rendering_tester.dart'
;
...
...
packages/flutter/test/rendering/dynamic_intrinsics_test.dart
View file @
0cbe5975
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/rendering.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
import
'rendering_tester.dart'
;
...
...
packages/flutter/test/rendering/first_frame_test.dart
View file @
0cbe5975
...
...
@@ -9,8 +9,7 @@ import 'package:flutter/gestures.dart';
import
'package:flutter/rendering.dart'
;
import
'package:flutter/scheduler.dart'
;
import
'package:flutter/services.dart'
;
import
'../flutter_test_alternative.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
void
main
(
)
{
test
(
'Flutter dispatches first frame event on the web only'
,
()
async
{
...
...
packages/flutter/test/rendering/independent_layout_test.dart
View file @
0cbe5975
...
...
@@ -5,7 +5,7 @@
import
'dart:ui'
as
ui
show
window
;
import
'package:flutter/rendering.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
import
'rendering_tester.dart'
;
...
...
packages/flutter/test/rendering/intrinsic_width_test.dart
View file @
0cbe5975
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/rendering.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
import
'rendering_tester.dart'
;
...
...
packages/flutter/test/rendering/mouse_tracker_cursor_test.dart
View file @
0cbe5975
...
...
@@ -8,8 +8,8 @@ import 'dart:ui' show PointerChange;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/gestures.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'../flutter_test_alternative.dart'
;
import
'mouse_tracker_test_utils.dart'
;
typedef
MethodCallHandler
=
Future
<
dynamic
>
Function
(
MethodCall
call
);
...
...
packages/flutter/test/rendering/mouse_tracker_test.dart
View file @
0cbe5975
...
...
@@ -7,8 +7,8 @@ import 'dart:ui' show PointerChange;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/gestures.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'../flutter_test_alternative.dart'
;
import
'mouse_tracker_test_utils.dart'
;
MouseTracker
get
_mouseTracker
=>
RendererBinding
.
instance
!.
mouseTracker
;
...
...
packages/flutter/test/rendering/mutations_test.dart
View file @
0cbe5975
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/rendering.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
import
'rendering_tester.dart'
;
...
...
packages/flutter/test/rendering/non_render_object_root_test.dart
View file @
0cbe5975
...
...
@@ -4,7 +4,7 @@
import
'package:flutter/foundation.dart'
;
import
'package:flutter/rendering.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
import
'rendering_tester.dart'
;
...
...
packages/flutter/test/rendering/offstage_test.dart
View file @
0cbe5975
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/rendering.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
import
'rendering_tester.dart'
;
...
...
packages/flutter/test/rendering/overflow_test.dart
View file @
0cbe5975
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/rendering.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
import
'rendering_tester.dart'
;
...
...
packages/flutter/test/rendering/paragraph_intrinsics_test.dart
View file @
0cbe5975
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/rendering.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
void
main
(
)
{
test
(
'list body and paragraph intrinsics'
,
()
{
...
...
packages/flutter/test/rendering/positioned_box_test.dart
View file @
0cbe5975
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/rendering.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
import
'rendering_tester.dart'
;
...
...
packages/flutter/test/rendering/proxy_box_test.dart
View file @
0cbe5975
...
...
@@ -9,7 +9,7 @@ import 'package:flutter/animation.dart';
import
'package:flutter/foundation.dart'
;
import
'package:flutter/gestures.dart'
;
import
'package:flutter/rendering.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
import
'rendering_tester.dart'
;
...
...
packages/flutter/test/rendering/proxy_getters_and_setters_test.dart
View file @
0cbe5975
...
...
@@ -4,7 +4,7 @@
import
'package:flutter/material.dart'
;
import
'package:flutter/rendering.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
void
main
(
)
{
test
(
'RenderConstrainedBox getters and setters'
,
()
{
...
...
packages/flutter/test/rendering/proxy_sliver_test.dart
View file @
0cbe5975
...
...
@@ -4,7 +4,7 @@
import
'package:flutter/rendering.dart'
;
import
'package:flutter/widgets.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
import
'rendering_tester.dart'
;
...
...
packages/flutter/test/rendering/reattach_test.dart
View file @
0cbe5975
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/rendering.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
import
'rendering_tester.dart'
;
...
...
packages/flutter/test/rendering/relative_rect_test.dart
View file @
0cbe5975
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/rendering.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
void
main
(
)
{
test
(
'RelativeRect.=='
,
()
{
...
...
packages/flutter/test/rendering/repaint_boundary_test.dart
View file @
0cbe5975
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/rendering.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
import
'rendering_tester.dart'
;
...
...
packages/flutter/test/rendering/semantics_and_children_test.dart
View file @
0cbe5975
...
...
@@ -4,8 +4,7 @@
import
'package:flutter/material.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter_test/flutter_test.dart'
show
TestVSync
;
import
'../flutter_test_alternative.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'rendering_tester.dart'
;
...
...
packages/flutter/test/rendering/simple_semantics_test.dart
View file @
0cbe5975
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/rendering.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
import
'rendering_tester.dart'
;
...
...
packages/flutter/test/rendering/size_test.dart
View file @
0cbe5975
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/rendering.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
import
'rendering_tester.dart'
;
...
...
packages/flutter/test/rendering/sliver_cache_test.dart
View file @
0cbe5975
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/rendering.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
import
'rendering_tester.dart'
;
...
...
packages/flutter/test/rendering/sliver_fixed_extent_layout_test.dart
View file @
0cbe5975
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/rendering.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
import
'rendering_tester.dart'
;
...
...
packages/flutter/test/rendering/sliver_persistent_header_test.dart
View file @
0cbe5975
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/rendering.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
import
'rendering_tester.dart'
;
...
...
packages/flutter/test/rendering/slivers_block_test.dart
View file @
0cbe5975
...
...
@@ -4,8 +4,7 @@
import
'package:flutter/rendering.dart'
;
import
'package:flutter/animation.dart'
;
import
'../flutter_test_alternative.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'rendering_tester.dart'
;
...
...
packages/flutter/test/rendering/slivers_layout_test.dart
View file @
0cbe5975
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/rendering.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
import
'rendering_tester.dart'
;
...
...
packages/flutter/test/rendering/stack_test.dart
View file @
0cbe5975
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/rendering.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
import
'rendering_tester.dart'
;
...
...
packages/flutter/test/rendering/transform_test.dart
View file @
0cbe5975
...
...
@@ -5,7 +5,7 @@
import
'dart:math'
as
math
;
import
'package:flutter/rendering.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
import
'rendering_tester.dart'
;
...
...
packages/flutter/test/scheduler/animation_test.dart
View file @
0cbe5975
...
...
@@ -5,8 +5,7 @@
import
'package:flutter/foundation.dart'
;
import
'package:flutter/scheduler.dart'
;
import
'package:flutter/services.dart'
;
import
'../flutter_test_alternative.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'scheduler_tester.dart'
;
...
...
packages/flutter/test/scheduler/priority_test.dart
View file @
0cbe5975
...
...
@@ -3,8 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/scheduler.dart'
;
import
'../flutter_test_alternative.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
void
main
(
)
{
test
(
'Priority operators control test'
,
()
async
{
...
...
packages/flutter/test/scheduler/scheduler_test.dart
View file @
0cbe5975
...
...
@@ -8,8 +8,8 @@ import 'dart:ui' show window;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/scheduler.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'../flutter_test_alternative.dart'
;
import
'scheduler_tester.dart'
;
class
TestSchedulerBinding
extends
BindingBase
with
SchedulerBinding
,
ServicesBinding
{
...
...
packages/flutter/test/semantics/custom_semantics_action_test.dart
View file @
0cbe5975
...
...
@@ -3,8 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/semantics.dart'
;
import
'../flutter_test_alternative.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
void
main
(
)
{
group
(
CustomSemanticsAction
,
()
{
...
...
packages/flutter/test/semantics/semantics_service_test.dart
View file @
0cbe5975
...
...
@@ -6,9 +6,7 @@ import 'dart:ui' show TextDirection;
import
'package:flutter/semantics.dart'
;
import
'package:flutter/services.dart'
show
SystemChannels
;
import
'package:flutter_test/flutter_test.dart'
show
TestWidgetsFlutterBinding
;
import
'../flutter_test_alternative.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
void
main
(
)
{
TestWidgetsFlutterBinding
.
ensureInitialized
();
...
...
packages/flutter/test/services/message_codecs_test.dart
View file @
0cbe5975
...
...
@@ -10,7 +10,8 @@ import 'dart:typed_data';
import
'package:flutter/foundation.dart'
show
WriteBuffer
;
import
'package:flutter/services.dart'
;
import
'../flutter_test_alternative.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'message_codecs_testing.dart'
;
void
main
(
)
{
...
...
packages/flutter/test/services/message_codecs_testing.dart
View file @
0cbe5975
...
...
@@ -5,7 +5,7 @@
import
'dart:typed_data'
;
import
'package:flutter/services.dart'
;
import
'
../flutter_test_alternative
.dart'
;
import
'
package:flutter_test/flutter_test
.dart'
;
void
checkEncoding
<
T
>(
MessageCodec
<
T
>
codec
,
T
message
,
List
<
int
>
expectedBytes
)
{
final
ByteData
encoded
=
codec
.
encodeMessage
(
message
)!;
...
...
packages/flutter/test/services/message_codecs_vm_test.dart
View file @
0cbe5975
...
...
@@ -7,7 +7,8 @@ import 'dart:typed_data';
import
'package:flutter/foundation.dart'
;
import
'package:flutter/services.dart'
;
import
'../flutter_test_alternative.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'message_codecs_testing.dart'
;
void
main
(
)
{
...
...
packages/flutter/test/services/platform_channel_test.dart
View file @
0cbe5975
...
...
@@ -3,9 +3,7 @@
// found in the LICENSE file.
import
'package:flutter/services.dart'
;
import
'package:flutter_test/flutter_test.dart'
show
TestWidgetsFlutterBinding
;
import
'../flutter_test_alternative.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
void
main
(
)
{
TestWidgetsFlutterBinding
.
ensureInitialized
();
...
...
packages/flutter/test/services/platform_views_test.dart
View file @
0cbe5975
...
...
@@ -4,8 +4,7 @@
import
'package:flutter/painting.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter_test/flutter_test.dart'
show
TestWidgetsFlutterBinding
;
import
'../flutter_test_alternative.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'fake_platform_views.dart'
;
...
...
packages/flutter/test/services/text_input_test.dart
View file @
0cbe5975
...
...
@@ -7,8 +7,7 @@ import 'dart:convert' show utf8;
import
'dart:convert'
show
jsonDecode
;
import
'package:flutter/services.dart'
;
import
'package:flutter_test/flutter_test.dart'
show
TestWidgetsFlutterBinding
;
import
'../flutter_test_alternative.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
void
main
(
)
{
TestWidgetsFlutterBinding
.
ensureInitialized
();
...
...
packages/flutter/test_private/README.md
View file @
0cbe5975
...
...
@@ -32,7 +32,6 @@ To add a private test, add a manifest file of the form (assuming
],
"pubspec"
:
"my_private_test.pubspec.yaml"
,
"deps"
:
[
"test/flutter_test_alternative.dart"
,
"lib/src/subpackage/my_private_implementation.dart"
,
]
}
...
...
packages/flutter/test_private/test/animated_icons_private_test.dart.tmpl
View file @
0cbe5975
...
...
@@ -15,8 +15,7 @@ import 'dart:ui' as ui show Paint, Path, Canvas;
import 'package:flutter/animation.dart';
import 'package:flutter/widgets.dart';
import 'test/flutter_test_alternative.dart';
import 'package:flutter_test/flutter_test.dart';
part 'src/material/animated_icons/animated_icons.dart';
part 'src/material/animated_icons/animated_icons_data.dart';
...
...
packages/flutter/test_private/test/animated_icons_private_test.json
View file @
0cbe5975
...
...
@@ -3,9 +3,7 @@
"animated_icons_private_test.dart.tmpl"
],
"pubspec"
:
"pubspec.yaml"
,
"test_deps"
:
[
"test/flutter_test_alternative.dart"
],
"test_deps"
:
[],
"deps"
:
[
"lib/src/material/animated_icons/animated_icons.dart"
,
"lib/src/material/animated_icons/animated_icons_data.dart"
,
...
...
@@ -24,4 +22,4 @@
"lib/src/material/animated_icons/data/search_ellipsis.g.dart"
,
"lib/src/material/animated_icons/data/view_list.g.dart"
]
}
\ No newline at end of file
}
packages/flutter_driver/test/common.dart
View file @
0cbe5975
...
...
@@ -5,17 +5,13 @@
import
'dart:io'
;
import
'package:flutter_driver/src/common/error.dart'
;
import
'package:test_api/test_api.dart'
hide
TypeMatcher
,
isInstanceOf
;
// ignore: deprecated_member_use
import
'package:test_api/test_api.dart'
as
test_package
show
TypeMatcher
;
// ignore: deprecated_member_use
import
'package:test_api/test_api.dart'
;
// ignore: deprecated_member_use
export
'package:test_api/test_api.dart'
hide
TypeMatcher
,
isInstanceOf
;
// ignore: deprecated_member_use
export
'package:test_api/test_api.dart'
hide
isInstanceOf
;
// ignore: deprecated_member_use
export
'package:test_api/fake.dart'
;
// ignore: deprecated_member_use
// Defines a 'package:test' shim.
// TODO(ianh): Clean this up once https://github.com/dart-lang/matcher/issues/98 is fixed
/// A matcher that compares the type of the actual value to the type argument T.
test_package
.
TypeMatcher
<
T
>
isInstanceOf
<
T
>()
=>
isA
<
T
>();
TypeMatcher
<
T
>
isInstanceOf
<
T
>()
=>
isA
<
T
>();
void
tryToDelete
(
Directory
directory
)
{
// This should not be necessary, but it turns out that
...
...
packages/flutter_test/lib/src/_matchers_io.dart
View file @
0cbe5975
...
...
@@ -9,8 +9,7 @@ import 'package:flutter/widgets.dart';
import
'package:flutter/rendering.dart'
;
import
'package:flutter/services.dart'
;
import
'package:test_api/src/frontend/async_matcher.dart'
;
// ignore: implementation_imports
// ignore: deprecated_member_use
import
'package:test_api/test_api.dart'
hide
TypeMatcher
,
isInstanceOf
;
import
'package:test_api/test_api.dart'
;
// ignore: deprecated_member_use
import
'binding.dart'
;
import
'finders.dart'
;
...
...
packages/flutter_test/lib/src/_matchers_web.dart
View file @
0cbe5975
...
...
@@ -7,8 +7,7 @@ import 'dart:ui' as ui;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/widgets.dart'
;
import
'package:test_api/src/frontend/async_matcher.dart'
;
// ignore: implementation_imports
// ignore: deprecated_member_use
import
'package:test_api/test_api.dart'
hide
TypeMatcher
,
isInstanceOf
;
import
'package:test_api/test_api.dart'
;
// ignore: deprecated_member_use
import
'binding.dart'
;
import
'finders.dart'
;
...
...
packages/flutter_test/lib/src/matchers.dart
View file @
0cbe5975
...
...
@@ -7,10 +7,9 @@ import 'dart:typed_data';
import
'dart:ui'
as
ui
;
import
'dart:ui'
;
// This import is discouraged in general, but we need it to implement flutter_test.
// ignore: deprecated_member_use
import
'package:test_api/test_api.dart'
hide
TypeMatcher
,
isInstanceOf
;
// ignore: deprecated_member_use
import
'package:test_api/test_api.dart'
as
test_package
show
TypeMatcher
;
import
'package:test_api/test_api.dart'
;
import
'package:test_api/src/frontend/async_matcher.dart'
;
// ignore: implementation_imports
import
'package:flutter/foundation.dart'
;
...
...
@@ -196,7 +195,7 @@ final Matcher throwsAssertionError = throwsA(isAssertionError);
///
/// * [throwsFlutterError], to test if a function throws a [FlutterError].
/// * [isAssertionError], to test if any object is any kind of [AssertionError].
final
test_package
.
TypeMatcher
<
FlutterError
>
isFlutterError
=
isA
<
FlutterError
>();
final
TypeMatcher
<
FlutterError
>
isFlutterError
=
isA
<
FlutterError
>();
/// A matcher for [AssertionError].
///
...
...
@@ -206,11 +205,12 @@ final test_package.TypeMatcher<FlutterError> isFlutterError = isA<FlutterError>(
///
/// * [throwsAssertionError], to test if a function throws any [AssertionError].
/// * [isFlutterError], to test if any object is a [FlutterError].
final
test_package
.
TypeMatcher
<
AssertionError
>
isAssertionError
=
isA
<
AssertionError
>();
final
TypeMatcher
<
AssertionError
>
isAssertionError
=
isA
<
AssertionError
>();
/// A matcher that compares the type of the actual value to the type argument T.
// TODO(ianh): Remove this once https://github.com/dart-lang/matcher/issues/98 is fixed
test_package
.
TypeMatcher
<
T
>
isInstanceOf
<
T
>()
=>
isA
<
T
>();
///
/// This is identical to [isA] and is included for backwards compatibility.
TypeMatcher
<
T
>
isInstanceOf
<
T
>()
=>
isA
<
T
>();
/// Asserts that two [double]s are equal, within some tolerated error.
///
...
...
packages/flutter_test/lib/src/widget_tester.dart
View file @
0cbe5975
...
...
@@ -11,6 +11,7 @@ import 'package:flutter/scheduler.dart';
import
'package:flutter/services.dart'
;
import
'package:meta/meta.dart'
;
// 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
;
...
...
@@ -25,13 +26,26 @@ import 'test_compat.dart';
import
'test_pointer.dart'
;
import
'test_text_input.dart'
;
//
/
Keep users from needing multiple imports to test semantics.
// Keep users from needing multiple imports to test semantics.
export
'package:flutter/rendering.dart'
show
SemanticsHandle
;
// We re-export the test package minus some features that we reimplement.
//
// Specifically:
//
// - test, group, setUpAll, tearDownAll, setUp, tearDown, and expect would
// conflict with our own implementations in test_compat.dart. This handles
// setting up a declarer when one is not defined, which can happen when a
// test is executed via `flutter run`.
//
// - expect is reimplemented below, to catch incorrect async usage.
//
// - isInstanceOf is reimplemented in matchers.dart because we don't want to
// mark it as deprecated (ours is just a method, not a class).
//
// The test_api package has a deprecation warning to discourage direct use but
// that doesn't apply here.
// ignore: deprecated_member_use
/// Hide these imports so that they do not conflict with our own implementations in
/// test_compat.dart. This handles setting up a declarer when one is not defined, which
/// can happen when a test is executed via flutter_run.
export
'package:test_api/test_api.dart'
hide
test
,
group
,
...
...
@@ -39,9 +53,8 @@ export 'package:test_api/test_api.dart' hide
tearDownAll
,
setUp
,
tearDown
,
expect
,
// we have our own wrapper below
TypeMatcher
,
// matcher's TypeMatcher conflicts with the one in the Flutter framework
isInstanceOf
;
// we have our own wrapper in matchers.dart
expect
,
isInstanceOf
;
/// Signature for callback to [testWidgets] and [benchmarkWidgets].
typedef
WidgetTesterCallback
=
Future
<
void
>
Function
(
WidgetTester
widgetTester
);
...
...
packages/flutter_tools/test/general.shard/generate_localizations_test.dart
View file @
0cbe5975
...
...
@@ -16,10 +16,7 @@ import 'package:flutter_tools/src/globals.dart' as globals;
import
'package:flutter_tools/src/localizations/gen_l10n.dart'
;
import
'package:flutter_tools/src/localizations/gen_l10n_types.dart'
;
import
'package:flutter_tools/src/localizations/localizations_utils.dart'
;
import
'package:test_api/test_api.dart'
hide
TypeMatcher
,
isInstanceOf
;
// ignore: deprecated_member_use
// ignore: deprecated_member_use
export
'package:test_core/test_core.dart'
hide
TypeMatcher
,
isInstanceOf
,
test
;
// Defines a 'package:test' shim.
import
'package:test/test.dart'
;
final
String
defaultL10nPathString
=
globals
.
fs
.
path
.
join
(
'lib'
,
'l10n'
);
final
String
syntheticPackagePath
=
globals
.
fs
.
path
.
join
(
'.dart_tool'
,
'flutter_gen'
);
...
...
packages/flutter_tools/test/src/common.dart
View file @
0cbe5975
...
...
@@ -8,35 +8,33 @@ import 'dart:async';
import
'package:args/args.dart'
;
import
'package:args/command_runner.dart'
;
import
'package:fake_async/fake_async.dart'
;
import
'package:file/memory.dart'
;
import
'package:flutter_tools/src/base/common.dart'
;
import
'package:flutter_tools/src/base/context.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/io.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/base/platform.dart'
;
import
'package:flutter_tools/src/base/user_messages.dart'
;
import
'package:flutter_tools/src/cache.dart'
;
import
'package:flutter_tools/src/commands/create.dart'
;
import
'package:flutter_tools/src/convert.dart'
;
import
'package:flutter_tools/src/doctor.dart'
;
import
'package:flutter_tools/src/vmservice.dart'
;
import
'package:vm_service/vm_service.dart'
as
vm_service
;
import
'package:path/path.dart'
as
path
;
// ignore: package_path_import
import
'package:flutter_tools/src/base/common.dart'
;
import
'package:flutter_tools/src/base/context.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/io.dart'
;
import
'package:flutter_tools/src/commands/create.dart'
;
import
'package:flutter_tools/src/globals.dart'
as
globals
;
import
'package:flutter_tools/src/runner/flutter_command.dart'
;
import
'package:flutter_tools/src/runner/flutter_command_runner.dart'
;
import
'package:flutter_tools/src/
globals.dart'
as
globals
;
import
'package:flutter_tools/src/
vmservice.dart'
;
import
'package:meta/meta.dart'
;
import
'package:fake_async/fake_async.dart'
;
import
'package:test_api/test_api.dart'
as
test_package
show
TypeMatcher
,
test
;
// ignore: deprecated_member_use
import
'package:test_api/test_api.dart'
hide
TypeMatcher
,
isInstanceOf
;
// ignore: deprecated_member_use
// ignore: deprecated_member_use
export
'package:test_core/test_core.dart'
hide
TypeMatcher
,
isInstanceOf
,
test
;
// Defines a 'package:test' shim.
import
'package:path/path.dart'
as
path
;
// ignore: package_path_import
import
'package:test_api/test_api.dart'
as
test_package
show
test
;
// ignore: deprecated_member_use
import
'package:test_api/test_api.dart'
hide
test
;
// ignore: deprecated_member_use
import
'package:vm_service/vm_service.dart'
as
vm_service
;
export
'package:test_api/test_api.dart'
hide
test
,
isInstanceOf
;
// ignore: deprecated_member_use
/// A matcher that compares the type of the actual value to the type argument T.
// TODO(ianh): Remove this once https://github.com/dart-lang/matcher/issues/98 is fixed
test_package
.
TypeMatcher
<
T
>
isInstanceOf
<
T
>()
=>
isA
<
T
>();
TypeMatcher
<
T
>
isInstanceOf
<
T
>()
=>
isA
<
T
>();
void
tryToDelete
(
Directory
directory
)
{
// This should not be necessary, but it turns out that
...
...
@@ -135,7 +133,7 @@ Matcher throwsToolExit({ int exitCode, Pattern message }) {
}
/// Matcher for [ToolExit]s.
final
test_package
.
TypeMatcher
<
ToolExit
>
isToolExit
=
isA
<
ToolExit
>();
final
TypeMatcher
<
ToolExit
>
isToolExit
=
isA
<
ToolExit
>();
/// Matcher for functions that throw [ProcessException].
Matcher
throwsProcessException
(
{
Pattern
message
})
{
...
...
@@ -147,7 +145,7 @@ Matcher throwsProcessException({ Pattern message }) {
}
/// Matcher for [ProcessException]s.
final
test_package
.
TypeMatcher
<
ProcessException
>
isProcessException
=
isA
<
ProcessException
>();
final
TypeMatcher
<
ProcessException
>
isProcessException
=
isA
<
ProcessException
>();
/// Creates a flutter project in the [temp] directory using the
/// [arguments] list if specified, or `--no-pub` if not.
...
...
@@ -439,7 +437,7 @@ Matcher matchDoctorValidation({
String
statusInfo
,
dynamic
messages
})
{
return
const
test_package
.
TypeMatcher
<
ValidationResult
>()
return
const
TypeMatcher
<
ValidationResult
>()
.
having
((
ValidationResult
result
)
=>
result
.
type
,
'type'
,
validationType
)
.
having
((
ValidationResult
result
)
=>
result
.
statusInfo
,
'statusInfo'
,
statusInfo
)
.
having
((
ValidationResult
result
)
=>
result
.
messages
,
'messages'
,
messages
);
...
...
packages/fuchsia_remote_debug_protocol/test/common.dart
View file @
0cbe5975
This diff is collapsed.
Click to expand it.
packages/integration_test/example/test_driver/failure_test.dart
View file @
0cbe5975
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment