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
4f2e7987
Unverified
Commit
4f2e7987
authored
Apr 23, 2021
by
Abhishek Ghaskata
Committed by
GitHub
Apr 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate external_ui to null safety (#80640)
parent
4825c639
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
25 deletions
+25
-25
main.dart
dev/integration_tests/external_ui/lib/main.dart
+12
-12
pubspec.yaml
dev/integration_tests/external_ui/pubspec.yaml
+1
-1
main_test.dart
dev/integration_tests/external_ui/test_driver/main_test.dart
+12
-12
No files found.
dev/integration_tests/external_ui/lib/main.dart
View file @
4f2e7987
...
...
@@ -15,7 +15,7 @@ void main() {
}
class
MyApp
extends
StatefulWidget
{
const
MyApp
({
Key
key
})
:
super
(
key:
key
);
const
MyApp
({
Key
?
key
})
:
super
(
key:
key
);
@override
State
createState
()
=>
MyAppState
();
...
...
@@ -27,17 +27,17 @@ enum FrameState { initial, slow, afterSlow, fast, afterFast }
class
MyAppState
extends
State
<
MyApp
>
with
SingleTickerProviderStateMixin
{
int
_widgetBuilds
=
0
;
FrameState
_state
;
FrameState
_state
=
FrameState
.
initial
;
String
_summary
=
''
;
IconData
_icon
;
double
_flutterFrameRate
;
IconData
?
_icon
;
double
_flutterFrameRate
=
0
;
Future
<
void
>
_summarizeStats
()
async
{
final
double
framesProduced
=
await
channel
.
invokeMethod
(
'getProducedFrameRate'
);
final
double
framesConsumed
=
await
channel
.
invokeMethod
(
'getConsumedFrameRate'
);
final
double
?
framesProduced
=
await
channel
.
invokeMethod
(
'getProducedFrameRate'
);
final
double
?
framesConsumed
=
await
channel
.
invokeMethod
(
'getConsumedFrameRate'
);
_summary
=
'''
Produced:
${framesProduced.toStringAsFixed(1)}
fps
Consumed:
${framesConsumed.toStringAsFixed(1)}
fps
Produced:
${framesProduced
?
.toStringAsFixed(1)}
fps
Consumed:
${framesConsumed
?
.toStringAsFixed(1)}
fps
Widget builds:
$_widgetBuilds
'''
;
}
...
...
@@ -96,15 +96,15 @@ Widget builds: $_widgetBuilds''';
debugPrint
(
'Awaiting calm (3 second pause)...'
);
await
Future
<
void
>.
delayed
(
const
Duration
(
milliseconds:
3000
));
debugPrint
(
'Calibrating...'
);
DateTime
startTime
;
late
DateTime
startTime
;
int
tickCount
=
0
;
Ticker
ticker
;
Ticker
?
ticker
;
ticker
=
createTicker
((
Duration
time
)
{
tickCount
+=
1
;
if
(
tickCount
==
calibrationTickCount
)
{
// about 10 seconds
final
Duration
elapsed
=
DateTime
.
now
().
difference
(
startTime
);
ticker
.
stop
();
ticker
.
dispose
();
ticker
?
.
stop
();
ticker
?
.
dispose
();
setState
(()
{
_flutterFrameRate
=
tickCount
*
1000
/
elapsed
.
inMilliseconds
;
debugPrint
(
'Calibrated: frame rate
${_flutterFrameRate.toStringAsFixed(1)}
fps.'
);
...
...
dev/integration_tests/external_ui/pubspec.yaml
View file @
4f2e7987
...
...
@@ -2,7 +2,7 @@ name: external_ui
description
:
A test of Flutter integrating external UIs.
environment
:
sdk
:
"
>=2.
0.0-dev.68
.0
<3.0.0"
sdk
:
"
>=2.
12
.0
<3.0.0"
dependencies
:
flutter
:
...
...
dev/integration_tests/external_ui/test_driver/main_test.dart
View file @
4f2e7987
...
...
@@ -13,7 +13,7 @@ const Duration samplingTime = Duration(seconds: 8);
Future
<
void
>
main
()
async
{
group
(
'texture suite'
,
()
{
FlutterDriver
driver
;
late
FlutterDriver
driver
;
setUpAll
(()
async
{
driver
=
await
FlutterDriver
.
connect
();
...
...
@@ -32,9 +32,9 @@ Future<void> main() async {
await
driver
.
waitFor
(
fab
);
final
String
calibrationResult
=
await
driver
.
getText
(
summary
);
final
Match
matchCalibration
=
calibrationRegExp
.
matchAsPrefix
(
calibrationResult
);
final
Match
?
matchCalibration
=
calibrationRegExp
.
matchAsPrefix
(
calibrationResult
);
expect
(
matchCalibration
,
isNotNull
);
final
double
flutterFrameRate
=
double
.
parse
(
matchCalibration
.
group
(
1
)
);
final
double
flutterFrameRate
=
double
.
parse
(
matchCalibration
?.
group
(
1
)
??
'0'
);
// Texture frame stats at 0.5x Flutter frame rate
await
driver
.
tap
(
fab
);
...
...
@@ -42,11 +42,11 @@ Future<void> main() async {
await
driver
.
tap
(
fab
);
final
String
statsSlow
=
await
driver
.
getText
(
summary
);
final
Match
matchSlow
=
statsRegExp
.
matchAsPrefix
(
statsSlow
);
final
Match
matchSlow
=
statsRegExp
.
matchAsPrefix
(
statsSlow
)
!
;
expect
(
matchSlow
,
isNotNull
);
expect
(
double
.
parse
(
matchSlow
.
group
(
1
)),
closeTo
(
flutterFrameRate
/
2.0
,
5.0
));
expect
(
double
.
parse
(
matchSlow
.
group
(
2
)),
closeTo
(
flutterFrameRate
/
2.0
,
5.0
));
expect
(
int
.
parse
(
matchSlow
.
group
(
3
)),
1
);
expect
(
double
.
parse
(
matchSlow
.
group
(
1
)
!
),
closeTo
(
flutterFrameRate
/
2.0
,
5.0
));
expect
(
double
.
parse
(
matchSlow
.
group
(
2
)
!
),
closeTo
(
flutterFrameRate
/
2.0
,
5.0
));
expect
(
int
.
parse
(
matchSlow
.
group
(
3
)
!
),
1
);
// Texture frame stats at 2.0x Flutter frame rate
await
driver
.
tap
(
fab
);
...
...
@@ -54,15 +54,15 @@ Future<void> main() async {
await
driver
.
tap
(
fab
);
final
String
statsFast
=
await
driver
.
getText
(
summary
);
final
Match
matchFast
=
statsRegExp
.
matchAsPrefix
(
statsFast
);
final
Match
matchFast
=
statsRegExp
.
matchAsPrefix
(
statsFast
)
!
;
expect
(
matchFast
,
isNotNull
);
expect
(
double
.
parse
(
matchFast
.
group
(
1
)),
closeTo
(
flutterFrameRate
*
2.0
,
5.0
));
expect
(
double
.
parse
(
matchFast
.
group
(
2
)),
closeTo
(
flutterFrameRate
,
10.0
));
expect
(
int
.
parse
(
matchFast
.
group
(
3
)),
1
);
expect
(
double
.
parse
(
matchFast
.
group
(
1
)
!
),
closeTo
(
flutterFrameRate
*
2.0
,
5.0
));
expect
(
double
.
parse
(
matchFast
.
group
(
2
)
!
),
closeTo
(
flutterFrameRate
,
10.0
));
expect
(
int
.
parse
(
matchFast
.
group
(
3
)
!
),
1
);
});
tearDownAll
(()
async
{
driver
?
.
close
();
driver
.
close
();
});
});
}
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