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
28ecf056
Unverified
Commit
28ecf056
authored
Nov 11, 2020
by
Jonah Williams
Committed by
GitHub
Nov 11, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[null-safety] opt driver tests into null safety (#70245)
parent
425ae862
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
23 deletions
+17
-23
run_demos.dart
...egration_tests/flutter_gallery/test_driver/run_demos.dart
+1
-2
scroll_perf.dart
...ration_tests/flutter_gallery/test_driver/scroll_perf.dart
+0
-1
transitions_perf.dart
...n_tests/flutter_gallery/test_driver/transitions_perf.dart
+6
-7
back_button.dart
...ration_tests/flutter_gallery/test_memory/back_button.dart
+3
-4
image_cache_memory.dart
...tests/flutter_gallery/test_memory/image_cache_memory.dart
+2
-3
memory_nav.dart
...gration_tests/flutter_gallery/test_memory/memory_nav.dart
+5
-6
No files found.
dev/integration_tests/flutter_gallery/test_driver/run_demos.dart
View file @
28ecf056
...
...
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.9
import
'dart:ui'
;
import
'package:flutter/cupertino.dart'
;
...
...
@@ -26,7 +25,7 @@ final List<String> kSkippedDemos = <String>[
/// home screen twice.
Future
<
void
>
runDemos
(
List
<
String
>
demos
,
WidgetController
controller
)
async
{
final
Finder
demoList
=
find
.
byType
(
Scrollable
);
String
currentDemoCategory
;
String
?
currentDemoCategory
;
for
(
final
String
demo
in
demos
)
{
if
(
kSkippedDemos
.
contains
(
demo
))
...
...
dev/integration_tests/flutter_gallery/test_driver/scroll_perf.dart
View file @
28ecf056
...
...
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.9
import
'package:flutter_driver/driver_extension.dart'
;
import
'package:flutter_gallery/gallery/app.dart'
show
GalleryApp
;
import
'package:flutter/material.dart'
;
...
...
dev/integration_tests/flutter_gallery/test_driver/transitions_perf.dart
View file @
28ecf056
...
...
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.9
import
'dart:convert'
show
JsonEncoder
;
import
'package:flutter_driver/driver_extension.dart'
;
...
...
@@ -25,20 +24,20 @@ List<String> _allDemos = kAllGalleryDemos.map(
Set
<
String
>
_unTestedDemos
=
Set
<
String
>.
from
(
_allDemos
);
class
_MessageHandler
{
static
LiveWidgetController
controller
;
static
LiveWidgetController
?
controller
;
Future
<
String
>
call
(
String
message
)
async
{
switch
(
message
)
{
case
'demoNames'
:
return
const
JsonEncoder
.
withIndent
(
' '
).
convert
(
_allDemos
);
case
'profileDemos'
:
controller
??=
LiveWidgetController
(
WidgetsBinding
.
instance
);
await
runDemos
(
kProfiledDemos
,
controller
);
controller
??=
LiveWidgetController
(
WidgetsBinding
.
instance
!
);
await
runDemos
(
kProfiledDemos
,
controller
!
);
_unTestedDemos
.
removeAll
(
kProfiledDemos
);
return
const
JsonEncoder
.
withIndent
(
' '
).
convert
(
kProfiledDemos
);
case
'restDemos'
:
controller
??=
LiveWidgetController
(
WidgetsBinding
.
instance
);
controller
??=
LiveWidgetController
(
WidgetsBinding
.
instance
!
);
final
List
<
String
>
restDemos
=
_unTestedDemos
.
toList
();
await
runDemos
(
restDemos
,
controller
);
await
runDemos
(
restDemos
,
controller
!
);
return
const
JsonEncoder
.
withIndent
(
' '
).
convert
(
restDemos
);
default
:
throw
ArgumentError
;
...
...
@@ -47,7 +46,7 @@ class _MessageHandler {
}
void
main
(
)
{
enableFlutterDriverExtension
(
handler:
_MessageHandler
().
call
);
enableFlutterDriverExtension
(
handler:
(
String
?
message
)
=>
_MessageHandler
().
call
(
message
!)
);
// As in lib/main.dart: overriding https://github.com/flutter/flutter/issues/13736
// for better visual effect at the cost of performance.
runApp
(
const
GalleryApp
(
testMode:
true
));
...
...
dev/integration_tests/flutter_gallery/test_memory/back_button.dart
View file @
28ecf056
...
...
@@ -4,7 +4,6 @@
// See //dev/devicelab/bin/tasks/flutter_gallery__memory_nav.dart
// @dart = 2.9
import
'package:flutter/material.dart'
;
import
'package:flutter/scheduler.dart'
;
import
'package:flutter_gallery/gallery/app.dart'
show
GalleryApp
;
...
...
@@ -12,8 +11,8 @@ import 'package:flutter_test/flutter_test.dart';
Future
<
void
>
endOfAnimation
()
async
{
do
{
await
SchedulerBinding
.
instance
.
endOfFrame
;
}
while
(
SchedulerBinding
.
instance
.
hasScheduledFrame
);
await
SchedulerBinding
.
instance
!
.
endOfFrame
;
}
while
(
SchedulerBinding
.
instance
!
.
hasScheduledFrame
);
}
int
iteration
=
0
;
...
...
@@ -31,5 +30,5 @@ Future<void> main() async {
await
endOfAnimation
();
await
Future
<
void
>.
delayed
(
const
Duration
(
milliseconds:
50
));
debugPrint
(
'==== MEMORY BENCHMARK ==== READY ===='
);
WidgetsBinding
.
instance
.
addObserver
(
LifecycleObserver
());
WidgetsBinding
.
instance
!
.
addObserver
(
LifecycleObserver
());
}
dev/integration_tests/flutter_gallery/test_memory/image_cache_memory.dart
View file @
28ecf056
...
...
@@ -4,7 +4,6 @@
// See //dev/devicelab/bin/tasks/flutter_gallery__image_cache_memory.dart
// @dart = 2.9
import
'package:flutter/widgets.dart'
;
import
'package:flutter/scheduler.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
...
...
@@ -39,7 +38,7 @@ Future<void> main() async {
),
));
await
SchedulerBinding
.
instance
.
endOfFrame
;
await
SchedulerBinding
.
instance
!
.
endOfFrame
;
// We are waiting for the GPU to rasterize a frame here. This makes this
// flaky, we can rely on a more deterministic source such as
...
...
@@ -49,7 +48,7 @@ Future<void> main() async {
debugPrint
(
'==== MEMORY BENCHMARK ==== READY ===='
);
final
WidgetController
controller
=
LiveWidgetController
(
WidgetsBinding
.
instance
);
LiveWidgetController
(
WidgetsBinding
.
instance
!
);
debugPrint
(
'Scrolling...'
);
final
Finder
list
=
find
.
byKey
(
const
Key
(
'ImageList'
));
...
...
dev/integration_tests/flutter_gallery/test_memory/memory_nav.dart
View file @
28ecf056
...
...
@@ -4,7 +4,6 @@
// See //dev/devicelab/bin/tasks/flutter_gallery__memory_nav.dart
// @dart = 2.9
import
'dart:async'
;
import
'package:flutter/material.dart'
;
...
...
@@ -14,8 +13,8 @@ import 'package:flutter_test/flutter_test.dart';
Future
<
void
>
endOfAnimation
()
async
{
do
{
await
SchedulerBinding
.
instance
.
endOfFrame
;
}
while
(
SchedulerBinding
.
instance
.
hasScheduledFrame
);
await
SchedulerBinding
.
instance
!
.
endOfFrame
;
}
while
(
SchedulerBinding
.
instance
!
.
hasScheduledFrame
);
}
Rect
boundsFor
(
WidgetController
controller
,
Finder
item
)
{
...
...
@@ -36,7 +35,7 @@ Future<void> main() async {
child:
GalleryApp
(
testMode:
true
),
),
));
await
SchedulerBinding
.
instance
.
endOfFrame
;
await
SchedulerBinding
.
instance
!
.
endOfFrame
;
await
Future
<
void
>.
delayed
(
const
Duration
(
milliseconds:
50
));
debugPrint
(
'==== MEMORY BENCHMARK ==== READY ===='
);
...
...
@@ -50,9 +49,9 @@ Future<void> main() async {
child:
GalleryApp
(
testMode:
true
),
),
));
await
SchedulerBinding
.
instance
.
endOfFrame
;
await
SchedulerBinding
.
instance
!
.
endOfFrame
;
final
WidgetController
controller
=
LiveWidgetController
(
WidgetsBinding
.
instance
);
final
WidgetController
controller
=
LiveWidgetController
(
WidgetsBinding
.
instance
!
);
debugPrint
(
'Navigating...'
);
await
controller
.
tap
(
find
.
text
(
'Material'
));
...
...
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