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
bce5574c
Unverified
Commit
bce5574c
authored
Nov 29, 2017
by
Mikkel Nygaard Ravn
Committed by
GitHub
Nov 29, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove test flakiness (#13252)
parent
368c1251
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
MainActivity.java
...app/src/main/java/io/flutter/externalui/MainActivity.java
+12
-4
main_test.dart
dev/integration_tests/external_ui/test_driver/main_test.dart
+1
-1
No files found.
dev/integration_tests/external_ui/android/app/src/main/java/io/flutter/externalui/MainActivity.java
View file @
bce5574c
...
...
@@ -52,8 +52,11 @@ public class MainActivity extends FlutterActivity {
producerTimer
.
scheduleAtFixedRate
(
new
TimerTask
()
{
@Override
public
void
run
()
{
renderer
.
drawFrame
();
framesProduced
.
incrementAndGet
();
final
long
time
=
System
.
currentTimeMillis
();
if
(
frameRate
(
framesProduced
,
startTime
,
time
)
<
fps
)
{
renderer
.
drawFrame
();
framesProduced
.
incrementAndGet
();
}
}
},
0
,
1000
/
fps
);
consumerTimer
=
new
Timer
();
...
...
@@ -78,13 +81,14 @@ public class MainActivity extends FlutterActivity {
producerTimer
.
cancel
();
consumerTimer
.
cancel
();
endTime
=
System
.
currentTimeMillis
();
Log
.
e
(
"TET"
,
"Stopped at "
+
endTime
);
result
.
success
(
null
);
break
;
case
"getProducedFrameRate"
:
result
.
success
(
frame
sProduced
.
get
()
*
1000
/
(
double
)
(
endTime
-
start
Time
));
result
.
success
(
frame
Rate
(
framesProduced
,
startTime
,
end
Time
));
break
;
case
"getConsumedFrameRate"
:
result
.
success
(
frame
sConsumed
.
get
()
*
1000
/
(
double
)
(
endTime
-
start
Time
));
result
.
success
(
frame
Rate
(
framesConsumed
,
startTime
,
end
Time
));
break
;
default
:
result
.
notImplemented
();
}
...
...
@@ -110,6 +114,10 @@ public class MainActivity extends FlutterActivity {
});
}
double
frameRate
(
AtomicInteger
frameCounter
,
long
startTime
,
long
endTime
)
{
return
frameCounter
.
get
()
*
1000
/
(
double
)
(
endTime
-
startTime
);
}
@Override
protected
void
onDestroy
()
{
if
(
surface
!=
null
)
{
...
...
dev/integration_tests/external_ui/test_driver/main_test.dart
View file @
bce5574c
...
...
@@ -55,7 +55,7 @@ Future<Null> main() async {
final
String
statsFast
=
await
driver
.
getText
(
summary
);
final
Match
matchFast
=
statsRegExp
.
matchAsPrefix
(
statsFast
);
expect
(
matchFast
,
isNotNull
);
expect
(
double
.
parse
(
matchFast
.
group
(
1
)),
closeTo
(
flutterFrameRate
*
2.0
,
10
.0
));
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
);
});
...
...
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