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
55b6f049
Unverified
Commit
55b6f049
authored
Jul 06, 2023
by
Michael Goderbauer
Committed by
GitHub
Jul 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable unreachable_from_main lint - it is stable now!!1 (#129854)
PLUS: clean-up of all the unreachable stuff.
parent
99cb18b1
Changes
45
Show whitespace changes
Inline
Side-by-side
Showing
45 changed files
with
66 additions
and
419 deletions
+66
-419
analysis_options.yaml
analysis_options.yaml
+1
-1
compute_bench.dart
...enchmarks/microbenchmarks/lib/language/compute_bench.dart
+3
-2
main.dart
dev/benchmarks/platform_views_layout/lib/main.dart
+0
-7
main_non_intersecting.dart
...arks/platform_views_layout/lib/main_non_intersecting.dart
+0
-7
main.dart
...ks/platform_views_layout_hybrid_composition/lib/main.dart
+0
-7
url_strategy_integration.dart
...s/web_e2e_tests/test_driver/url_strategy_integration.dart
+0
-17
actions.dart
dev/manual_tests/lib/actions.dart
+3
-33
density.dart
dev/manual_tests/lib/density.dart
+2
-10
menu_anchor.dart
dev/manual_tests/lib/menu_anchor.dart
+0
-5
examples_smoke_test.dart
dev/tools/examples_smoke_test.dart
+1
-2
analysis_options.yaml
examples/api/analysis_options.yaml
+2
-0
isolates_test.dart
packages/flutter/test/foundation/isolates_test.dart
+1
-0
menu_anchor_test.dart
packages/flutter/test/material/menu_anchor_test.dart
+0
-5
image_stream_test.dart
packages/flutter/test/painting/image_stream_test.dart
+0
-2
semantics_update_test.dart
packages/flutter/test/semantics/semantics_update_test.dart
+0
-72
asset_manifest_test.dart
packages/flutter/test/services/asset_manifest_test.dart
+0
-28
async_lifecycle_test.dart
packages/flutter/test/widgets/async_lifecycle_test.dart
+6
-6
automatic_keep_alive_test.dart
packages/flutter/test/widgets/automatic_keep_alive_test.dart
+1
-25
fade_in_image_test.dart
packages/flutter/test/widgets/fade_in_image_test.dart
+0
-10
mark_needs_build_test.dart
packages/flutter/test/widgets/mark_needs_build_test.dart
+1
-1
render_object_element_test.dart
...ages/flutter/test/widgets/render_object_element_test.dart
+12
-12
reparent_state_harder_test.dart
...ages/flutter/test/widgets/reparent_state_harder_test.dart
+0
-2
router_test.dart
packages/flutter/test/widgets/router_test.dart
+0
-8
selectable_region_context_menu_test.dart
...ter/test/widgets/selectable_region_context_menu_test.dart
+1
-12
selectable_region_test.dart
packages/flutter/test/widgets/selectable_region_test.dart
+1
-11
semantics_10_test.dart
packages/flutter/test/widgets/semantics_10_test.dart
+3
-3
semantics_child_configs_delegate_test.dart
...r/test/widgets/semantics_child_configs_delegate_test.dart
+1
-1
shortcuts_test.dart
packages/flutter/test/widgets/shortcuts_test.dart
+1
-9
slivers_keepalive_test.dart
packages/flutter/test/widgets/slivers_keepalive_test.dart
+9
-11
snapshot_widget_test.dart
packages/flutter/test/widgets/snapshot_widget_test.dart
+0
-4
test_private.dart
packages/flutter/test_private/bin/test_private.dart
+7
-1
window_test.dart
packages/flutter_test/test/window_test.dart
+0
-1
xcode_backend.dart
packages/flutter_tools/bin/xcode_backend.dart
+0
-5
attach_test.dart
...utter_tools/test/commands.shard/hermetic/attach_test.dart
+2
-14
create_usage_test.dart
...tools/test/commands.shard/hermetic/create_usage_test.dart
+1
-3
doctor_test.dart
...utter_tools/test/commands.shard/hermetic/doctor_test.dart
+0
-35
run_test.dart
.../flutter_tools/test/commands.shard/hermetic/run_test.dart
+1
-3
android_project_migration_test.dart
...general.shard/android/android_project_migration_test.dart
+0
-8
android_sdk_test.dart
...er_tools/test/general.shard/android/android_sdk_test.dart
+0
-12
artifact_updater_test.dart
...utter_tools/test/general.shard/artifact_updater_test.dart
+2
-5
simulators_test.dart
...flutter_tools/test/general.shard/ios/simulators_test.dart
+2
-3
terminal_handler_test.dart
...utter_tools/test/general.shard/terminal_handler_test.dart
+0
-1
devfs_web_test.dart
.../flutter_tools/test/general.shard/web/devfs_web_test.dart
+1
-3
devices_test.dart
...es/flutter_tools/test/general.shard/web/devices_test.dart
+1
-7
xcode_backend_test.dart
.../flutter_tools/test/general.shard/xcode_backend_test.dart
+0
-5
No files found.
analysis_options.yaml
View file @
55b6f049
...
@@ -223,7 +223,7 @@ linter:
...
@@ -223,7 +223,7 @@ linter:
-
unnecessary_string_interpolations
-
unnecessary_string_interpolations
-
unnecessary_this
-
unnecessary_this
-
unnecessary_to_list_in_spreads
-
unnecessary_to_list_in_spreads
# - unreachable_from_main # Do not enable this rule until it is un-marked as "experimental" and carefully re-evaluated.
-
unreachable_from_main
-
unrelated_type_equality_checks
-
unrelated_type_equality_checks
-
unsafe_html
-
unsafe_html
-
use_build_context_synchronously
-
use_build_context_synchronously
...
...
dev/benchmarks/microbenchmarks/lib/language/compute_bench.dart
View file @
55b6f049
...
@@ -12,9 +12,10 @@ const int _kNumWarmUp = 100;
...
@@ -12,9 +12,10 @@ const int _kNumWarmUp = 100;
class
Data
{
class
Data
{
Data
(
this
.
value
);
Data
(
this
.
value
);
Map
<
String
,
dynamic
>
toJson
()
=>
<
String
,
dynamic
>{
'value'
:
value
};
final
int
value
;
final
int
value
;
@override
String
toString
()
=>
'Data(
$value
)'
;
}
}
List
<
Data
>
test
(
int
length
)
{
List
<
Data
>
test
(
int
length
)
{
...
...
dev/benchmarks/platform_views_layout/lib/main.dart
View file @
55b6f049
...
@@ -5,7 +5,6 @@
...
@@ -5,7 +5,6 @@
import
'dart:io'
;
import
'dart:io'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/scheduler.dart'
show
timeDilation
;
void
main
(
)
{
void
main
(
)
{
runApp
(
runApp
(
...
@@ -31,12 +30,6 @@ class PlatformViewAppState extends State<PlatformViewApp> {
...
@@ -31,12 +30,6 @@ class PlatformViewAppState extends State<PlatformViewApp> {
home:
const
PlatformViewLayout
(),
home:
const
PlatformViewLayout
(),
);
);
}
}
void
toggleAnimationSpeed
()
{
setState
(()
{
timeDilation
=
(
timeDilation
!=
1.0
)
?
1.0
:
5.0
;
});
}
}
}
class
PlatformViewLayout
extends
StatelessWidget
{
class
PlatformViewLayout
extends
StatelessWidget
{
...
...
dev/benchmarks/platform_views_layout/lib/main_non_intersecting.dart
View file @
55b6f049
...
@@ -5,7 +5,6 @@
...
@@ -5,7 +5,6 @@
import
'dart:io'
;
import
'dart:io'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/scheduler.dart'
show
timeDilation
;
void
main
(
)
{
void
main
(
)
{
runApp
(
runApp
(
...
@@ -31,12 +30,6 @@ class PlatformViewAppState extends State<PlatformViewApp> {
...
@@ -31,12 +30,6 @@ class PlatformViewAppState extends State<PlatformViewApp> {
home:
const
PlatformViewLayout
(),
home:
const
PlatformViewLayout
(),
);
);
}
}
void
toggleAnimationSpeed
()
{
setState
(()
{
timeDilation
=
(
timeDilation
!=
1.0
)
?
1.0
:
5.0
;
});
}
}
}
class
PlatformViewLayout
extends
StatelessWidget
{
class
PlatformViewLayout
extends
StatelessWidget
{
...
...
dev/benchmarks/platform_views_layout_hybrid_composition/lib/main.dart
View file @
55b6f049
...
@@ -5,7 +5,6 @@
...
@@ -5,7 +5,6 @@
import
'dart:io'
;
import
'dart:io'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/scheduler.dart'
show
timeDilation
;
import
'package:flutter_driver/driver_extension.dart'
;
import
'package:flutter_driver/driver_extension.dart'
;
import
'android_platform_view.dart'
;
import
'android_platform_view.dart'
;
...
@@ -35,12 +34,6 @@ class PlatformViewAppState extends State<PlatformViewApp> {
...
@@ -35,12 +34,6 @@ class PlatformViewAppState extends State<PlatformViewApp> {
home:
const
PlatformViewLayout
(),
home:
const
PlatformViewLayout
(),
);
);
}
}
void
toggleAnimationSpeed
()
{
setState
(()
{
timeDilation
=
(
timeDilation
!=
1.0
)
?
1.0
:
5.0
;
});
}
}
}
class
PlatformViewLayout
extends
StatelessWidget
{
class
PlatformViewLayout
extends
StatelessWidget
{
...
...
dev/integration_tests/web_e2e_tests/test_driver/url_strategy_integration.dart
View file @
55b6f049
...
@@ -46,11 +46,6 @@ void main() {
...
@@ -46,11 +46,6 @@ void main() {
/// It keeps a list of history entries and event listeners in memory and
/// It keeps a list of history entries and event listeners in memory and
/// manipulates them in order to achieve the desired functionality.
/// manipulates them in order to achieve the desired functionality.
class
TestUrlStrategy
extends
UrlStrategy
{
class
TestUrlStrategy
extends
UrlStrategy
{
/// Creates a instance of [TestUrlStrategy] with an empty string as the
/// path.
factory
TestUrlStrategy
()
=>
TestUrlStrategy
.
fromEntry
(
const
TestHistoryEntry
(
null
,
null
,
''
));
/// Creates an instance of [TestUrlStrategy] and populates it with a list
/// Creates an instance of [TestUrlStrategy] and populates it with a list
/// that has [initialEntry] as the only item.
/// that has [initialEntry] as the only item.
TestUrlStrategy
.
fromEntry
(
TestHistoryEntry
initialEntry
)
TestUrlStrategy
.
fromEntry
(
TestHistoryEntry
initialEntry
)
...
@@ -64,8 +59,6 @@ class TestUrlStrategy extends UrlStrategy {
...
@@ -64,8 +59,6 @@ class TestUrlStrategy extends UrlStrategy {
dynamic
getState
()
=>
currentEntry
.
state
;
dynamic
getState
()
=>
currentEntry
.
state
;
int
_currentEntryIndex
;
int
_currentEntryIndex
;
int
get
currentEntryIndex
=>
_currentEntryIndex
;
final
List
<
TestHistoryEntry
>
history
;
final
List
<
TestHistoryEntry
>
history
;
TestHistoryEntry
get
currentEntry
{
TestHistoryEntry
get
currentEntry
{
...
@@ -105,16 +98,6 @@ class TestUrlStrategy extends UrlStrategy {
...
@@ -105,16 +98,6 @@ class TestUrlStrategy extends UrlStrategy {
currentEntry
=
TestHistoryEntry
(
state
,
title
,
url
);
currentEntry
=
TestHistoryEntry
(
state
,
title
,
url
);
}
}
/// This simulates the case where a user types in a url manually. It causes
/// a new state to be pushed, and all event listeners will be invoked.
Future
<
void
>
simulateUserTypingUrl
(
String
url
)
{
assert
(
withinAppHistory
);
return
_nextEventLoop
(()
{
pushState
(
null
,
''
,
url
);
_firePopStateEvent
();
});
}
@override
@override
Future
<
void
>
go
(
int
count
)
{
Future
<
void
>
go
(
int
count
)
{
assert
(
withinAppHistory
);
assert
(
withinAppHistory
);
...
...
dev/manual_tests/lib/actions.dart
View file @
55b6f049
...
@@ -56,13 +56,6 @@ class Memento extends Object with Diagnosticable {
...
@@ -56,13 +56,6 @@ class Memento extends Object with Diagnosticable {
/// An [ActionDispatcher] subclass that manages the invocation of undoable
/// An [ActionDispatcher] subclass that manages the invocation of undoable
/// actions.
/// actions.
class
UndoableActionDispatcher
extends
ActionDispatcher
implements
Listenable
{
class
UndoableActionDispatcher
extends
ActionDispatcher
implements
Listenable
{
/// Constructs a new [UndoableActionDispatcher].
///
/// The [maxUndoLevels] argument must not be null.
UndoableActionDispatcher
({
int
maxUndoLevels
=
_defaultMaxUndoLevels
,
})
:
_maxUndoLevels
=
maxUndoLevels
;
// A stack of actions that have been performed. The most recent action
// A stack of actions that have been performed. The most recent action
// performed is at the end of the list.
// performed is at the end of the list.
final
DoubleLinkedQueue
<
Memento
>
_completedActions
=
DoubleLinkedQueue
<
Memento
>();
final
DoubleLinkedQueue
<
Memento
>
_completedActions
=
DoubleLinkedQueue
<
Memento
>();
...
@@ -70,19 +63,12 @@ class UndoableActionDispatcher extends ActionDispatcher implements Listenable {
...
@@ -70,19 +63,12 @@ class UndoableActionDispatcher extends ActionDispatcher implements Listenable {
// at the end of the list.
// at the end of the list.
final
List
<
Memento
>
_undoneActions
=
<
Memento
>[];
final
List
<
Memento
>
_undoneActions
=
<
Memento
>[];
static
const
int
_defaultMaxUndoLevels
=
1000
;
/// The maximum number of undo levels allowed.
/// The maximum number of undo levels allowed.
///
///
/// If this value is set to a value smaller than the number of completed
/// If this value is set to a value smaller than the number of completed
/// actions, then the stack of completed actions is truncated to only include
/// actions, then the stack of completed actions is truncated to only include
/// the last [maxUndoLevels] actions.
/// the last [maxUndoLevels] actions.
int
get
maxUndoLevels
=>
_maxUndoLevels
;
int
get
maxUndoLevels
=>
1000
;
int
_maxUndoLevels
;
set
maxUndoLevels
(
int
value
)
{
_maxUndoLevels
=
value
;
_pruneActions
();
}
final
Set
<
VoidCallback
>
_listeners
=
<
VoidCallback
>{};
final
Set
<
VoidCallback
>
_listeners
=
<
VoidCallback
>{};
...
@@ -121,7 +107,7 @@ class UndoableActionDispatcher extends ActionDispatcher implements Listenable {
...
@@ -121,7 +107,7 @@ class UndoableActionDispatcher extends ActionDispatcher implements Listenable {
// Enforces undo level limit.
// Enforces undo level limit.
void
_pruneActions
()
{
void
_pruneActions
()
{
while
(
_completedActions
.
length
>
_
maxUndoLevels
)
{
while
(
_completedActions
.
length
>
maxUndoLevels
)
{
_completedActions
.
removeFirst
();
_completedActions
.
removeFirst
();
}
}
}
}
...
@@ -237,26 +223,12 @@ class RedoAction extends Action<RedoIntent> {
...
@@ -237,26 +223,12 @@ class RedoAction extends Action<RedoIntent> {
}
}
/// An action that can be undone.
/// An action that can be undone.
abstract
class
UndoableAction
<
T
extends
Intent
>
extends
Action
<
T
>
{
abstract
class
UndoableAction
<
T
extends
Intent
>
extends
Action
<
T
>
{
}
/// The [Intent] this action was originally invoked with.
Intent
?
get
invocationIntent
=>
_invocationTag
;
Intent
?
_invocationTag
;
@protected
set
invocationIntent
(
Intent
?
value
)
=>
_invocationTag
=
value
;
@override
@mustCallSuper
void
invoke
(
T
intent
)
{
invocationIntent
=
intent
;
}
}
class
UndoableFocusActionBase
<
T
extends
Intent
>
extends
UndoableAction
<
T
>
{
class
UndoableFocusActionBase
<
T
extends
Intent
>
extends
UndoableAction
<
T
>
{
@override
@override
@mustCallSuper
@mustCallSuper
Memento
invoke
(
T
intent
)
{
Memento
invoke
(
T
intent
)
{
super
.
invoke
(
intent
);
final
FocusNode
?
previousFocus
=
primaryFocus
;
final
FocusNode
?
previousFocus
=
primaryFocus
;
return
Memento
(
name:
previousFocus
!.
debugLabel
!,
undo:
()
{
return
Memento
(
name:
previousFocus
!.
debugLabel
!,
undo:
()
{
previousFocus
.
requestFocus
();
previousFocus
.
requestFocus
();
...
@@ -295,8 +267,6 @@ class UndoablePreviousFocusAction extends UndoableFocusActionBase<PreviousFocusI
...
@@ -295,8 +267,6 @@ class UndoablePreviousFocusAction extends UndoableFocusActionBase<PreviousFocusI
}
}
class
UndoableDirectionalFocusAction
extends
UndoableFocusActionBase
<
DirectionalFocusIntent
>
{
class
UndoableDirectionalFocusAction
extends
UndoableFocusActionBase
<
DirectionalFocusIntent
>
{
TraversalDirection
?
direction
;
@override
@override
Memento
invoke
(
DirectionalFocusIntent
intent
)
{
Memento
invoke
(
DirectionalFocusIntent
intent
)
{
final
Memento
memento
=
super
.
invoke
(
intent
);
final
Memento
memento
=
super
.
invoke
(
intent
);
...
...
dev/manual_tests/lib/density.dart
View file @
55b6f049
...
@@ -30,15 +30,13 @@ class MyApp extends StatelessWidget {
...
@@ -30,15 +30,13 @@ class MyApp extends StatelessWidget {
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
const
MaterialApp
(
return
const
MaterialApp
(
title:
_title
,
title:
_title
,
home:
MyHomePage
(
title:
_title
),
home:
MyHomePage
(),
);
);
}
}
}
}
class
MyHomePage
extends
StatefulWidget
{
class
MyHomePage
extends
StatefulWidget
{
const
MyHomePage
({
super
.
key
,
required
this
.
title
});
const
MyHomePage
({
super
.
key
});
final
String
title
;
@override
@override
State
<
MyHomePage
>
createState
()
=>
_MyHomePageState
();
State
<
MyHomePage
>
createState
()
=>
_MyHomePageState
();
...
@@ -92,12 +90,6 @@ class OptionModel extends ChangeNotifier {
...
@@ -92,12 +90,6 @@ class OptionModel extends ChangeNotifier {
bool
get
longText
=>
_longText
;
bool
get
longText
=>
_longText
;
bool
_longText
=
false
;
bool
_longText
=
false
;
set
longText
(
bool
longText
)
{
if
(
longText
!=
_longText
)
{
_longText
=
longText
;
notifyListeners
();
}
}
void
reset
()
{
void
reset
()
{
final
OptionModel
defaultModel
=
OptionModel
();
final
OptionModel
defaultModel
=
OptionModel
();
...
...
dev/manual_tests/lib/menu_anchor.dart
View file @
55b6f049
...
@@ -778,9 +778,4 @@ enum TestMenu {
...
@@ -778,9 +778,4 @@ enum TestMenu {
final
String
acceleratorLabel
;
final
String
acceleratorLabel
;
// Strip the accelerator markers.
// Strip the accelerator markers.
String
get
label
=>
MenuAcceleratorLabel
.
stripAcceleratorMarkers
(
acceleratorLabel
);
String
get
label
=>
MenuAcceleratorLabel
.
stripAcceleratorMarkers
(
acceleratorLabel
);
int
get
acceleratorIndex
{
int
index
=
-
1
;
MenuAcceleratorLabel
.
stripAcceleratorMarkers
(
acceleratorLabel
,
setIndex:
(
int
i
)
=>
index
=
i
);
return
index
;
}
}
}
dev/tools/examples_smoke_test.dart
View file @
55b6f049
...
@@ -81,13 +81,12 @@ Future<void> runSmokeTests({
...
@@ -81,13 +81,12 @@ Future<void> runSmokeTests({
// A class to hold information related to an example, used to generate names
// A class to hold information related to an example, used to generate names
// from for the tests.
// from for the tests.
class
ExampleInfo
{
class
ExampleInfo
{
ExampleInfo
(
this
.
file
,
Directory
examplesLibDir
)
ExampleInfo
(
File
file
,
Directory
examplesLibDir
)
:
importPath
=
_getImportPath
(
file
,
examplesLibDir
),
:
importPath
=
_getImportPath
(
file
,
examplesLibDir
),
importName
=
''
{
importName
=
''
{
importName
=
importPath
.
replaceAll
(
RegExp
(
r'\.dart$'
),
''
).
replaceAll
(
RegExp
(
r'\W'
),
'_'
);
importName
=
importPath
.
replaceAll
(
RegExp
(
r'\.dart$'
),
''
).
replaceAll
(
RegExp
(
r'\W'
),
'_'
);
}
}
final
File
file
;
final
String
importPath
;
final
String
importPath
;
String
importName
;
String
importName
;
...
...
examples/api/analysis_options.yaml
View file @
55b6f049
...
@@ -6,3 +6,5 @@ linter:
...
@@ -6,3 +6,5 @@ linter:
rules
:
rules
:
# Samples want to print things pretty often.
# Samples want to print things pretty often.
avoid_print
:
false
avoid_print
:
false
# Samples are sometimes incomplete and don't show usage of everything.
unreachable_from_main
:
false
packages/flutter/test/foundation/isolates_test.dart
View file @
55b6f049
...
@@ -139,6 +139,7 @@ Future<int> computeInstanceMethod(int square) {
...
@@ -139,6 +139,7 @@ Future<int> computeInstanceMethod(int square) {
Future
<
int
>
computeInvalidInstanceMethod
(
int
square
)
{
Future
<
int
>
computeInvalidInstanceMethod
(
int
square
)
{
final
ComputeTestSubject
subject
=
ComputeTestSubject
(
square
,
ReceivePort
());
final
ComputeTestSubject
subject
=
ComputeTestSubject
(
square
,
ReceivePort
());
expect
(
subject
.
additional
,
isA
<
ReceivePort
>());
return
compute
(
subject
.
method
,
square
);
return
compute
(
subject
.
method
,
square
);
}
}
...
...
packages/flutter/test/material/menu_anchor_test.dart
View file @
55b6f049
...
@@ -3256,9 +3256,4 @@ enum TestMenu {
...
@@ -3256,9 +3256,4 @@ enum TestMenu {
final
String
acceleratorLabel
;
final
String
acceleratorLabel
;
// Strip the accelerator markers.
// Strip the accelerator markers.
String
get
label
=>
MenuAcceleratorLabel
.
stripAcceleratorMarkers
(
acceleratorLabel
);
String
get
label
=>
MenuAcceleratorLabel
.
stripAcceleratorMarkers
(
acceleratorLabel
);
int
get
acceleratorIndex
{
int
index
=
-
1
;
MenuAcceleratorLabel
.
stripAcceleratorMarkers
(
acceleratorLabel
,
setIndex:
(
int
i
)
=>
index
=
i
);
return
index
;
}
}
}
packages/flutter/test/painting/image_stream_test.dart
View file @
55b6f049
...
@@ -26,8 +26,6 @@ class FakeFrameInfo implements FrameInfo {
...
@@ -26,8 +26,6 @@ class FakeFrameInfo implements FrameInfo {
@override
@override
Image
get
image
=>
_image
;
Image
get
image
=>
_image
;
int
get
imageHandleCount
=>
image
.
debugGetOpenHandleStackTraces
()!.
length
;
FakeFrameInfo
clone
()
{
FakeFrameInfo
clone
()
{
return
FakeFrameInfo
(
return
FakeFrameInfo
(
_duration
,
_duration
,
...
...
packages/flutter/test/semantics/semantics_update_test.dart
View file @
55b6f049
...
@@ -218,37 +218,13 @@ class SemanticsUpdateBuilderSpy extends Fake implements ui.SemanticsUpdateBuilde
...
@@ -218,37 +218,13 @@ class SemanticsUpdateBuilderSpy extends Fake implements ui.SemanticsUpdateBuilde
// Makes sure we don't send the same id twice.
// Makes sure we don't send the same id twice.
assert
(!
observations
.
containsKey
(
id
));
assert
(!
observations
.
containsKey
(
id
));
observations
[
id
]
=
SemanticsNodeUpdateObservation
(
observations
[
id
]
=
SemanticsNodeUpdateObservation
(
id:
id
,
flags:
flags
,
actions:
actions
,
maxValueLength:
maxValueLength
,
currentValueLength:
currentValueLength
,
textSelectionBase:
textSelectionBase
,
textSelectionExtent:
textSelectionExtent
,
platformViewId:
platformViewId
,
scrollChildren:
scrollChildren
,
scrollIndex:
scrollIndex
,
scrollPosition:
scrollPosition
,
scrollExtentMax:
scrollExtentMax
,
scrollExtentMin:
scrollExtentMin
,
elevation:
elevation
,
thickness:
thickness
,
rect:
rect
,
label:
label
,
label:
label
,
labelAttributes:
labelAttributes
,
labelAttributes:
labelAttributes
,
hint:
hint
,
hint:
hint
,
hintAttributes:
hintAttributes
,
hintAttributes:
hintAttributes
,
value:
value
,
value:
value
,
valueAttributes:
valueAttributes
,
valueAttributes:
valueAttributes
,
increasedValue:
increasedValue
,
increasedValueAttributes:
increasedValueAttributes
,
decreasedValue:
decreasedValue
,
decreasedValueAttributes:
decreasedValueAttributes
,
textDirection:
textDirection
,
transform:
transform
,
childrenInTraversalOrder:
childrenInTraversalOrder
,
childrenInTraversalOrder:
childrenInTraversalOrder
,
childrenInHitTestOrder:
childrenInHitTestOrder
,
additionalActions:
additionalActions
,
);
);
}
}
...
@@ -262,68 +238,20 @@ class SemanticsUpdateBuilderSpy extends Fake implements ui.SemanticsUpdateBuilde
...
@@ -262,68 +238,20 @@ class SemanticsUpdateBuilderSpy extends Fake implements ui.SemanticsUpdateBuilde
class
SemanticsNodeUpdateObservation
{
class
SemanticsNodeUpdateObservation
{
const
SemanticsNodeUpdateObservation
({
const
SemanticsNodeUpdateObservation
({
required
this
.
id
,
required
this
.
flags
,
required
this
.
actions
,
required
this
.
maxValueLength
,
required
this
.
currentValueLength
,
required
this
.
textSelectionBase
,
required
this
.
textSelectionExtent
,
required
this
.
platformViewId
,
required
this
.
scrollChildren
,
required
this
.
scrollIndex
,
required
this
.
scrollPosition
,
required
this
.
scrollExtentMax
,
required
this
.
scrollExtentMin
,
required
this
.
elevation
,
required
this
.
thickness
,
required
this
.
rect
,
required
this
.
label
,
required
this
.
label
,
this
.
labelAttributes
,
this
.
labelAttributes
,
required
this
.
value
,
required
this
.
value
,
this
.
valueAttributes
,
this
.
valueAttributes
,
required
this
.
increasedValue
,
this
.
increasedValueAttributes
,
required
this
.
decreasedValue
,
this
.
decreasedValueAttributes
,
required
this
.
hint
,
required
this
.
hint
,
this
.
hintAttributes
,
this
.
hintAttributes
,
this
.
textDirection
,
required
this
.
transform
,
required
this
.
childrenInTraversalOrder
,
required
this
.
childrenInTraversalOrder
,
required
this
.
childrenInHitTestOrder
,
required
this
.
additionalActions
,
});
});
final
int
id
;
final
int
flags
;
final
int
actions
;
final
int
maxValueLength
;
final
int
currentValueLength
;
final
int
textSelectionBase
;
final
int
textSelectionExtent
;
final
int
platformViewId
;
final
int
scrollChildren
;
final
int
scrollIndex
;
final
double
scrollPosition
;
final
double
scrollExtentMax
;
final
double
scrollExtentMin
;
final
double
elevation
;
final
double
thickness
;
final
Rect
rect
;
final
String
label
;
final
String
label
;
final
List
<
StringAttribute
>?
labelAttributes
;
final
List
<
StringAttribute
>?
labelAttributes
;
final
String
value
;
final
String
value
;
final
List
<
StringAttribute
>?
valueAttributes
;
final
List
<
StringAttribute
>?
valueAttributes
;
final
String
increasedValue
;
final
List
<
StringAttribute
>?
increasedValueAttributes
;
final
String
decreasedValue
;
final
List
<
StringAttribute
>?
decreasedValueAttributes
;
final
String
hint
;
final
String
hint
;
final
List
<
StringAttribute
>?
hintAttributes
;
final
List
<
StringAttribute
>?
hintAttributes
;
final
TextDirection
?
textDirection
;
final
Float64List
transform
;
final
Int32List
childrenInTraversalOrder
;
final
Int32List
childrenInTraversalOrder
;
final
Int32List
childrenInHitTestOrder
;
final
Int32List
additionalActions
;
}
}
packages/flutter/test/services/asset_manifest_test.dart
View file @
55b6f049
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
import
'dart:convert'
;
import
'package:flutter/services.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
...
@@ -73,29 +71,3 @@ void main() {
...
@@ -73,29 +71,3 @@ void main() {
expect
(
manifest
.
getAssetVariants
(
'invalid asset key'
),
isNull
);
expect
(
manifest
.
getAssetVariants
(
'invalid asset key'
),
isNull
);
});
});
}
}
String
createAssetManifestJson
(
Map
<
String
,
List
<
AssetMetadata
>>
manifest
)
{
final
Map
<
Object
,
Object
>
jsonObject
=
manifest
.
map
(
(
String
key
,
List
<
AssetMetadata
>
value
)
{
final
List
<
String
>
variants
=
value
.
map
((
AssetMetadata
e
)
=>
e
.
key
).
toList
();
return
MapEntry
<
String
,
List
<
String
>>(
key
,
variants
);
}
);
return
json
.
encode
(
jsonObject
);
}
ByteData
createAssetManifestSmcBin
(
Map
<
String
,
List
<
AssetMetadata
>>
manifest
)
{
final
Map
<
Object
,
Object
>
smcObject
=
manifest
.
map
(
(
String
key
,
List
<
AssetMetadata
>
value
)
{
final
List
<
Object
>
variants
=
value
.
map
((
AssetMetadata
variant
)
=>
<
String
,
Object
?>{
'asset'
:
variant
.
key
,
'dpr'
:
variant
.
targetDevicePixelRatio
,
}).
toList
();
return
MapEntry
<
String
,
List
<
Object
>>(
key
,
variants
);
}
);
return
const
StandardMessageCodec
().
encodeMessage
(
smcObject
)!;
}
packages/flutter/test/widgets/async_lifecycle_test.dart
View file @
55b6f049
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
import
'package:flutter/
widgets
.dart'
;
import
'package:flutter/
material
.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
class
InvalidOnInitLifecycleWidget
extends
StatefulWidget
{
class
InvalidOnInitLifecycleWidget
extends
StatefulWidget
{
...
@@ -25,9 +25,9 @@ class InvalidOnInitLifecycleWidgetState extends State<InvalidOnInitLifecycleWidg
...
@@ -25,9 +25,9 @@ class InvalidOnInitLifecycleWidgetState extends State<InvalidOnInitLifecycleWidg
}
}
class
InvalidDidUpdateWidgetLifecycleWidget
extends
StatefulWidget
{
class
InvalidDidUpdateWidgetLifecycleWidget
extends
StatefulWidget
{
const
InvalidDidUpdateWidgetLifecycleWidget
({
super
.
key
,
required
this
.
id
});
const
InvalidDidUpdateWidgetLifecycleWidget
({
super
.
key
,
required
this
.
color
});
final
int
id
;
final
Color
color
;
@override
@override
InvalidDidUpdateWidgetLifecycleWidgetState
createState
()
=>
InvalidDidUpdateWidgetLifecycleWidgetState
();
InvalidDidUpdateWidgetLifecycleWidgetState
createState
()
=>
InvalidDidUpdateWidgetLifecycleWidgetState
();
...
@@ -41,7 +41,7 @@ class InvalidDidUpdateWidgetLifecycleWidgetState extends State<InvalidDidUpdateW
...
@@ -41,7 +41,7 @@ class InvalidDidUpdateWidgetLifecycleWidgetState extends State<InvalidDidUpdateW
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
Co
ntainer
(
);
return
Co
loredBox
(
color:
widget
.
color
);
}
}
}
}
...
@@ -53,8 +53,8 @@ void main() {
...
@@ -53,8 +53,8 @@ void main() {
});
});
testWidgets
(
'async didUpdateWidget throws FlutterError'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'async didUpdateWidget throws FlutterError'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
const
InvalidDidUpdateWidgetLifecycleWidget
(
id:
1
));
await
tester
.
pumpWidget
(
const
InvalidDidUpdateWidgetLifecycleWidget
(
color:
Colors
.
green
));
await
tester
.
pumpWidget
(
const
InvalidDidUpdateWidgetLifecycleWidget
(
id:
2
));
await
tester
.
pumpWidget
(
const
InvalidDidUpdateWidgetLifecycleWidget
(
color:
Colors
.
red
));
expect
(
tester
.
takeException
(),
isFlutterError
);
expect
(
tester
.
takeException
(),
isFlutterError
);
});
});
...
...
packages/flutter/test/widgets/automatic_keep_alive_test.dart
View file @
55b6f049
...
@@ -600,23 +600,7 @@ class _AlwaysKeepAliveState extends State<_AlwaysKeepAlive> with AutomaticKeepAl
...
@@ -600,23 +600,7 @@ class _AlwaysKeepAliveState extends State<_AlwaysKeepAlive> with AutomaticKeepAl
}
}
}
}
class
RenderBoxKeepAlive
extends
RenderBox
{
class
RenderBoxKeepAlive
extends
RenderBox
{
}
State
<
StatefulWidget
>
createState
()
=>
AlwaysKeepAliveRenderBoxState
();
}
class
AlwaysKeepAliveRenderBoxState
extends
State
<
_AlwaysKeepAlive
>
with
AutomaticKeepAliveClientMixin
<
_AlwaysKeepAlive
>
{
@override
bool
get
wantKeepAlive
=>
true
;
@override
Widget
build
(
BuildContext
context
)
{
super
.
build
(
context
);
return
const
SizedBox
(
height:
48.0
,
child:
Text
(
'keep me alive'
),
);
}
}
mixin
KeepAliveParentDataMixinAlt
implements
KeepAliveParentDataMixin
{
mixin
KeepAliveParentDataMixinAlt
implements
KeepAliveParentDataMixin
{
@override
@override
...
@@ -631,14 +615,6 @@ class RenderSliverMultiBoxAdaptorAlt extends RenderSliver with
...
@@ -631,14 +615,6 @@ class RenderSliverMultiBoxAdaptorAlt extends RenderSliver with
RenderSliverHelpers
,
RenderSliverHelpers
,
RenderSliverWithKeepAliveMixin
{
RenderSliverWithKeepAliveMixin
{
RenderSliverMultiBoxAdaptorAlt
({
RenderSliverBoxChildManager
?
childManager
,
})
:
_childManager
=
childManager
;
@protected
RenderSliverBoxChildManager
?
get
childManager
=>
_childManager
;
final
RenderSliverBoxChildManager
?
_childManager
;
final
List
<
RenderBox
>
children
=
<
RenderBox
>[];
final
List
<
RenderBox
>
children
=
<
RenderBox
>[];
void
insert
(
RenderBox
child
,
{
RenderBox
?
after
})
{
void
insert
(
RenderBox
child
,
{
RenderBox
?
after
})
{
...
...
packages/flutter/test/widgets/fade_in_image_test.dart
View file @
55b6f049
...
@@ -30,16 +30,6 @@ class FadeInImageParts {
...
@@ -30,16 +30,6 @@ class FadeInImageParts {
expect
(
animatedFadeOutFadeInElement
,
isNotNull
);
expect
(
animatedFadeOutFadeInElement
,
isNotNull
);
return
animatedFadeOutFadeInElement
!.
state
;
return
animatedFadeOutFadeInElement
!.
state
;
}
}
Element
?
get
semanticsElement
{
Element
?
result
;
fadeInImageElement
.
visitChildren
((
Element
child
)
{
if
(
child
.
widget
is
Semantics
)
{
result
=
child
;
}
});
return
result
;
}
}
}
class
FadeInImageElements
{
class
FadeInImageElements
{
...
...
packages/flutter/test/widgets/mark_needs_build_test.dart
View file @
55b6f049
...
@@ -106,7 +106,7 @@ class _TestWidgetState extends State<TestWidget> {
...
@@ -106,7 +106,7 @@ class _TestWidgetState extends State<TestWidget> {
calledDuringBuild
++;
calledDuringBuild
++;
});
});
return
SizedBox
.
expand
(
return
SizedBox
.
expand
(
child:
Text
(
Directionality
.
of
(
context
).
toString
()
),
child:
Text
(
'
${widget.value}
:
${Directionality.of(context)}
'
),
);
);
}
}
}
}
packages/flutter/test/widgets/render_object_element_test.dart
View file @
55b6f049
...
@@ -137,8 +137,8 @@ class SwapperElementWithProperOverrides extends SwapperElement {
...
@@ -137,8 +137,8 @@ class SwapperElementWithProperOverrides extends SwapperElement {
}
}
class
RenderSwapper
extends
RenderBox
{
class
RenderSwapper
extends
RenderBox
{
RenderBox
?
_stable
;
RenderBox
?
get
stable
=>
_stable
;
RenderBox
?
get
stable
=>
_stable
;
RenderBox
?
_stable
;
set
stable
(
RenderBox
?
child
)
{
set
stable
(
RenderBox
?
child
)
{
if
(
child
==
_stable
)
{
if
(
child
==
_stable
)
{
return
;
return
;
...
@@ -153,8 +153,8 @@ class RenderSwapper extends RenderBox {
...
@@ -153,8 +153,8 @@ class RenderSwapper extends RenderBox {
}
}
bool
?
_swapperIsOnTop
;
bool
?
_swapperIsOnTop
;
RenderBox
?
_swapper
;
RenderBox
?
get
swapper
=>
_swapper
;
RenderBox
?
get
swapper
=>
_swapper
;
RenderBox
?
_swapper
;
void
setSwapper
(
RenderBox
?
child
,
bool
isOnTop
)
{
void
setSwapper
(
RenderBox
?
child
,
bool
isOnTop
)
{
if
(
isOnTop
!=
_swapperIsOnTop
)
{
if
(
isOnTop
!=
_swapperIsOnTop
)
{
_swapperIsOnTop
=
isOnTop
;
_swapperIsOnTop
=
isOnTop
;
...
@@ -174,11 +174,11 @@ class RenderSwapper extends RenderBox {
...
@@ -174,11 +174,11 @@ class RenderSwapper extends RenderBox {
@override
@override
void
visitChildren
(
RenderObjectVisitor
visitor
)
{
void
visitChildren
(
RenderObjectVisitor
visitor
)
{
if
(
_
stable
!=
null
)
{
if
(
stable
!=
null
)
{
visitor
(
_
stable
!);
visitor
(
stable
!);
}
}
if
(
_
swapper
!=
null
)
{
if
(
swapper
!=
null
)
{
visitor
(
_
swapper
!);
visitor
(
swapper
!);
}
}
}
}
...
@@ -210,14 +210,14 @@ class RenderSwapper extends RenderBox {
...
@@ -210,14 +210,14 @@ class RenderSwapper extends RenderBox {
minHeight:
constraints
.
minHeight
/
2
,
minHeight:
constraints
.
minHeight
/
2
,
maxHeight:
constraints
.
maxHeight
/
2
,
maxHeight:
constraints
.
maxHeight
/
2
,
);
);
if
(
_
stable
!=
null
)
{
if
(
stable
!=
null
)
{
final
BoxParentData
stableParentData
=
_
stable
!.
parentData
!
as
BoxParentData
;
final
BoxParentData
stableParentData
=
stable
!.
parentData
!
as
BoxParentData
;
_
stable
!.
layout
(
childConstraints
);
stable
!.
layout
(
childConstraints
);
stableParentData
.
offset
=
_swapperIsOnTop
!
?
bottomOffset
:
topOffset
;
stableParentData
.
offset
=
_swapperIsOnTop
!
?
bottomOffset
:
topOffset
;
}
}
if
(
_
swapper
!=
null
)
{
if
(
swapper
!=
null
)
{
final
BoxParentData
swapperParentData
=
_
swapper
!.
parentData
!
as
BoxParentData
;
final
BoxParentData
swapperParentData
=
swapper
!.
parentData
!
as
BoxParentData
;
_
swapper
!.
layout
(
childConstraints
);
swapper
!.
layout
(
childConstraints
);
swapperParentData
.
offset
=
_swapperIsOnTop
!
?
topOffset
:
bottomOffset
;
swapperParentData
.
offset
=
_swapperIsOnTop
!
?
topOffset
:
bottomOffset
;
}
}
}
}
...
...
packages/flutter/test/widgets/reparent_state_harder_test.dart
View file @
55b6f049
...
@@ -63,10 +63,8 @@ class DummyStatefulWidgetState extends State<DummyStatefulWidget> {
...
@@ -63,10 +63,8 @@ class DummyStatefulWidgetState extends State<DummyStatefulWidget> {
class
RekeyableDummyStatefulWidgetWrapper
extends
StatefulWidget
{
class
RekeyableDummyStatefulWidgetWrapper
extends
StatefulWidget
{
const
RekeyableDummyStatefulWidgetWrapper
({
const
RekeyableDummyStatefulWidgetWrapper
({
super
.
key
,
super
.
key
,
this
.
child
,
required
this
.
initialKey
,
required
this
.
initialKey
,
});
});
final
Widget
?
child
;
final
GlobalKey
initialKey
;
final
GlobalKey
initialKey
;
@override
@override
RekeyableDummyStatefulWidgetWrapperState
createState
()
=>
RekeyableDummyStatefulWidgetWrapperState
();
RekeyableDummyStatefulWidgetWrapperState
createState
()
=>
RekeyableDummyStatefulWidgetWrapperState
();
...
...
packages/flutter/test/widgets/router_test.dart
View file @
55b6f049
...
@@ -1610,10 +1610,6 @@ class SimpleNavigatorRouterDelegate extends RouterDelegate<RouteInformation> wit
...
@@ -1610,10 +1610,6 @@ class SimpleNavigatorRouterDelegate extends RouterDelegate<RouteInformation> wit
RouteInformation
get
routeInformation
=>
_routeInformation
;
RouteInformation
get
routeInformation
=>
_routeInformation
;
late
RouteInformation
_routeInformation
;
late
RouteInformation
_routeInformation
;
set
routeInformation
(
RouteInformation
newValue
)
{
_routeInformation
=
newValue
;
notifyListeners
();
}
SimpleRouterDelegateBuilder
builder
;
SimpleRouterDelegateBuilder
builder
;
SimpleNavigatorRouterDelegatePopPage
<
void
>
onPopPage
;
SimpleNavigatorRouterDelegatePopPage
<
void
>
onPopPage
;
...
@@ -1711,10 +1707,6 @@ class SimpleAsyncRouterDelegate extends RouterDelegate<RouteInformation> with Ch
...
@@ -1711,10 +1707,6 @@ class SimpleAsyncRouterDelegate extends RouterDelegate<RouteInformation> with Ch
RouteInformation
?
get
routeInformation
=>
_routeInformation
;
RouteInformation
?
get
routeInformation
=>
_routeInformation
;
RouteInformation
?
_routeInformation
;
RouteInformation
?
_routeInformation
;
set
routeInformation
(
RouteInformation
?
newValue
)
{
_routeInformation
=
newValue
;
notifyListeners
();
}
SimpleRouterDelegateBuilder
builder
;
SimpleRouterDelegateBuilder
builder
;
late
Future
<
void
>
setNewRouteFuture
;
late
Future
<
void
>
setNewRouteFuture
;
...
...
packages/flutter/test/widgets/selectable_region_context_menu_test.dart
View file @
55b6f049
...
@@ -18,7 +18,6 @@ extension on web.CSSRuleList {
...
@@ -18,7 +18,6 @@ extension on web.CSSRuleList {
Iterable
<
web
.
CSSRule
>
get
iterable
=>
_genIterable
(
this
);
Iterable
<
web
.
CSSRule
>
get
iterable
=>
_genIterable
(
this
);
}
}
typedef
ItemGetter
<
T
>
=
T
?
Function
(
int
index
);
Iterable
<
T
>
_genIterable
<
T
>(
dynamic
jsCollection
)
{
Iterable
<
T
>
_genIterable
<
T
>(
dynamic
jsCollection
)
{
// ignore: avoid_dynamic_calls
// ignore: avoid_dynamic_calls
return
Iterable
<
T
>.
generate
(
jsCollection
.
length
as
int
,
(
int
index
)
=>
jsCollection
.
item
(
index
)
as
T
,);
return
Iterable
<
T
>.
generate
(
jsCollection
.
length
as
int
,
(
int
index
)
=>
jsCollection
.
item
(
index
)
as
T
,);
...
@@ -159,8 +158,7 @@ class RenderSelectionSpy extends RenderProxyBox
...
@@ -159,8 +158,7 @@ class RenderSelectionSpy extends RenderProxyBox
}
}
@override
@override
SelectionGeometry
get
value
=>
_value
;
final
SelectionGeometry
value
=
const
SelectionGeometry
(
SelectionGeometry
_value
=
const
SelectionGeometry
(
hasContent:
true
,
hasContent:
true
,
status:
SelectionStatus
.
uncollapsed
,
status:
SelectionStatus
.
uncollapsed
,
startSelectionPoint:
SelectionPoint
(
startSelectionPoint:
SelectionPoint
(
...
@@ -174,15 +172,6 @@ class RenderSelectionSpy extends RenderProxyBox
...
@@ -174,15 +172,6 @@ class RenderSelectionSpy extends RenderProxyBox
handleType:
TextSelectionHandleType
.
left
,
handleType:
TextSelectionHandleType
.
left
,
),
),
);
);
set
value
(
SelectionGeometry
other
)
{
if
(
other
==
_value
)
{
return
;
}
_value
=
other
;
for
(
final
VoidCallback
callback
in
listeners
)
{
callback
();
}
}
@override
@override
void
pushHandleLayers
(
LayerLink
?
startHandle
,
LayerLink
?
endHandle
)
{
}
void
pushHandleLayers
(
LayerLink
?
startHandle
,
LayerLink
?
endHandle
)
{
}
...
...
packages/flutter/test/widgets/selectable_region_test.dart
View file @
55b6f049
...
@@ -2526,8 +2526,7 @@ class RenderSelectionSpy extends RenderProxyBox
...
@@ -2526,8 +2526,7 @@ class RenderSelectionSpy extends RenderProxyBox
}
}
@override
@override
SelectionGeometry
get
value
=>
_value
;
final
SelectionGeometry
value
=
const
SelectionGeometry
(
SelectionGeometry
_value
=
const
SelectionGeometry
(
hasContent:
true
,
hasContent:
true
,
status:
SelectionStatus
.
uncollapsed
,
status:
SelectionStatus
.
uncollapsed
,
startSelectionPoint:
SelectionPoint
(
startSelectionPoint:
SelectionPoint
(
...
@@ -2541,15 +2540,6 @@ class RenderSelectionSpy extends RenderProxyBox
...
@@ -2541,15 +2540,6 @@ class RenderSelectionSpy extends RenderProxyBox
handleType:
TextSelectionHandleType
.
left
,
handleType:
TextSelectionHandleType
.
left
,
),
),
);
);
set
value
(
SelectionGeometry
other
)
{
if
(
other
==
_value
)
{
return
;
}
_value
=
other
;
for
(
final
VoidCallback
callback
in
listeners
)
{
callback
();
}
}
@override
@override
void
pushHandleLayers
(
LayerLink
?
startHandle
,
LayerLink
?
endHandle
)
{
}
void
pushHandleLayers
(
LayerLink
?
startHandle
,
LayerLink
?
endHandle
)
{
}
...
...
packages/flutter/test/widgets/semantics_10_test.dart
View file @
55b6f049
...
@@ -96,13 +96,13 @@ class RenderTest extends RenderProxyBox {
...
@@ -96,13 +96,13 @@ class RenderTest extends RenderProxyBox {
void
describeSemanticsConfiguration
(
SemanticsConfiguration
config
)
{
void
describeSemanticsConfiguration
(
SemanticsConfiguration
config
)
{
super
.
describeSemanticsConfiguration
(
config
);
super
.
describeSemanticsConfiguration
(
config
);
if
(!
_
isSemanticBoundary
)
{
if
(!
isSemanticBoundary
)
{
return
;
return
;
}
}
config
config
..
isSemanticBoundary
=
_
isSemanticBoundary
..
isSemanticBoundary
=
isSemanticBoundary
..
label
=
_
label
..
label
=
label
..
textDirection
=
TextDirection
.
ltr
;
..
textDirection
=
TextDirection
.
ltr
;
}
}
...
...
packages/flutter/test/widgets/semantics_child_configs_delegate_test.dart
View file @
55b6f049
...
@@ -357,6 +357,6 @@ class RenderTestConfigDelegate extends RenderProxyBox {
...
@@ -357,6 +357,6 @@ class RenderTestConfigDelegate extends RenderProxyBox {
@override
@override
void
describeSemanticsConfiguration
(
SemanticsConfiguration
config
)
{
void
describeSemanticsConfiguration
(
SemanticsConfiguration
config
)
{
config
.
childConfigurationsDelegate
=
_
delegate
;
config
.
childConfigurationsDelegate
=
delegate
;
}
}
}
}
packages/flutter/test/widgets/shortcuts_test.dart
View file @
55b6f049
...
@@ -601,18 +601,12 @@ void main() {
...
@@ -601,18 +601,12 @@ void main() {
testWidgets
(
'Shortcuts.manager lets manager handle shortcuts'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Shortcuts.manager lets manager handle shortcuts'
,
(
WidgetTester
tester
)
async
{
final
GlobalKey
containerKey
=
GlobalKey
();
final
GlobalKey
containerKey
=
GlobalKey
();
final
List
<
LogicalKeyboardKey
>
pressedKeys
=
<
LogicalKeyboardKey
>[];
final
List
<
LogicalKeyboardKey
>
pressedKeys
=
<
LogicalKeyboardKey
>[];
bool
shortcutsSet
=
false
;
void
onShortcutsSet
()
{
shortcutsSet
=
true
;
}
final
TestShortcutManager
testManager
=
TestShortcutManager
(
final
TestShortcutManager
testManager
=
TestShortcutManager
(
pressedKeys
,
pressedKeys
,
onShortcutsSet:
onShortcutsSet
,
shortcuts:
<
LogicalKeySet
,
Intent
>{
shortcuts:
<
LogicalKeySet
,
Intent
>{
LogicalKeySet
(
LogicalKeyboardKey
.
shift
):
const
TestIntent
(),
LogicalKeySet
(
LogicalKeyboardKey
.
shift
):
const
TestIntent
(),
},
},
);
);
shortcutsSet
=
false
;
bool
invoked
=
false
;
bool
invoked
=
false
;
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
Actions
(
Actions
(
...
@@ -636,7 +630,6 @@ void main() {
...
@@ -636,7 +630,6 @@ void main() {
await
tester
.
pump
();
await
tester
.
pump
();
await
tester
.
sendKeyDownEvent
(
LogicalKeyboardKey
.
shiftLeft
);
await
tester
.
sendKeyDownEvent
(
LogicalKeyboardKey
.
shiftLeft
);
expect
(
invoked
,
isTrue
);
expect
(
invoked
,
isTrue
);
expect
(
shortcutsSet
,
isFalse
);
expect
(
pressedKeys
,
equals
(<
LogicalKeyboardKey
>[
LogicalKeyboardKey
.
shiftLeft
]));
expect
(
pressedKeys
,
equals
(<
LogicalKeyboardKey
>[
LogicalKeyboardKey
.
shiftLeft
]));
});
});
...
@@ -1953,10 +1946,9 @@ class TestIntent2 extends Intent {
...
@@ -1953,10 +1946,9 @@ class TestIntent2 extends Intent {
}
}
class
TestShortcutManager
extends
ShortcutManager
{
class
TestShortcutManager
extends
ShortcutManager
{
TestShortcutManager
(
this
.
keys
,
{
super
.
shortcuts
,
this
.
onShortcutsSet
});
TestShortcutManager
(
this
.
keys
,
{
super
.
shortcuts
});
List
<
LogicalKeyboardKey
>
keys
;
List
<
LogicalKeyboardKey
>
keys
;
VoidCallback
?
onShortcutsSet
;
@override
@override
KeyEventResult
handleKeypress
(
BuildContext
context
,
RawKeyEvent
event
)
{
KeyEventResult
handleKeypress
(
BuildContext
context
,
RawKeyEvent
event
)
{
...
...
packages/flutter/test/widgets/slivers_keepalive_test.dart
View file @
55b6f049
...
@@ -319,7 +319,7 @@ void main() {
...
@@ -319,7 +319,7 @@ void main() {
WidgetTest2
(
text:
'child 2'
,
key:
UniqueKey
()),
WidgetTest2
(
text:
'child 2'
,
key:
UniqueKey
()),
];
];
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
SwitchingSliverListTest
(
viewportFraction:
0.1
,
children:
childList
),
SwitchingSliverListTest
(
children:
childList
),
);
);
final
_WidgetTest0State
state0
=
tester
.
state
(
find
.
byType
(
WidgetTest0
));
final
_WidgetTest0State
state0
=
tester
.
state
(
find
.
byType
(
WidgetTest0
));
final
_WidgetTest1State
state1
=
tester
.
state
(
find
.
byType
(
WidgetTest1
));
final
_WidgetTest1State
state1
=
tester
.
state
(
find
.
byType
(
WidgetTest1
));
...
@@ -330,32 +330,32 @@ void main() {
...
@@ -330,32 +330,32 @@ void main() {
childList
=
createSwitchedChildList
(
childList
,
0
,
2
);
childList
=
createSwitchedChildList
(
childList
,
0
,
2
);
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
SwitchingSliverListTest
(
viewportFraction:
0.1
,
children:
childList
),
SwitchingSliverListTest
(
children:
childList
),
);
);
childList
=
createSwitchedChildList
(
childList
,
1
,
2
);
childList
=
createSwitchedChildList
(
childList
,
1
,
2
);
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
SwitchingSliverListTest
(
viewportFraction:
0.1
,
children:
childList
),
SwitchingSliverListTest
(
children:
childList
),
);
);
childList
=
createSwitchedChildList
(
childList
,
1
,
2
);
childList
=
createSwitchedChildList
(
childList
,
1
,
2
);
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
SwitchingSliverListTest
(
viewportFraction:
0.1
,
children:
childList
),
SwitchingSliverListTest
(
children:
childList
),
);
);
childList
=
createSwitchedChildList
(
childList
,
0
,
1
);
childList
=
createSwitchedChildList
(
childList
,
0
,
1
);
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
SwitchingSliverListTest
(
viewportFraction:
0.1
,
children:
childList
),
SwitchingSliverListTest
(
children:
childList
),
);
);
childList
=
createSwitchedChildList
(
childList
,
0
,
2
);
childList
=
createSwitchedChildList
(
childList
,
0
,
2
);
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
SwitchingSliverListTest
(
viewportFraction:
0.1
,
children:
childList
),
SwitchingSliverListTest
(
children:
childList
),
);
);
childList
=
createSwitchedChildList
(
childList
,
0
,
1
);
childList
=
createSwitchedChildList
(
childList
,
0
,
1
);
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
SwitchingSliverListTest
(
viewportFraction:
0.1
,
children:
childList
),
SwitchingSliverListTest
(
children:
childList
),
);
);
expect
(
state0
.
hasBeenDisposed
,
false
);
expect
(
state0
.
hasBeenDisposed
,
false
);
expect
(
state1
.
hasBeenDisposed
,
true
);
expect
(
state1
.
hasBeenDisposed
,
true
);
...
@@ -369,7 +369,7 @@ void main() {
...
@@ -369,7 +369,7 @@ void main() {
WidgetTest2
(
text:
'child 2'
,
key:
UniqueKey
()),
WidgetTest2
(
text:
'child 2'
,
key:
UniqueKey
()),
];
];
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
SwitchingSliverListTest
(
viewportFraction:
0.1
,
children:
childList
),
SwitchingSliverListTest
(
children:
childList
),
);
);
final
_WidgetTest0State
state0
=
tester
.
state
(
find
.
byType
(
WidgetTest0
));
final
_WidgetTest0State
state0
=
tester
.
state
(
find
.
byType
(
WidgetTest0
));
final
_WidgetTest1State
state1
=
tester
.
state
(
find
.
byType
(
WidgetTest1
));
final
_WidgetTest1State
state1
=
tester
.
state
(
find
.
byType
(
WidgetTest1
));
...
@@ -381,7 +381,7 @@ void main() {
...
@@ -381,7 +381,7 @@ void main() {
childList
=
createSwitchedChildList
(
childList
,
0
,
1
);
childList
=
createSwitchedChildList
(
childList
,
0
,
1
);
childList
.
removeAt
(
2
);
childList
.
removeAt
(
2
);
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
SwitchingSliverListTest
(
viewportFraction:
0.1
,
children:
childList
),
SwitchingSliverListTest
(
children:
childList
),
);
);
expect
(
find
.
text
(
'child 0'
),
findsOneWidget
);
expect
(
find
.
text
(
'child 0'
),
findsOneWidget
);
expect
(
find
.
text
(
'child 1'
),
findsOneWidget
);
expect
(
find
.
text
(
'child 1'
),
findsOneWidget
);
...
@@ -505,12 +505,10 @@ class SwitchingChildListTest extends StatelessWidget {
...
@@ -505,12 +505,10 @@ class SwitchingChildListTest extends StatelessWidget {
class
SwitchingSliverListTest
extends
StatelessWidget
{
class
SwitchingSliverListTest
extends
StatelessWidget
{
const
SwitchingSliverListTest
({
const
SwitchingSliverListTest
({
required
this
.
children
,
required
this
.
children
,
this
.
viewportFraction
=
1.0
,
super
.
key
,
super
.
key
,
});
});
final
List
<
Widget
>
children
;
final
List
<
Widget
>
children
;
final
double
viewportFraction
;
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
...
...
packages/flutter/test/widgets/snapshot_widget_test.dart
View file @
55b6f049
...
@@ -335,10 +335,6 @@ class TestPainter extends SnapshotPainter {
...
@@ -335,10 +335,6 @@ class TestPainter extends SnapshotPainter {
super
.
removeListener
(
listener
);
super
.
removeListener
(
listener
);
}
}
void
notify
()
{
notifyListeners
();
}
@override
@override
void
paintSnapshot
(
PaintingContext
context
,
Offset
offset
,
Size
size
,
ui
.
Image
image
,
Size
sourceSize
,
double
pixelRatio
)
{
void
paintSnapshot
(
PaintingContext
context
,
Offset
offset
,
Size
size
,
ui
.
Image
image
,
Size
sourceSize
,
double
pixelRatio
)
{
count
+=
1
;
count
+=
1
;
...
...
packages/flutter/test_private/bin/test_private.dart
View file @
55b6f049
...
@@ -195,7 +195,13 @@ class TestCase {
...
@@ -195,7 +195,13 @@ class TestCase {
// Use Flutter's analysis_options.yaml file from packages/flutter.
// Use Flutter's analysis_options.yaml file from packages/flutter.
File
(
path
.
join
(
tmpdir
.
absolute
.
path
,
'analysis_options.yaml'
))
File
(
path
.
join
(
tmpdir
.
absolute
.
path
,
'analysis_options.yaml'
))
.
writeAsStringSync
(
'include:
${path.toUri(path.join(flutterRoot.path, 'packages', 'flutter', 'analysis_options.yaml'))}
'
);
.
writeAsStringSync
(
'include:
${path.toUri(path.join(flutterRoot.path, 'packages', 'flutter', 'analysis_options.yaml'))}
\n
'
'linter:
\n
'
' rules:
\n
'
// The code does wonky things with the part-of directive that cause false positives.
' unreachable_from_main: false'
);
return
true
;
return
true
;
}
}
...
...
packages/flutter_test/test/window_test.dart
View file @
55b6f049
...
@@ -243,7 +243,6 @@ void main() {
...
@@ -243,7 +243,6 @@ void main() {
class
TestObserver
with
WidgetsBindingObserver
{
class
TestObserver
with
WidgetsBindingObserver
{
List
<
Locale
>?
locales
;
List
<
Locale
>?
locales
;
Locale
?
locale
;
@override
@override
void
didChangeLocales
(
List
<
Locale
>?
locales
)
{
void
didChangeLocales
(
List
<
Locale
>?
locales
)
{
...
...
packages/flutter_tools/bin/xcode_backend.dart
View file @
55b6f049
...
@@ -63,11 +63,6 @@ class Context {
...
@@ -63,11 +63,6 @@ class Context {
}
}
}
}
bool
existsDir
(
String
path
)
{
final
Directory
dir
=
Directory
(
path
);
return
dir
.
existsSync
();
}
bool
existsFile
(
String
path
)
{
bool
existsFile
(
String
path
)
{
final
File
file
=
File
(
path
);
final
File
file
=
File
(
path
);
return
file
.
existsSync
();
return
file
.
existsSync
();
...
...
packages/flutter_tools/test/commands.shard/hermetic/attach_test.dart
View file @
55b6f049
...
@@ -105,7 +105,6 @@ void main() {
...
@@ -105,7 +105,6 @@ void main() {
testUsingContext
(
'succeeds with iOS device with protocol discovery'
,
()
async
{
testUsingContext
(
'succeeds with iOS device with protocol discovery'
,
()
async
{
final
FakeIOSDevice
device
=
FakeIOSDevice
(
final
FakeIOSDevice
device
=
FakeIOSDevice
(
logReader:
fakeLogReader
,
portForwarder:
portForwarder
,
portForwarder:
portForwarder
,
majorSdkVersion:
12
,
majorSdkVersion:
12
,
onGetLogReader:
()
{
onGetLogReader:
()
{
...
@@ -167,7 +166,6 @@ void main() {
...
@@ -167,7 +166,6 @@ void main() {
testUsingContext
(
'succeeds with iOS device with mDNS'
,
()
async
{
testUsingContext
(
'succeeds with iOS device with mDNS'
,
()
async
{
final
FakeIOSDevice
device
=
FakeIOSDevice
(
final
FakeIOSDevice
device
=
FakeIOSDevice
(
logReader:
fakeLogReader
,
portForwarder:
portForwarder
,
portForwarder:
portForwarder
,
majorSdkVersion:
16
,
majorSdkVersion:
16
,
onGetLogReader:
()
{
onGetLogReader:
()
{
...
@@ -237,7 +235,6 @@ void main() {
...
@@ -237,7 +235,6 @@ void main() {
testUsingContext
(
'succeeds with iOS device with mDNS wireless device'
,
()
async
{
testUsingContext
(
'succeeds with iOS device with mDNS wireless device'
,
()
async
{
final
FakeIOSDevice
device
=
FakeIOSDevice
(
final
FakeIOSDevice
device
=
FakeIOSDevice
(
logReader:
fakeLogReader
,
portForwarder:
portForwarder
,
portForwarder:
portForwarder
,
majorSdkVersion:
16
,
majorSdkVersion:
16
,
connectionInterface:
DeviceConnectionInterface
.
wireless
,
connectionInterface:
DeviceConnectionInterface
.
wireless
,
...
@@ -309,7 +306,6 @@ void main() {
...
@@ -309,7 +306,6 @@ void main() {
testUsingContext
(
'succeeds with iOS device with mDNS wireless device with debug-port'
,
()
async
{
testUsingContext
(
'succeeds with iOS device with mDNS wireless device with debug-port'
,
()
async
{
final
FakeIOSDevice
device
=
FakeIOSDevice
(
final
FakeIOSDevice
device
=
FakeIOSDevice
(
logReader:
fakeLogReader
,
portForwarder:
portForwarder
,
portForwarder:
portForwarder
,
majorSdkVersion:
16
,
majorSdkVersion:
16
,
connectionInterface:
DeviceConnectionInterface
.
wireless
,
connectionInterface:
DeviceConnectionInterface
.
wireless
,
...
@@ -385,7 +381,6 @@ void main() {
...
@@ -385,7 +381,6 @@ void main() {
testUsingContext
(
'succeeds with iOS device with mDNS wireless device with debug-url'
,
()
async
{
testUsingContext
(
'succeeds with iOS device with mDNS wireless device with debug-url'
,
()
async
{
final
FakeIOSDevice
device
=
FakeIOSDevice
(
final
FakeIOSDevice
device
=
FakeIOSDevice
(
logReader:
fakeLogReader
,
portForwarder:
portForwarder
,
portForwarder:
portForwarder
,
majorSdkVersion:
16
,
majorSdkVersion:
16
,
connectionInterface:
DeviceConnectionInterface
.
wireless
,
connectionInterface:
DeviceConnectionInterface
.
wireless
,
...
@@ -619,7 +614,6 @@ void main() {
...
@@ -619,7 +614,6 @@ void main() {
testUsingContext
(
'succeeds when ipv6 is specified and debug-port is not on iOS device'
,
()
async
{
testUsingContext
(
'succeeds when ipv6 is specified and debug-port is not on iOS device'
,
()
async
{
final
FakeIOSDevice
device
=
FakeIOSDevice
(
final
FakeIOSDevice
device
=
FakeIOSDevice
(
logReader:
fakeLogReader
,
portForwarder:
portForwarder
,
portForwarder:
portForwarder
,
majorSdkVersion:
12
,
majorSdkVersion:
12
,
onGetLogReader:
()
{
onGetLogReader:
()
{
...
@@ -1350,11 +1344,10 @@ class FakeAndroidDevice extends Fake implements AndroidDevice {
...
@@ -1350,11 +1344,10 @@ class FakeAndroidDevice extends Fake implements AndroidDevice {
class
FakeIOSDevice
extends
Fake
implements
IOSDevice
{
class
FakeIOSDevice
extends
Fake
implements
IOSDevice
{
FakeIOSDevice
({
FakeIOSDevice
({
DevicePortForwarder
?
portForwarder
,
DevicePortForwarder
?
portForwarder
,
DeviceLogReader
?
logReader
,
this
.
onGetLogReader
,
this
.
onGetLogReader
,
this
.
connectionInterface
=
DeviceConnectionInterface
.
attached
,
this
.
connectionInterface
=
DeviceConnectionInterface
.
attached
,
this
.
majorSdkVersion
=
0
,
this
.
majorSdkVersion
=
0
,
})
:
_portForwarder
=
portForwarder
,
_logReader
=
logReader
;
})
:
_portForwarder
=
portForwarder
;
final
DevicePortForwarder
?
_portForwarder
;
final
DevicePortForwarder
?
_portForwarder
;
@override
@override
...
@@ -1373,9 +1366,6 @@ class FakeIOSDevice extends Fake implements IOSDevice {
...
@@ -1373,9 +1366,6 @@ class FakeIOSDevice extends Fake implements IOSDevice {
@override
@override
DartDevelopmentService
get
dds
=>
throw
UnimplementedError
(
'getter dds not implemented'
);
DartDevelopmentService
get
dds
=>
throw
UnimplementedError
(
'getter dds not implemented'
);
final
DeviceLogReader
?
_logReader
;
DeviceLogReader
get
logReader
=>
_logReader
!;
final
DeviceLogReader
Function
()?
onGetLogReader
;
final
DeviceLogReader
Function
()?
onGetLogReader
;
@override
@override
...
@@ -1470,11 +1460,9 @@ class FakeMDnsClient extends Fake implements MDnsClient {
...
@@ -1470,11 +1460,9 @@ class FakeMDnsClient extends Fake implements MDnsClient {
}
}
class
TestDeviceManager
extends
DeviceManager
{
class
TestDeviceManager
extends
DeviceManager
{
TestDeviceManager
({
required
this
.
logger
})
:
super
(
logger:
logger
);
TestDeviceManager
({
required
super
.
logger
}
);
List
<
Device
>
devices
=
<
Device
>[];
List
<
Device
>
devices
=
<
Device
>[];
final
BufferLogger
logger
;
@override
@override
List
<
DeviceDiscovery
>
get
deviceDiscoverers
{
List
<
DeviceDiscovery
>
get
deviceDiscoverers
{
final
FakePollingDeviceDiscovery
discoverer
=
FakePollingDeviceDiscovery
();
final
FakePollingDeviceDiscovery
discoverer
=
FakePollingDeviceDiscovery
();
...
...
packages/flutter_tools/test/commands.shard/hermetic/create_usage_test.dart
View file @
55b6f049
...
@@ -19,9 +19,7 @@ import '../../src/test_flutter_command_runner.dart';
...
@@ -19,9 +19,7 @@ import '../../src/test_flutter_command_runner.dart';
import
'../../src/testbed.dart'
;
import
'../../src/testbed.dart'
;
class
FakePub
extends
Fake
implements
Pub
{
class
FakePub
extends
Fake
implements
Pub
{
FakePub
(
this
.
fs
);
final
FileSystem
fs
;
int
calledGetOffline
=
0
;
int
calledGetOffline
=
0
;
int
calledOnline
=
0
;
int
calledOnline
=
0
;
...
@@ -59,7 +57,7 @@ void main() {
...
@@ -59,7 +57,7 @@ void main() {
setUp
(()
{
setUp
(()
{
testbed
=
Testbed
(
setup:
()
{
testbed
=
Testbed
(
setup:
()
{
fakePub
=
FakePub
(
globals
.
fs
);
fakePub
=
FakePub
();
Cache
.
flutterRoot
=
'flutter'
;
Cache
.
flutterRoot
=
'flutter'
;
final
List
<
String
>
filePaths
=
<
String
>[
final
List
<
String
>
filePaths
=
<
String
>[
globals
.
fs
.
path
.
join
(
'flutter'
,
'packages'
,
'flutter'
,
'pubspec.yaml'
),
globals
.
fs
.
path
.
join
(
'flutter'
,
'packages'
,
'flutter'
,
'pubspec.yaml'
),
...
...
packages/flutter_tools/test/commands.shard/hermetic/doctor_test.dart
View file @
55b6f049
...
@@ -831,41 +831,6 @@ class FakeAndroidWorkflow extends Fake implements AndroidWorkflow {
...
@@ -831,41 +831,6 @@ class FakeAndroidWorkflow extends Fake implements AndroidWorkflow {
final
bool
appliesToHostPlatform
;
final
bool
appliesToHostPlatform
;
}
}
class
NoOpDoctor
implements
Doctor
{
@override
bool
get
canLaunchAnything
=>
true
;
@override
bool
get
canListAnything
=>
true
;
@override
Future
<
bool
>
checkRemoteArtifacts
(
String
engineRevision
)
async
=>
true
;
@override
Future
<
bool
>
diagnose
({
bool
androidLicenses
=
false
,
bool
verbose
=
true
,
bool
showColor
=
true
,
AndroidLicenseValidator
?
androidLicenseValidator
,
bool
showPii
=
true
,
List
<
ValidatorTask
>?
startedValidatorTasks
,
bool
sendEvent
=
true
,
FlutterVersion
?
version
,
})
async
=>
true
;
@override
List
<
ValidatorTask
>
startValidatorTasks
()
=>
<
ValidatorTask
>[];
@override
Future
<
void
>
summary
()
async
{
}
@override
List
<
DoctorValidator
>
get
validators
=>
<
DoctorValidator
>[];
@override
List
<
Workflow
>
get
workflows
=>
<
Workflow
>[];
}
class
PassingValidator
extends
DoctorValidator
{
class
PassingValidator
extends
DoctorValidator
{
PassingValidator
(
super
.
title
);
PassingValidator
(
super
.
title
);
...
...
packages/flutter_tools/test/commands.shard/hermetic/run_test.dart
View file @
55b6f049
...
@@ -1148,11 +1148,9 @@ void main() {
...
@@ -1148,11 +1148,9 @@ void main() {
}
}
class
TestDeviceManager
extends
DeviceManager
{
class
TestDeviceManager
extends
DeviceManager
{
TestDeviceManager
({
required
this
.
logger
})
:
super
(
logger:
logger
);
TestDeviceManager
({
required
super
.
logger
}
);
List
<
Device
>
devices
=
<
Device
>[];
List
<
Device
>
devices
=
<
Device
>[];
final
Logger
logger
;
@override
@override
List
<
DeviceDiscovery
>
get
deviceDiscoverers
{
List
<
DeviceDiscovery
>
get
deviceDiscoverers
{
final
FakePollingDeviceDiscovery
discoverer
=
FakePollingDeviceDiscovery
();
final
FakePollingDeviceDiscovery
discoverer
=
FakePollingDeviceDiscovery
();
...
...
packages/flutter_tools/test/general.shard/android/android_project_migration_test.dart
View file @
55b6f049
...
@@ -9,9 +9,6 @@ import 'package:flutter_tools/src/android/gradle_utils.dart';
...
@@ -9,9 +9,6 @@ import 'package:flutter_tools/src/android/gradle_utils.dart';
import
'package:flutter_tools/src/android/migrations/android_studio_java_gradle_conflict_migration.dart'
;
import
'package:flutter_tools/src/android/migrations/android_studio_java_gradle_conflict_migration.dart'
;
import
'package:flutter_tools/src/android/migrations/top_level_gradle_build_file_migration.dart'
;
import
'package:flutter_tools/src/android/migrations/top_level_gradle_build_file_migration.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/base/os.dart'
;
import
'package:flutter_tools/src/base/platform.dart'
;
import
'package:flutter_tools/src/base/process.dart'
;
import
'package:flutter_tools/src/base/version.dart'
;
import
'package:flutter_tools/src/base/version.dart'
;
import
'package:flutter_tools/src/project.dart'
;
import
'package:flutter_tools/src/project.dart'
;
import
'package:test/fake.dart'
;
import
'package:test/fake.dart'
;
...
@@ -287,8 +284,3 @@ class FakeErroringJava extends FakeJava {
...
@@ -287,8 +284,3 @@ class FakeErroringJava extends FakeJava {
throw
Exception
(
'How did this happen?'
);
throw
Exception
(
'How did this happen?'
);
}
}
}
}
class
FakeFileSystem
extends
Fake
implements
FileSystem
{}
class
FakeProcessUtils
extends
Fake
implements
ProcessUtils
{}
class
FakePlatform
extends
Fake
implements
Platform
{}
class
FakeOperatingSystemUtils
extends
Fake
implements
OperatingSystemUtils
{}
packages/flutter_tools/test/general.shard/android/android_sdk_test.dart
View file @
55b6f049
...
@@ -4,12 +4,10 @@
...
@@ -4,12 +4,10 @@
import
'package:file/memory.dart'
;
import
'package:file/memory.dart'
;
import
'package:flutter_tools/src/android/android_sdk.dart'
;
import
'package:flutter_tools/src/android/android_sdk.dart'
;
import
'package:flutter_tools/src/android/android_studio.dart'
;
import
'package:flutter_tools/src/base/config.dart'
;
import
'package:flutter_tools/src/base/config.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/platform.dart'
;
import
'package:flutter_tools/src/base/platform.dart'
;
import
'package:flutter_tools/src/globals.dart'
as
globals
;
import
'package:flutter_tools/src/globals.dart'
as
globals
;
import
'package:test/fake.dart'
;
import
'../../src/common.dart'
;
import
'../../src/common.dart'
;
import
'../../src/context.dart'
;
import
'../../src/context.dart'
;
...
@@ -424,13 +422,3 @@ ro.build.version.incremental=1624448
...
@@ -424,13 +422,3 @@ ro.build.version.incremental=1624448
ro.build.version.sdk=24
ro.build.version.sdk=24
ro.build.version.codename=REL
ro.build.version.codename=REL
'''
;
'''
;
class
FakeAndroidStudioWithJdk
extends
Fake
implements
AndroidStudio
{
@override
String
?
get
javaPath
=>
'/fake/android_studio/java/path/'
;
}
class
FakeAndroidStudioWithoutJdk
extends
Fake
implements
AndroidStudio
{
@override
String
?
get
javaPath
=>
null
;
}
packages/flutter_tools/test/general.shard/artifact_updater_test.dart
View file @
55b6f049
...
@@ -371,7 +371,7 @@ void main() {
...
@@ -371,7 +371,7 @@ void main() {
});
});
testWithoutContext
(
'ArtifactUpdater will de-download a file if unzipping fails on windows'
,
()
async
{
testWithoutContext
(
'ArtifactUpdater will de-download a file if unzipping fails on windows'
,
()
async
{
final
FakeOperatingSystemUtils
operatingSystemUtils
=
FakeOperatingSystemUtils
(
windows:
true
);
final
FakeOperatingSystemUtils
operatingSystemUtils
=
FakeOperatingSystemUtils
();
final
MemoryFileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
MemoryFileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
BufferLogger
logger
=
BufferLogger
.
test
();
final
BufferLogger
logger
=
BufferLogger
.
test
();
final
ArtifactUpdater
artifactUpdater
=
ArtifactUpdater
(
final
ArtifactUpdater
artifactUpdater
=
ArtifactUpdater
(
...
@@ -421,7 +421,7 @@ void main() {
...
@@ -421,7 +421,7 @@ void main() {
});
});
testWithoutContext
(
'ArtifactUpdater will bail if unzipping fails more than twice on Windows'
,
()
async
{
testWithoutContext
(
'ArtifactUpdater will bail if unzipping fails more than twice on Windows'
,
()
async
{
final
FakeOperatingSystemUtils
operatingSystemUtils
=
FakeOperatingSystemUtils
(
windows:
true
);
final
FakeOperatingSystemUtils
operatingSystemUtils
=
FakeOperatingSystemUtils
();
final
MemoryFileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
MemoryFileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
BufferLogger
logger
=
BufferLogger
.
test
();
final
BufferLogger
logger
=
BufferLogger
.
test
();
final
ArtifactUpdater
artifactUpdater
=
ArtifactUpdater
(
final
ArtifactUpdater
artifactUpdater
=
ArtifactUpdater
(
...
@@ -529,10 +529,7 @@ void main() {
...
@@ -529,10 +529,7 @@ void main() {
}
}
class
FakeOperatingSystemUtils
extends
Fake
implements
OperatingSystemUtils
{
class
FakeOperatingSystemUtils
extends
Fake
implements
OperatingSystemUtils
{
FakeOperatingSystemUtils
({
this
.
windows
=
false
});
int
failures
=
0
;
int
failures
=
0
;
final
bool
windows
;
/// A mapping of zip [file] paths to callbacks that receive the [targetDirectory].
/// A mapping of zip [file] paths to callbacks that receive the [targetDirectory].
///
///
...
...
packages/flutter_tools/test/general.shard/ios/simulators_test.dart
View file @
55b6f049
...
@@ -1204,7 +1204,7 @@ class FakeSimControl extends Fake implements SimControl {
...
@@ -1204,7 +1204,7 @@ class FakeSimControl extends Fake implements SimControl {
@override
@override
Future
<
RunResult
>
launch
(
String
deviceId
,
String
appIdentifier
,
[
List
<
String
>?
launchArgs
])
async
{
Future
<
RunResult
>
launch
(
String
deviceId
,
String
appIdentifier
,
[
List
<
String
>?
launchArgs
])
async
{
requests
.
add
(
LaunchRequest
(
deviceId
,
appIdentifier
,
launchArgs
));
requests
.
add
(
LaunchRequest
(
appIdentifier
,
launchArgs
));
return
RunResult
(
ProcessResult
(
0
,
0
,
''
,
''
),
<
String
>[
'test'
]);
return
RunResult
(
ProcessResult
(
0
,
0
,
''
,
''
),
<
String
>[
'test'
]);
}
}
...
@@ -1215,9 +1215,8 @@ class FakeSimControl extends Fake implements SimControl {
...
@@ -1215,9 +1215,8 @@ class FakeSimControl extends Fake implements SimControl {
}
}
class
LaunchRequest
{
class
LaunchRequest
{
const
LaunchRequest
(
this
.
deviceId
,
this
.
appIdentifier
,
this
.
launchArgs
);
const
LaunchRequest
(
this
.
appIdentifier
,
this
.
launchArgs
);
final
String
deviceId
;
final
String
appIdentifier
;
final
String
appIdentifier
;
final
List
<
String
>?
launchArgs
;
final
List
<
String
>?
launchArgs
;
}
}
packages/flutter_tools/test/general.shard/terminal_handler_test.dart
View file @
55b6f049
...
@@ -1496,7 +1496,6 @@ class FakeResidentCompiler extends Fake implements ResidentCompiler { }
...
@@ -1496,7 +1496,6 @@ class FakeResidentCompiler extends Fake implements ResidentCompiler { }
class
TestRunner
extends
Fake
implements
ResidentRunner
{
class
TestRunner
extends
Fake
implements
ResidentRunner
{
bool
hasHelpBeenPrinted
=
false
;
bool
hasHelpBeenPrinted
=
false
;
String
?
receivedCommand
;
@override
@override
Future
<
void
>
cleanupAfterSignal
()
async
{
}
Future
<
void
>
cleanupAfterSignal
()
async
{
}
...
...
packages/flutter_tools/test/general.shard/web/devfs_web_test.dart
View file @
55b6f049
...
@@ -1211,11 +1211,9 @@ class FakeShaderCompiler implements DevelopmentShaderCompiler {
...
@@ -1211,11 +1211,9 @@ class FakeShaderCompiler implements DevelopmentShaderCompiler {
}
}
class
FakeDwds
extends
Fake
implements
Dwds
{
class
FakeDwds
extends
Fake
implements
Dwds
{
FakeDwds
(
this
.
connectedAppsIterable
)
:
FakeDwds
(
Iterable
<
AppConnection
>
connectedAppsIterable
)
:
connectedApps
=
Stream
<
AppConnection
>.
fromIterable
(
connectedAppsIterable
);
connectedApps
=
Stream
<
AppConnection
>.
fromIterable
(
connectedAppsIterable
);
final
Iterable
<
AppConnection
>
connectedAppsIterable
;
@override
@override
final
Stream
<
AppConnection
>
connectedApps
;
final
Stream
<
AppConnection
>
connectedApps
;
...
...
packages/flutter_tools/test/general.shard/web/devices_test.dart
View file @
55b6f049
...
@@ -394,12 +394,6 @@ void main() {
...
@@ -394,12 +394,6 @@ void main() {
class
TestChromiumLauncher
implements
ChromiumLauncher
{
class
TestChromiumLauncher
implements
ChromiumLauncher
{
TestChromiumLauncher
();
TestChromiumLauncher
();
bool
_hasInstance
=
false
;
void
setInstance
(
Chromium
chromium
)
{
_hasInstance
=
true
;
currentCompleter
.
complete
(
chromium
);
}
@override
@override
Completer
<
Chromium
>
currentCompleter
=
Completer
<
Chromium
>();
Completer
<
Chromium
>
currentCompleter
=
Completer
<
Chromium
>();
...
@@ -417,7 +411,7 @@ class TestChromiumLauncher implements ChromiumLauncher {
...
@@ -417,7 +411,7 @@ class TestChromiumLauncher implements ChromiumLauncher {
}
}
@override
@override
bool
get
hasChromeInstance
=>
_hasInstanc
e
;
bool
get
hasChromeInstance
=>
fals
e
;
@override
@override
Future
<
Chromium
>
launch
(
Future
<
Chromium
>
launch
(
...
...
packages/flutter_tools/test/general.shard/xcode_backend_test.dart
View file @
55b6f049
...
@@ -234,11 +234,6 @@ class TestContext extends Context {
...
@@ -234,11 +234,6 @@ class TestContext extends Context {
String
stdout
=
''
;
String
stdout
=
''
;
String
stderr
=
''
;
String
stderr
=
''
;
@override
bool
existsDir
(
String
path
)
{
return
fileSystem
.
directory
(
path
).
existsSync
();
}
@override
@override
bool
existsFile
(
String
path
)
{
bool
existsFile
(
String
path
)
{
return
fileSystem
.
file
(
path
).
existsSync
();
return
fileSystem
.
file
(
path
).
existsSync
();
...
...
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