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
a03f59cd
Unverified
Commit
a03f59cd
authored
Apr 27, 2022
by
Phil Quitslund
Committed by
GitHub
Apr 27, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_driver] rename local functions with `_`s (#102689)
parent
401df0eb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
27 deletions
+27
-27
vmservice_driver.dart
packages/flutter_driver/lib/src/driver/vmservice_driver.dart
+5
-5
timeline_summary_test.dart
...ter_driver/test/src/real_tests/timeline_summary_test.dart
+22
-22
No files found.
packages/flutter_driver/lib/src/driver/vmservice_driver.dart
View file @
a03f59cd
...
...
@@ -86,22 +86,22 @@ class VMServiceFlutterDriver extends FlutterDriver {
_log
(
'Connecting to Flutter application at
$dartVmServiceUrl
'
);
final
vms
.
VmService
client
=
await
vmServiceConnectFunction
(
dartVmServiceUrl
,
headers
);
Future
<
vms
.
IsolateRef
?>
_
waitForRootIsolate
()
async
{
bool
_
checkIsolate
(
vms
.
IsolateRef
ref
)
=>
ref
.
number
==
isolateNumber
.
toString
();
Future
<
vms
.
IsolateRef
?>
waitForRootIsolate
()
async
{
bool
checkIsolate
(
vms
.
IsolateRef
ref
)
=>
ref
.
number
==
isolateNumber
.
toString
();
while
(
true
)
{
final
vms
.
VM
vm
=
await
client
.
getVM
();
if
(
vm
.
isolates
!.
isEmpty
||
(
isolateNumber
!=
null
&&
!
vm
.
isolates
!.
any
(
_
checkIsolate
)))
{
if
(
vm
.
isolates
!.
isEmpty
||
(
isolateNumber
!=
null
&&
!
vm
.
isolates
!.
any
(
checkIsolate
)))
{
await
Future
<
void
>.
delayed
(
_kPauseBetweenReconnectAttempts
);
continue
;
}
return
isolateNumber
==
null
?
vm
.
isolates
!.
first
:
vm
.
isolates
!.
firstWhere
(
_
checkIsolate
);
:
vm
.
isolates
!.
firstWhere
(
checkIsolate
);
}
}
final
vms
.
IsolateRef
isolateRef
=
(
await
_warnIfSlow
<
vms
.
IsolateRef
?>(
future:
_
waitForRootIsolate
(),
future:
waitForRootIsolate
(),
timeout:
kUnusuallyLongTimeout
,
message:
isolateNumber
==
null
?
'The root isolate is taking an unusually long time to start.'
...
...
packages/flutter_driver/test/src/real_tests/timeline_summary_test.dart
View file @
a03f59cd
...
...
@@ -101,7 +101,7 @@ void main() {
},
};
List
<
Map
<
String
,
dynamic
>>
_
genGC
(
String
name
,
int
count
,
int
startTime
,
int
timeDiff
)
{
List
<
Map
<
String
,
dynamic
>>
genGC
(
String
name
,
int
count
,
int
startTime
,
int
timeDiff
)
{
int
ts
=
startTime
;
bool
begin
=
true
;
final
List
<
Map
<
String
,
dynamic
>>
ret
=
<
Map
<
String
,
dynamic
>>[];
...
...
@@ -125,11 +125,11 @@ void main() {
}
List
<
Map
<
String
,
dynamic
>>
newGenGC
(
int
count
,
int
startTime
,
int
timeDiff
)
{
return
_
genGC
(
'CollectNewGeneration'
,
count
,
startTime
,
timeDiff
);
return
genGC
(
'CollectNewGeneration'
,
count
,
startTime
,
timeDiff
);
}
List
<
Map
<
String
,
dynamic
>>
oldGenGC
(
int
count
,
int
startTime
,
int
timeDiff
)
{
return
_
genGC
(
'CollectOldGeneration'
,
count
,
startTime
,
timeDiff
);
return
genGC
(
'CollectOldGeneration'
,
count
,
startTime
,
timeDiff
);
}
List
<
Map
<
String
,
dynamic
>>
rasterizeTimeSequenceInMillis
(
List
<
int
>
sequence
)
{
...
...
@@ -756,14 +756,14 @@ void main() {
group
(
'RefreshRateSummarizer tests'
,
()
{
const
double
kCompareDelta
=
0.01
;
RefreshRateSummary
_summarize
(
List
<
Map
<
String
,
dynamic
>>
traceEvents
)
{
RefreshRateSummary
summarizeRefresh
(
List
<
Map
<
String
,
dynamic
>>
traceEvents
)
{
final
Timeline
timeline
=
Timeline
.
fromJson
(<
String
,
dynamic
>{
'traceEvents'
:
traceEvents
,
});
return
RefreshRateSummary
(
vsyncEvents:
timeline
.
events
!);
}
List
<
Map
<
String
,
dynamic
>>
_
populateEvents
({
required
int
numberOfEvents
,
required
int
startTime
,
required
int
interval
,
required
int
margin
})
{
List
<
Map
<
String
,
dynamic
>>
populateEvents
({
required
int
numberOfEvents
,
required
int
startTime
,
required
int
interval
,
required
int
margin
})
{
final
List
<
Map
<
String
,
dynamic
>>
events
=
<
Map
<
String
,
dynamic
>>[];
int
startTimeInNanoseconds
=
startTime
;
for
(
int
i
=
0
;
i
<
numberOfEvents
;
i
++)
{
...
...
@@ -780,12 +780,12 @@ void main() {
const
int
intervalInNanoseconds
=
33333333
;
// allow some margins
const
int
margin
=
3000000
;
final
List
<
Map
<
String
,
dynamic
>>
events
=
_
populateEvents
(
numberOfEvents:
100
,
final
List
<
Map
<
String
,
dynamic
>>
events
=
populateEvents
(
numberOfEvents:
100
,
startTime:
startTimeInNanoseconds
,
interval:
intervalInNanoseconds
,
margin:
margin
,
);
final
RefreshRateSummary
summary
=
_summarize
(
events
);
final
RefreshRateSummary
summary
=
summarizeRefresh
(
events
);
expect
(
summary
.
percentageOf30HzFrames
,
closeTo
(
100
,
kCompareDelta
));
expect
(
summary
.
percentageOf60HzFrames
,
0
);
expect
(
summary
.
percentageOf90HzFrames
,
0
);
...
...
@@ -798,13 +798,13 @@ void main() {
const
int
intervalInNanoseconds
=
16666666
;
// allow some margins
const
int
margin
=
1200000
;
final
List
<
Map
<
String
,
dynamic
>>
events
=
_
populateEvents
(
numberOfEvents:
100
,
final
List
<
Map
<
String
,
dynamic
>>
events
=
populateEvents
(
numberOfEvents:
100
,
startTime:
startTimeInNanoseconds
,
interval:
intervalInNanoseconds
,
margin:
margin
,
);
final
RefreshRateSummary
summary
=
_summarize
(
events
);
final
RefreshRateSummary
summary
=
summarizeRefresh
(
events
);
expect
(
summary
.
percentageOf30HzFrames
,
0
);
expect
(
summary
.
percentageOf60HzFrames
,
closeTo
(
100
,
kCompareDelta
));
expect
(
summary
.
percentageOf90HzFrames
,
0
);
...
...
@@ -817,13 +817,13 @@ void main() {
const
int
intervalInNanoseconds
=
11111111
;
// allow some margins
const
int
margin
=
500000
;
final
List
<
Map
<
String
,
dynamic
>>
events
=
_
populateEvents
(
numberOfEvents:
100
,
final
List
<
Map
<
String
,
dynamic
>>
events
=
populateEvents
(
numberOfEvents:
100
,
startTime:
startTimeInNanoseconds
,
interval:
intervalInNanoseconds
,
margin:
margin
,
);
final
RefreshRateSummary
summary
=
_summarize
(
events
);
final
RefreshRateSummary
summary
=
summarizeRefresh
(
events
);
expect
(
summary
.
percentageOf30HzFrames
,
0
);
expect
(
summary
.
percentageOf60HzFrames
,
0
);
expect
(
summary
.
percentageOf90HzFrames
,
closeTo
(
100
,
kCompareDelta
));
...
...
@@ -836,12 +836,12 @@ void main() {
const
int
intervalInNanoseconds
=
8333333
;
// allow some margins
const
int
margin
=
300000
;
final
List
<
Map
<
String
,
dynamic
>>
events
=
_
populateEvents
(
numberOfEvents:
100
,
final
List
<
Map
<
String
,
dynamic
>>
events
=
populateEvents
(
numberOfEvents:
100
,
startTime:
startTimeInNanoseconds
,
interval:
intervalInNanoseconds
,
margin:
margin
,
);
final
RefreshRateSummary
summary
=
_summarize
(
events
);
final
RefreshRateSummary
summary
=
summarizeRefresh
(
events
);
expect
(
summary
.
percentageOf30HzFrames
,
0
);
expect
(
summary
.
percentageOf60HzFrames
,
0
);
expect
(
summary
.
percentageOf90HzFrames
,
0
);
...
...
@@ -852,12 +852,12 @@ void main() {
test
(
'Identify illegal refresh rates.'
,
()
async
{
const
int
startTimeInNanoseconds
=
2750850055430
;
const
int
intervalInNanoseconds
=
10000000
;
final
List
<
Map
<
String
,
dynamic
>>
events
=
_
populateEvents
(
numberOfEvents:
1
,
final
List
<
Map
<
String
,
dynamic
>>
events
=
populateEvents
(
numberOfEvents:
1
,
startTime:
startTimeInNanoseconds
,
interval:
intervalInNanoseconds
,
margin:
0
,
);
final
RefreshRateSummary
summary
=
_summarize
(
events
);
final
RefreshRateSummary
summary
=
summarizeRefresh
(
events
);
expect
(
summary
.
percentageOf30HzFrames
,
0
);
expect
(
summary
.
percentageOf60HzFrames
,
0
);
expect
(
summary
.
percentageOf90HzFrames
,
0
);
...
...
@@ -878,48 +878,48 @@ void main() {
const
int
totalFrames
=
num30Hz
+
num60Hz
+
num80Hz
+
num90Hz
+
num120Hz
+
numIllegal
;
// Add 30hz frames
events
.
addAll
(
_
populateEvents
(
numberOfEvents:
num30Hz
,
events
.
addAll
(
populateEvents
(
numberOfEvents:
num30Hz
,
startTime:
0
,
interval:
32000000
,
margin:
0
,
));
// Add 60hz frames
events
.
addAll
(
_
populateEvents
(
numberOfEvents:
num60Hz
,
events
.
addAll
(
populateEvents
(
numberOfEvents:
num60Hz
,
startTime:
0
,
interval:
16000000
,
margin:
0
,
));
// Add 80hz frames
events
.
addAll
(
_
populateEvents
(
numberOfEvents:
num80Hz
,
events
.
addAll
(
populateEvents
(
numberOfEvents:
num80Hz
,
startTime:
0
,
interval:
12000000
,
margin:
0
,
));
// Add 90hz frames
events
.
addAll
(
_
populateEvents
(
numberOfEvents:
num90Hz
,
events
.
addAll
(
populateEvents
(
numberOfEvents:
num90Hz
,
startTime:
0
,
interval:
11000000
,
margin:
0
,
));
// Add 120hz frames
events
.
addAll
(
_
populateEvents
(
numberOfEvents:
num120Hz
,
events
.
addAll
(
populateEvents
(
numberOfEvents:
num120Hz
,
startTime:
0
,
interval:
8000000
,
margin:
0
,
));
// Add illegal refresh rate frames
events
.
addAll
(
_
populateEvents
(
numberOfEvents:
numIllegal
,
events
.
addAll
(
populateEvents
(
numberOfEvents:
numIllegal
,
startTime:
0
,
interval:
60000
,
margin:
0
,
));
final
RefreshRateSummary
summary
=
_summarize
(
events
);
final
RefreshRateSummary
summary
=
summarizeRefresh
(
events
);
expect
(
summary
.
percentageOf30HzFrames
,
closeTo
(
num30Hz
/
totalFrames
*
100
,
kCompareDelta
));
expect
(
summary
.
percentageOf60HzFrames
,
closeTo
(
num60Hz
/
totalFrames
*
100
,
kCompareDelta
));
...
...
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