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
d5fbc375
Unverified
Commit
d5fbc375
authored
May 25, 2022
by
Michael Goderbauer
Committed by
GitHub
May 25, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused code from tests (#104550)
parent
0a417c3b
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
4 additions
and
411 deletions
+4
-411
platform_helper.dart
packages/flutter/test/foundation/platform_helper.dart
+0
-18
print_test.dart
packages/flutter/test/foundation/print_test.dart
+0
-2
arena_test.dart
packages/flutter/test/gestures/arena_test.dart
+0
-2
long_press_test.dart
packages/flutter/test/gestures/long_press_test.dart
+0
-17
multitap_test.dart
packages/flutter/test/gestures/multitap_test.dart
+0
-3
chip_test.dart
packages/flutter/test/material/chip_test.dart
+0
-2
chip_theme_test.dart
packages/flutter/test/material/chip_theme_test.dart
+0
-10
dropdown_test.dart
packages/flutter/test/material/dropdown_test.dart
+0
-29
theme_defaults_test.dart
packages/flutter/test/material/theme_defaults_test.dart
+0
-3
image_stream_test.dart
packages/flutter/test/painting/image_stream_test.dart
+0
-18
editable_test.dart
packages/flutter/test/rendering/editable_test.dart
+0
-37
custom_paint_test.dart
packages/flutter/test/widgets/custom_paint_test.dart
+0
-15
layout_builder_and_parent_data_test.dart
...ter/test/widgets/layout_builder_and_parent_data_test.dart
+0
-14
multichild_test.dart
packages/flutter/test/widgets/multichild_test.dart
+0
-17
route_notification_messages_test.dart
...lutter/test/widgets/route_notification_messages_test.dart
+0
-7
routes_test.dart
packages/flutter/test/widgets/routes_test.dart
+0
-44
scrollable_semantics_test.dart
packages/flutter/test/widgets/scrollable_semantics_test.dart
+0
-4
selectable_region_test.dart
packages/flutter/test/widgets/selectable_region_test.dart
+0
-92
selectable_text_test.dart
packages/flutter/test/widgets/selectable_text_test.dart
+0
-9
shortcuts_test.dart
packages/flutter/test/widgets/shortcuts_test.dart
+0
-15
slivers_evil_test.dart
packages/flutter/test/widgets/slivers_evil_test.dart
+0
-15
text_selection_test.dart
packages/flutter/test/widgets/text_selection_test.dart
+0
-31
widget_inspector_test.dart
packages/flutter/test/widgets/widget_inspector_test.dart
+4
-7
No files found.
packages/flutter/test/foundation/platform_helper.dart
deleted
100644 → 0
View file @
0a417c3b
// 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
'dart:io'
show
Platform
;
/// Returns [Platform.pathSeparator], suitably escaped so as to be usable in a
/// regular expression.
String
get
pathSeparatorForRegExp
{
switch
(
Platform
.
pathSeparator
)
{
case
r'/'
:
return
r'/'
;
case
r'\'
:
return
r'\\'
;
// because dividerRegExp gets inserted into regexps
default
:
throw
'Unsupported platform.'
;
}
}
packages/flutter/test/foundation/print_test.dart
View file @
d5fbc375
...
...
@@ -8,8 +8,6 @@ import 'package:flutter_test/flutter_test.dart';
import
'capture_output.dart'
;
String
?
foo
;
void
main
(
)
{
test
(
'debugPrint'
,
()
{
expect
(
...
...
packages/flutter/test/gestures/arena_test.dart
View file @
d5fbc375
...
...
@@ -5,8 +5,6 @@
import
'package:flutter/gestures.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
typedef
GestureArenaCallback
=
void
Function
(
Object
key
);
const
int
primaryKey
=
4
;
class
TestGestureArenaMember
extends
GestureArenaMember
{
...
...
packages/flutter/test/gestures/long_press_test.dart
View file @
d5fbc375
...
...
@@ -41,23 +41,6 @@ const PointerDownEvent down3 = PointerDownEvent(
buttons:
kSecondaryButton
,
);
const
PointerUpEvent
up3
=
PointerUpEvent
(
pointer:
7
,
position:
Offset
(
31
,
29
),
);
// Down/up pair 4: tap sequence with tertiary button
const
PointerDownEvent
down4
=
PointerDownEvent
(
pointer:
8
,
position:
Offset
(
42
,
24
),
buttons:
kTertiaryButton
,
);
const
PointerUpEvent
up4
=
PointerUpEvent
(
pointer:
8
,
position:
Offset
(
43
,
23
),
);
void
main
(
)
{
TestWidgetsFlutterBinding
.
ensureInitialized
();
...
...
packages/flutter/test/gestures/multitap_test.dart
View file @
d5fbc375
...
...
@@ -7,9 +7,6 @@ import 'package:flutter_test/flutter_test.dart';
import
'gesture_tester.dart'
;
class
TestDrag
extends
Drag
{
}
void
main
(
)
{
TestWidgetsFlutterBinding
.
ensureInitialized
();
...
...
packages/flutter/test/material/chip_test.dart
View file @
d5fbc375
...
...
@@ -67,8 +67,6 @@ double getSelectProgress(WidgetTester tester) => getRenderChip(tester)?.checkmar
double
getAvatarDrawerProgress
(
WidgetTester
tester
)
=>
getRenderChip
(
tester
)?.
avatarDrawerAnimation
?.
value
as
double
;
// ignore: avoid_dynamic_calls
double
getDeleteDrawerProgress
(
WidgetTester
tester
)
=>
getRenderChip
(
tester
)?.
deleteDrawerAnimation
?.
value
as
double
;
// ignore: avoid_dynamic_calls
double
getEnableProgress
(
WidgetTester
tester
)
=>
getRenderChip
(
tester
)?.
enableAnimation
?.
value
as
double
;
/// Adds the basic requirements for a Chip.
Widget
wrapForChip
(
{
...
...
packages/flutter/test/material/chip_theme_test.dart
View file @
d5fbc375
...
...
@@ -27,16 +27,6 @@ Material getMaterial(WidgetTester tester) {
);
}
IconThemeData
getIconData
(
WidgetTester
tester
)
{
final
IconTheme
iconTheme
=
tester
.
firstWidget
(
find
.
descendant
(
of:
find
.
byType
(
RawChip
),
matching:
find
.
byType
(
IconTheme
),
),
);
return
iconTheme
.
data
;
}
DefaultTextStyle
getLabelStyle
(
WidgetTester
tester
)
{
return
tester
.
widget
(
find
.
descendant
(
...
...
packages/flutter/test/material/dropdown_test.dart
View file @
d5fbc375
...
...
@@ -252,29 +252,6 @@ void checkSelectedItemTextGeometry(WidgetTester tester, String value) {
expect
(
box0
.
size
,
equals
(
box1
.
size
));
}
void
verifyPaintedShadow
(
Finder
customPaint
,
int
elevation
)
{
const
Rect
originalRectangle
=
Rect
.
fromLTRB
(
0.0
,
0.0
,
800
,
208.0
);
final
List
<
BoxShadow
>
boxShadows
=
List
<
BoxShadow
>.
generate
(
3
,
(
int
index
)
=>
kElevationToShadow
[
elevation
]![
index
]);
final
List
<
RRect
>
rrects
=
List
<
RRect
>.
generate
(
3
,
(
int
index
)
{
return
RRect
.
fromRectAndRadius
(
originalRectangle
.
shift
(
boxShadows
[
index
].
offset
,
).
inflate
(
boxShadows
[
index
].
spreadRadius
),
const
Radius
.
circular
(
2.0
),
);
});
expect
(
customPaint
,
paints
..
save
()
..
rrect
(
rrect:
rrects
[
0
],
color:
boxShadows
[
0
].
color
,
hasMaskFilter:
true
)
..
rrect
(
rrect:
rrects
[
1
],
color:
boxShadows
[
1
].
color
,
hasMaskFilter:
true
)
..
rrect
(
rrect:
rrects
[
2
],
color:
boxShadows
[
2
].
color
,
hasMaskFilter:
true
),
);
}
Future
<
void
>
checkDropdownColor
(
WidgetTester
tester
,
{
Color
?
color
,
bool
isFormField
=
false
})
async
{
const
String
text
=
'foo'
;
await
tester
.
pumpWidget
(
...
...
@@ -325,12 +302,6 @@ Future<void> checkDropdownColor(WidgetTester tester, {Color? color, bool isFormF
);
}
bool
sameGeometry
(
RenderBox
box1
,
RenderBox
box2
)
{
expect
(
box1
.
localToGlobal
(
Offset
.
zero
),
equals
(
box2
.
localToGlobal
(
Offset
.
zero
)));
expect
(
box1
.
size
.
height
,
equals
(
box2
.
size
.
height
));
return
true
;
}
void
main
(
)
{
testWidgets
(
'Default dropdown golden'
,
(
WidgetTester
tester
)
async
{
final
Key
buttonKey
=
UniqueKey
();
...
...
packages/flutter/test/material/theme_defaults_test.dart
View file @
d5fbc375
...
...
@@ -5,9 +5,6 @@
import
'package:flutter/material.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
const
ShapeBorder
defaultButtonShape
=
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
2.0
)));
const
EdgeInsets
defaultButtonPadding
=
EdgeInsets
.
only
(
left:
16.0
,
right:
16.0
);
const
BoxConstraints
defaultButtonConstraints
=
BoxConstraints
(
minWidth:
88.0
,
minHeight:
36.0
);
const
Duration
defaultButtonDuration
=
Duration
(
milliseconds:
200
);
void
main
(
)
{
...
...
packages/flutter/test/painting/image_stream_test.dart
View file @
d5fbc375
...
...
@@ -79,24 +79,6 @@ class FakeEventReportingImageStreamCompleter extends ImageStreamCompleter {
}
}
class
SynchronousTestImageProvider
extends
ImageProvider
<
int
>
{
const
SynchronousTestImageProvider
(
this
.
image
);
final
Image
image
;
@override
Future
<
int
>
obtainKey
(
ImageConfiguration
configuration
)
{
return
SynchronousFuture
<
int
>(
1
);
}
@override
ImageStreamCompleter
load
(
int
key
,
DecoderCallback
decode
)
{
return
OneFrameImageStreamCompleter
(
SynchronousFuture
<
ImageInfo
>(
TestImageInfo
(
key
,
image:
image
)),
);
}
}
void
main
(
)
{
late
Image
image20x10
;
late
Image
image200x100
;
...
...
packages/flutter/test/rendering/editable_test.dart
View file @
d5fbc375
...
...
@@ -13,11 +13,6 @@ import 'package:flutter/gestures.dart';
import
'package:flutter/material.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter_test/flutter_test.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
;
import
'mock_canvas.dart'
;
import
'recording_canvas.dart'
;
...
...
@@ -55,38 +50,6 @@ class _FakeEditableTextState with TextSelectionDelegate {
void
copySelection
(
SelectionChangedCause
cause
)
{
}
}
@isTest
void
testVariants
(
String
description
,
AsyncValueGetter
<
void
>
callback
,
{
bool
?
skip
,
test_package
.
Timeout
?
timeout
,
TestVariant
<
Object
?>
variant
=
const
DefaultTestVariant
(),
dynamic
tags
,
})
{
assert
(
variant
!=
null
);
assert
(
variant
.
values
.
isNotEmpty
,
'There must be at least one value to test in the testing variant.'
);
for
(
final
dynamic
value
in
variant
.
values
)
{
final
String
variationDescription
=
variant
.
describeValue
(
value
);
final
String
combinedDescription
=
variationDescription
.
isNotEmpty
?
'
$description
(
$variationDescription
)'
:
description
;
test
(
combinedDescription
,
()
async
{
Object
?
memento
;
try
{
memento
=
await
variant
.
setUp
(
value
);
await
callback
();
}
finally
{
await
variant
.
tearDown
(
value
,
memento
);
}
},
skip:
skip
,
// [intended] just part of the API.
timeout:
timeout
,
tags:
tags
,
);
}
}
void
main
(
)
{
TestRenderingFlutterBinding
.
ensureInitialized
();
...
...
packages/flutter/test/widgets/custom_paint_test.dart
View file @
d5fbc375
...
...
@@ -21,21 +21,6 @@ class TestCustomPainter extends CustomPainter {
bool
shouldRepaint
(
TestCustomPainter
oldPainter
)
=>
true
;
}
class
TestCustomPainterWithCustomSemanticsBuilder
extends
TestCustomPainter
{
TestCustomPainterWithCustomSemanticsBuilder
()
:
super
(
log:
<
String
>[]);
@override
SemanticsBuilderCallback
get
semanticsBuilder
=>
(
Size
size
)
{
const
Key
key
=
Key
(
'0'
);
const
Rect
rect
=
Rect
.
zero
;
const
SemanticsProperties
semanticsProperties
=
SemanticsProperties
();
return
<
CustomPainterSemantics
>[
const
CustomPainterSemantics
(
key:
key
,
rect:
rect
,
properties:
semanticsProperties
),
const
CustomPainterSemantics
(
key:
key
,
rect:
rect
,
properties:
semanticsProperties
),
];
};
}
class
MockCanvas
extends
Fake
implements
Canvas
{
int
saveCount
=
0
;
int
saveCountDelta
=
1
;
...
...
packages/flutter/test/widgets/layout_builder_and_parent_data_test.dart
View file @
d5fbc375
...
...
@@ -41,20 +41,6 @@ class SizeChangerState extends State<SizeChanger> {
}
}
class
Wrapper
extends
StatelessWidget
{
const
Wrapper
({
super
.
key
,
required
this
.
child
,
});
final
Widget
child
;
@override
Widget
build
(
BuildContext
context
)
{
return
child
;
}
}
void
main
(
)
{
testWidgets
(
'Applying parent data inside a LayoutBuilder'
,
(
WidgetTester
tester
)
async
{
int
frame
=
1
;
...
...
packages/flutter/test/widgets/multichild_test.dart
View file @
d5fbc375
...
...
@@ -31,16 +31,6 @@ void checkTree(WidgetTester tester, List<BoxDecoration> expectedDecorations) {
}
}
class
MockMultiChildRenderObjectWidget
extends
MultiChildRenderObjectWidget
{
MockMultiChildRenderObjectWidget
({
super
.
key
,
required
super
.
children
});
@override
RenderObject
createRenderObject
(
BuildContext
context
)
{
assert
(
false
);
return
FakeRenderObject
();
}
}
void
main
(
)
{
testWidgets
(
'MultiChildRenderObjectElement control test'
,
(
WidgetTester
tester
)
async
{
...
...
@@ -357,13 +347,6 @@ void main() {
});
}
class
FakeRenderObject
extends
RenderBox
{
@override
void
performLayout
()
{
size
=
constraints
.
biggest
;
}
}
class
DummyWidget
extends
StatelessWidget
{
const
DummyWidget
({
super
.
key
,
required
this
.
child
});
...
...
packages/flutter/test/widgets/route_notification_messages_test.dart
View file @
d5fbc375
...
...
@@ -29,13 +29,6 @@ class OnTapPage extends StatelessWidget {
}
}
Map
<
String
,
dynamic
>
convertRouteInformationToMap
(
RouteInformation
routeInformation
)
{
return
<
String
,
dynamic
>{
'location'
:
routeInformation
.
location
,
'state'
:
routeInformation
.
state
,
};
}
void
main
(
)
{
testWidgets
(
'Push and Pop should send platform messages'
,
(
WidgetTester
tester
)
async
{
final
Map
<
String
,
WidgetBuilder
>
routes
=
<
String
,
WidgetBuilder
>{
...
...
packages/flutter/test/widgets/routes_test.dart
View file @
d5fbc375
...
...
@@ -2296,50 +2296,6 @@ class WidgetWithNoLocalHistoryState extends State<WidgetWithNoLocalHistory> {
}
}
class
TransitionDetector
extends
DefaultTransitionDelegate
<
void
>
{
bool
hasTransition
=
false
;
@override
Iterable
<
RouteTransitionRecord
>
resolve
({
required
List
<
RouteTransitionRecord
>
newPageRouteHistory
,
required
Map
<
RouteTransitionRecord
?,
RouteTransitionRecord
>
locationToExitingPageRoute
,
required
Map
<
RouteTransitionRecord
?,
List
<
RouteTransitionRecord
>>
pageRouteToPagelessRoutes
,
})
{
hasTransition
=
true
;
return
super
.
resolve
(
newPageRouteHistory:
newPageRouteHistory
,
locationToExitingPageRoute:
locationToExitingPageRoute
,
pageRouteToPagelessRoutes:
pageRouteToPagelessRoutes
,
);
}
}
Widget
buildNavigator
(
{
required
List
<
Page
<
dynamic
>>
pages
,
required
PopPageCallback
onPopPage
,
GlobalKey
<
NavigatorState
>?
key
,
TransitionDelegate
<
dynamic
>?
transitionDelegate
,
})
{
return
MediaQuery
(
data:
MediaQueryData
.
fromWindow
(
WidgetsBinding
.
instance
.
window
),
child:
Localizations
(
locale:
const
Locale
(
'en'
,
'US'
),
delegates:
const
<
LocalizationsDelegate
<
dynamic
>>[
DefaultMaterialLocalizations
.
delegate
,
DefaultWidgetsLocalizations
.
delegate
,
],
child:
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
Navigator
(
key:
key
,
pages:
pages
,
onPopPage:
onPopPage
,
transitionDelegate:
transitionDelegate
??
const
DefaultTransitionDelegate
<
dynamic
>(),
),
),
),
);
}
class
_RestorableDialogTestWidget
extends
StatelessWidget
{
static
Route
<
Object
?>
_dialogBuilder
(
BuildContext
context
,
Object
?
arguments
)
{
return
RawDialogRoute
<
void
>(
...
...
packages/flutter/test/widgets/scrollable_semantics_test.dart
View file @
d5fbc375
...
...
@@ -643,10 +643,6 @@ Future<void> flingUp(WidgetTester tester, { int repetitions = 1 }) => fling(test
Future
<
void
>
flingDown
(
WidgetTester
tester
,
{
int
repetitions
=
1
})
=>
fling
(
tester
,
const
Offset
(
0.0
,
200.0
),
repetitions
);
Future
<
void
>
flingRight
(
WidgetTester
tester
,
{
int
repetitions
=
1
})
=>
fling
(
tester
,
const
Offset
(
200.0
,
0.0
),
repetitions
);
Future
<
void
>
flingLeft
(
WidgetTester
tester
,
{
int
repetitions
=
1
})
=>
fling
(
tester
,
const
Offset
(-
200.0
,
0.0
),
repetitions
);
Future
<
void
>
fling
(
WidgetTester
tester
,
Offset
offset
,
int
repetitions
)
async
{
while
(
repetitions
--
>
0
)
{
await
tester
.
fling
(
find
.
byType
(
ListView
),
offset
,
1000.0
);
...
...
packages/flutter/test/widgets/selectable_region_test.dart
View file @
d5fbc375
...
...
@@ -1041,95 +1041,3 @@ class RenderSelectionSpy extends RenderProxyBox
@override
void
pushHandleLayers
(
LayerLink
?
startHandle
,
LayerLink
?
endHandle
)
{
}
}
class
TextTextSelectionControls
extends
TextSelectionControls
{
static
final
UniqueKey
leftHandle
=
UniqueKey
();
static
final
UniqueKey
rightHandle
=
UniqueKey
();
static
final
UniqueKey
toolbar
=
UniqueKey
();
@override
Size
getHandleSize
(
double
textLineHeight
)
=>
Size
(
textLineHeight
,
textLineHeight
);
@override
Widget
buildToolbar
(
BuildContext
context
,
Rect
globalEditableRegion
,
double
textLineHeight
,
Offset
selectionMidpoint
,
List
<
TextSelectionPoint
>
endpoints
,
TextSelectionDelegate
delegate
,
ClipboardStatusNotifier
?
clipboardStatus
,
Offset
?
lastSecondaryTapDownPosition
,
)
{
return
TestToolbar
(
key:
toolbar
,
globalEditableRegion:
globalEditableRegion
,
textLineHeight:
textLineHeight
,
selectionMidpoint:
selectionMidpoint
,
endpoints:
endpoints
,
delegate:
delegate
,
clipboardStatus:
clipboardStatus
,
lastSecondaryTapDownPosition:
lastSecondaryTapDownPosition
,
);
}
@override
Widget
buildHandle
(
BuildContext
context
,
TextSelectionHandleType
type
,
double
textHeight
,
[
VoidCallback
?
onTap
])
{
return
TestHandle
(
key:
type
==
TextSelectionHandleType
.
left
?
leftHandle
:
rightHandle
,
type:
type
,
textHeight:
textHeight
,
);
}
@override
Offset
getHandleAnchor
(
TextSelectionHandleType
type
,
double
textLineHeight
)
{
return
Offset
.
zero
;
}
@override
bool
canSelectAll
(
TextSelectionDelegate
delegate
)
=>
true
;
}
class
TestHandle
extends
StatelessWidget
{
const
TestHandle
({
super
.
key
,
required
this
.
type
,
required
this
.
textHeight
,
});
final
TextSelectionHandleType
type
;
final
double
textHeight
;
@override
Widget
build
(
BuildContext
context
)
{
return
SizedBox
(
width:
textHeight
,
height:
textHeight
);
}
}
class
TestToolbar
extends
StatelessWidget
{
const
TestToolbar
({
super
.
key
,
required
this
.
globalEditableRegion
,
required
this
.
textLineHeight
,
required
this
.
selectionMidpoint
,
required
this
.
endpoints
,
required
this
.
delegate
,
required
this
.
clipboardStatus
,
required
this
.
lastSecondaryTapDownPosition
,
});
final
Rect
globalEditableRegion
;
final
double
textLineHeight
;
final
Offset
selectionMidpoint
;
final
List
<
TextSelectionPoint
>
endpoints
;
final
TextSelectionDelegate
delegate
;
final
ClipboardStatusNotifier
?
clipboardStatus
;
final
Offset
?
lastSecondaryTapDownPosition
;
@override
Widget
build
(
BuildContext
context
)
{
return
SizedBox
(
width:
textLineHeight
,
height:
textLineHeight
);
}
}
packages/flutter/test/widgets/selectable_text_test.dart
View file @
d5fbc375
...
...
@@ -103,15 +103,6 @@ Future<void> skipPastScrollingAnimation(WidgetTester tester) async {
await
tester
.
pump
(
const
Duration
(
milliseconds:
200
));
}
double
getOpacity
(
WidgetTester
tester
,
Finder
finder
)
{
return
tester
.
widget
<
FadeTransition
>(
find
.
ancestor
(
of:
finder
,
matching:
find
.
byType
(
FadeTransition
),
),
).
opacity
.
value
;
}
void
main
(
)
{
TestWidgetsFlutterBinding
.
ensureInitialized
();
final
MockClipboard
mockClipboard
=
MockClipboard
();
...
...
packages/flutter/test/widgets/shortcuts_test.dart
View file @
d5fbc375
...
...
@@ -1737,8 +1737,6 @@ class _TestCallbackRegistrationState extends State<TestCallbackRegistration> {
}
}
typedef
PostInvokeCallback
=
void
Function
({
Action
<
Intent
>
action
,
Intent
intent
,
BuildContext
?
context
,
ActionDispatcher
dispatcher
});
class
TestAction
extends
CallbackAction
<
Intent
>
{
TestAction
({
required
super
.
onInvoke
,
...
...
@@ -1747,19 +1745,6 @@ class TestAction extends CallbackAction<Intent> {
static
const
LocalKey
key
=
ValueKey
<
Type
>(
TestAction
);
}
class
TestDispatcher
extends
ActionDispatcher
{
const
TestDispatcher
({
this
.
postInvoke
});
final
PostInvokeCallback
?
postInvoke
;
@override
Object
?
invokeAction
(
Action
<
TestIntent
>
action
,
Intent
intent
,
[
BuildContext
?
context
])
{
final
Object
?
result
=
super
.
invokeAction
(
action
,
intent
,
context
);
postInvoke
?.
call
(
action:
action
,
intent:
intent
,
context:
context
,
dispatcher:
this
);
return
result
;
}
}
/// An activator that accepts down events that has [key] as the logical key.
///
/// This class is used only to tests. It is intentionally designed poorly by
...
...
packages/flutter/test/widgets/slivers_evil_test.dart
View file @
d5fbc375
...
...
@@ -56,21 +56,6 @@ class TestScrollPhysics extends ClampingScrollPhysics {
Tolerance
get
tolerance
=>
const
Tolerance
(
velocity:
20.0
,
distance:
1.0
);
}
class
TestViewportScrollPosition
extends
ScrollPositionWithSingleContext
{
TestViewportScrollPosition
({
required
super
.
physics
,
required
super
.
context
,
super
.
oldPosition
,
});
@override
bool
applyContentDimensions
(
double
minScrollExtent
,
double
maxScrollExtent
)
{
expect
(
minScrollExtent
,
moreOrLessEquals
(-
3895.0
));
expect
(
maxScrollExtent
,
moreOrLessEquals
(
8575.0
));
return
super
.
applyContentDimensions
(
minScrollExtent
,
maxScrollExtent
);
}
}
void
main
(
)
{
testWidgets
(
'Evil test of sliver features - 1'
,
(
WidgetTester
tester
)
async
{
final
GlobalKey
centerKey
=
GlobalKey
();
...
...
packages/flutter/test/widgets/text_selection_test.dart
View file @
d5fbc375
...
...
@@ -1426,37 +1426,6 @@ class FakeRenderEditable extends RenderEditable {
bool
hasFocus
=
false
;
}
class
CustomTextSelectionControls
extends
TextSelectionControls
{
@override
Widget
buildHandle
(
BuildContext
context
,
TextSelectionHandleType
type
,
double
textLineHeight
,
[
VoidCallback
?
onTap
])
{
throw
UnimplementedError
();
}
@override
Widget
buildToolbar
(
BuildContext
context
,
Rect
globalEditableRegion
,
double
textLineHeight
,
Offset
position
,
List
<
TextSelectionPoint
>
endpoints
,
TextSelectionDelegate
delegate
,
ClipboardStatusNotifier
?
clipboardStatus
,
Offset
?
lastSecondaryTapDownPosition
,
)
{
throw
UnimplementedError
();
}
@override
Offset
getHandleAnchor
(
TextSelectionHandleType
type
,
double
textLineHeight
)
{
throw
UnimplementedError
();
}
@override
Size
getHandleSize
(
double
textLineHeight
)
{
throw
UnimplementedError
();
}
}
class
TextSelectionControlsSpy
extends
TextSelectionControls
{
UniqueKey
leftHandleKey
=
UniqueKey
();
UniqueKey
rightHandleKey
=
UniqueKey
();
...
...
packages/flutter/test/widgets/widget_inspector_test.dart
View file @
d5fbc375
...
...
@@ -14,7 +14,6 @@
@TestOn
(
'!chrome'
)
import
'dart:async'
;
import
'dart:convert'
;
import
'dart:math'
;
import
'dart:ui'
as
ui
;
...
...
@@ -160,8 +159,6 @@ class _CreationLocation {
String
?
name
;
}
typedef
InspectorServiceExtensionCallback
=
FutureOr
<
Map
<
String
,
Object
>>
Function
(
Map
<
String
,
String
>
parameters
);
class
RenderRepaintBoundaryWithDebugPaint
extends
RenderRepaintBoundary
{
@override
void
debugPaintSize
(
PaintingContext
context
,
Offset
offset
)
{
...
...
@@ -1999,7 +1996,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
_CreationLocation
location
=
knownLocations
[
id
]!;
expect
(
location
.
file
,
equals
(
file
));
// ClockText widget.
expect
(
location
.
line
,
equals
(
6
4
));
expect
(
location
.
line
,
equals
(
6
3
));
expect
(
location
.
column
,
equals
(
9
));
expect
(
location
.
name
,
equals
(
'ClockText'
));
expect
(
count
,
equals
(
1
));
...
...
@@ -2009,7 +2006,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
location
=
knownLocations
[
id
]!;
expect
(
location
.
file
,
equals
(
file
));
// Text widget in _ClockTextState build method.
expect
(
location
.
line
,
equals
(
10
2
));
expect
(
location
.
line
,
equals
(
10
1
));
expect
(
location
.
column
,
equals
(
12
));
expect
(
location
.
name
,
equals
(
'Text'
));
expect
(
count
,
equals
(
1
));
...
...
@@ -2036,7 +2033,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
location
=
knownLocations
[
id
]!;
expect
(
location
.
file
,
equals
(
file
));
// ClockText widget.
expect
(
location
.
line
,
equals
(
6
4
));
expect
(
location
.
line
,
equals
(
6
3
));
expect
(
location
.
column
,
equals
(
9
));
expect
(
location
.
name
,
equals
(
'ClockText'
));
expect
(
count
,
equals
(
3
));
// 3 clock widget instances rebuilt.
...
...
@@ -2046,7 +2043,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
location
=
knownLocations
[
id
]!;
expect
(
location
.
file
,
equals
(
file
));
// Text widget in _ClockTextState build method.
expect
(
location
.
line
,
equals
(
10
2
));
expect
(
location
.
line
,
equals
(
10
1
));
expect
(
location
.
column
,
equals
(
12
));
expect
(
location
.
name
,
equals
(
'Text'
));
expect
(
count
,
equals
(
3
));
// 3 clock widget instances rebuilt.
...
...
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