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
04bc6123
Unverified
Commit
04bc6123
authored
Aug 12, 2020
by
Jonah Williams
Committed by
GitHub
Aug 12, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[null-safety] update to several framework test cases/APIs for null assertions (#62946)
parent
7d1842bf
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
19 additions
and
19 deletions
+19
-19
diagnostics.dart
packages/flutter/lib/src/foundation/diagnostics.dart
+1
-1
image_cache.dart
packages/flutter/lib/src/painting/image_cache.dart
+0
-1
binary_messenger.dart
packages/flutter/lib/src/services/binary_messenger.dart
+2
-2
binding.dart
packages/flutter/lib/src/services/binding.dart
+4
-4
platform_channel.dart
packages/flutter/lib/src/services/platform_channel.dart
+0
-1
change_notifier_test.dart
packages/flutter/test/foundation/change_notifier_test.dart
+2
-2
image_provider_test.dart
packages/flutter/test/painting/image_provider_test.dart
+3
-1
ticker_test.dart
packages/flutter/test/scheduler/ticker_test.dart
+1
-1
binding_test.dart
packages/flutter/test/widgets/binding_test.dart
+1
-1
image_test.dart
packages/flutter/test/widgets/image_test.dart
+4
-4
window.dart
packages/flutter_test/lib/src/window.dart
+1
-1
No files found.
packages/flutter/lib/src/foundation/diagnostics.dart
View file @
04bc6123
...
...
@@ -2053,7 +2053,7 @@ class PercentProperty extends DoubleProperty {
/// The [showName] and [level] arguments must not be null.
PercentProperty
(
String
name
,
double
fraction
,
{
double
?
fraction
,
{
String
?
ifNull
,
bool
showName
=
true
,
String
?
tooltip
,
...
...
packages/flutter/lib/src/painting/image_cache.dart
View file @
04bc6123
...
...
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:developer'
;
import
'dart:ui'
show
hashValues
;
...
...
packages/flutter/lib/src/services/binary_messenger.dart
View file @
04bc6123
...
...
@@ -49,7 +49,7 @@ abstract class BinaryMessenger {
///
/// This method is useful for tests or test harnesses that want to assert the
/// handler for the specified channel has not been altered by a previous test.
bool
checkMessageHandler
(
String
channel
,
MessageHandler
handler
);
bool
checkMessageHandler
(
String
channel
,
MessageHandler
?
handler
);
/// Set a mock callback for intercepting messages from the [send] method on
/// this class, on the given channel, without decoding them.
...
...
@@ -70,7 +70,7 @@ abstract class BinaryMessenger {
/// This method is useful for tests or test harnesses that want to assert the
/// mock handler for the specified channel has not been altered by a previous
/// test.
bool
checkMockMessageHandler
(
String
channel
,
MessageHandler
handler
);
bool
checkMockMessageHandler
(
String
channel
,
MessageHandler
?
handler
);
}
/// The default instance of [BinaryMessenger].
...
...
packages/flutter/lib/src/services/binding.dart
View file @
04bc6123
...
...
@@ -216,8 +216,8 @@ mixin ServicesBinding on BindingBase, SchedulerBinding {
/// To use a different [RestorationManager] subclasses can override
/// [createRestorationManager], which is called to create the instance
/// returned by this getter.
RestorationManager
get
restorationManager
=>
_restorationManager
;
late
RestorationManager
_restorationManager
;
RestorationManager
get
restorationManager
=>
_restorationManager
!
;
RestorationManager
?
_restorationManager
;
/// Creates the [RestorationManager] instance available via
/// [restorationManager].
...
...
@@ -319,7 +319,7 @@ class _DefaultBinaryMessenger extends BinaryMessenger {
}
@override
bool
checkMessageHandler
(
String
channel
,
MessageHandler
handler
)
=>
_handlers
[
channel
]
==
handler
;
bool
checkMessageHandler
(
String
channel
,
MessageHandler
?
handler
)
=>
_handlers
[
channel
]
==
handler
;
@override
void
setMockMessageHandler
(
String
channel
,
MessageHandler
?
handler
)
{
...
...
@@ -330,5 +330,5 @@ class _DefaultBinaryMessenger extends BinaryMessenger {
}
@override
bool
checkMockMessageHandler
(
String
channel
,
MessageHandler
handler
)
=>
_mockHandlers
[
channel
]
==
handler
;
bool
checkMockMessageHandler
(
String
channel
,
MessageHandler
?
handler
)
=>
_mockHandlers
[
channel
]
==
handler
;
}
packages/flutter/lib/src/services/platform_channel.dart
View file @
04bc6123
...
...
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:async'
;
import
'dart:typed_data'
;
...
...
packages/flutter/test/foundation/change_notifier_test.dart
View file @
04bc6123
...
...
@@ -210,8 +210,8 @@ void main() {
test
(
'Cannot use a disposed ChangeNotifier'
,
()
{
final
TestNotifier
source
=
TestNotifier
();
source
.
dispose
();
expect
(()
{
source
.
addListener
(
null
);
},
throwsFlutterError
);
expect
(()
{
source
.
removeListener
(
null
);
},
throwsFlutterError
);
expect
(()
{
source
.
addListener
(
()
{
}
);
},
throwsFlutterError
);
expect
(()
{
source
.
removeListener
(
()
{
}
);
},
throwsFlutterError
);
expect
(()
{
source
.
dispose
();
},
throwsFlutterError
);
expect
(()
{
source
.
notify
();
},
throwsFlutterError
);
});
...
...
packages/flutter/test/painting/image_provider_test.dart
View file @
04bc6123
...
...
@@ -136,7 +136,9 @@ void main() {
final
File
file
=
fs
.
file
(
'/empty.png'
)..
createSync
(
recursive:
true
);
final
FileImage
provider
=
FileImage
(
file
);
expect
(
provider
.
load
(
provider
,
null
),
isA
<
MultiFrameImageStreamCompleter
>());
expect
(
provider
.
load
(
provider
,
(
Uint8List
bytes
,
{
int
cacheWidth
,
int
cacheHeight
,
bool
allowUpscaling
})
async
{
return
Future
<
Codec
>.
value
(
FakeCodec
());
}),
isA
<
MultiFrameImageStreamCompleter
>());
expect
(
await
error
.
future
,
isStateError
);
});
...
...
packages/flutter/test/scheduler/ticker_test.dart
View file @
04bc6123
...
...
@@ -96,7 +96,7 @@ void main() {
Ticker
ticker
;
void
testFunction
()
{
ticker
=
Ticker
(
null
);
ticker
=
Ticker
(
(
Duration
_
)
{
}
);
}
testFunction
();
...
...
packages/flutter/test/widgets/binding_test.dart
View file @
04bc6123
...
...
@@ -194,7 +194,7 @@ void main() {
testWidgets
(
'scheduleFrameCallback error control test'
,
(
WidgetTester
tester
)
async
{
FlutterError
error
;
try
{
tester
.
binding
.
scheduleFrameCallback
(
null
,
rescheduling:
true
);
tester
.
binding
.
scheduleFrameCallback
(
(
Duration
_
)
{
}
,
rescheduling:
true
);
}
on
FlutterError
catch
(
e
)
{
error
=
e
;
}
...
...
packages/flutter/test/widgets/image_test.dart
View file @
04bc6123
...
...
@@ -797,12 +797,12 @@ void main() {
expect
(
listeners
.
length
,
2
);
// Make sure the first listener can be called re-entrantly
listeners
[
1
].
onImage
(
null
,
null
);
listeners
[
1
].
onImage
(
null
,
null
);
listeners
[
1
].
onImage
(
null
,
false
);
listeners
[
1
].
onImage
(
null
,
false
);
// Make sure the second listener can be called re-entrantly.
listeners
[
0
].
onImage
(
null
,
null
);
listeners
[
0
].
onImage
(
null
,
null
);
listeners
[
0
].
onImage
(
null
,
false
);
listeners
[
0
].
onImage
(
null
,
false
);
});
testWidgets
(
'Precache completes with onError on error'
,
(
WidgetTester
tester
)
async
{
...
...
packages/flutter_test/lib/src/window.dart
View file @
04bc6123
...
...
@@ -190,7 +190,7 @@ class TestWindow implements Window {
@override
String
get
initialLifecycleState
=>
_initialLifecycleStateTestValue
;
String
_initialLifecycleStateTestValue
;
String
_initialLifecycleStateTestValue
=
''
;
/// Sets a faked initialLifecycleState for testing.
set
initialLifecycleStateTestValue
(
String
state
)
{
_initialLifecycleStateTestValue
=
state
;
...
...
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