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
9eacc9ef
Unverified
Commit
9eacc9ef
authored
Jan 27, 2021
by
Dan Field
Committed by
GitHub
Jan 27, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drop mockito for integration_test (#74770)
parent
7db172b2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
17 deletions
+35
-17
pubspec.yaml
packages/integration_test/pubspec.yaml
+2
-5
binding_test.dart
packages/integration_test/test/binding_test.dart
+33
-12
No files found.
packages/integration_test/pubspec.yaml
View file @
9eacc9ef
...
...
@@ -29,6 +29,7 @@ dependencies:
file
:
6.0.0-nullsafety.4
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
matcher
:
0.12.10-nullsafety.3
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
meta
:
1.3.0-nullsafety.6
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
pedantic
:
1.10.0-nullsafety.3
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
source_span
:
1.8.0-nullsafety.4
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
stack_trace
:
1.10.0-nullsafety.6
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
stream_channel
:
2.1.0-nullsafety.3
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
...
...
@@ -40,10 +41,6 @@ dependencies:
vector_math
:
2.1.0-nullsafety.5
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
webdriver
:
3.0.0-nullsafety.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
dev_dependencies
:
pedantic
:
1.10.0-nullsafety.3
mockito
:
4.1.1
flutter
:
plugin
:
platforms
:
...
...
@@ -53,4 +50,4 @@ flutter:
ios
:
pluginClass
:
IntegrationTestPlugin
# PUBSPEC CHECKSUM:
9569
# PUBSPEC CHECKSUM:
4623
packages/integration_test/test/binding_test.dart
View file @
9eacc9ef
...
...
@@ -9,7 +9,6 @@ import 'package:flutter/material.dart';
import
'package:integration_test/integration_test.dart'
;
import
'package:integration_test/common.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:mockito/mockito.dart'
;
import
'package:vm_service/vm_service.dart'
as
vm
;
vm
.
Timeline
_kTimelines
=
vm
.
Timeline
(
...
...
@@ -26,20 +25,14 @@ Future<void> main() async {
assert
(
binding
is
IntegrationTestWidgetsFlutterBinding
);
final
IntegrationTestWidgetsFlutterBinding
integrationBinding
=
binding
as
IntegrationTestWidgetsFlutterBinding
;
MockVM
mockVM
;
final
List
<
int
>
clockTimes
=
<
int
>[
100
,
200
];
FakeVM
fakeVM
;
setUp
(()
{
request
=
integrationBinding
.
callback
(<
String
,
String
>{
'command'
:
'request_data'
,
});
mockVM
=
MockVM
();
when
(
mockVM
.
getVMTimeline
(
timeOriginMicros:
anyNamed
(
'timeOriginMicros'
),
timeExtentMicros:
anyNamed
(
'timeExtentMicros'
),
)).
thenAnswer
((
_
)
=>
Future
<
vm
.
Timeline
>.
value
(
_kTimelines
));
when
(
mockVM
.
getVMTimelineMicros
()).
thenAnswer
(
(
_
)
=>
Future
<
vm
.
Timestamp
>.
value
(
vm
.
Timestamp
(
timestamp:
clockTimes
.
removeAt
(
0
))),
fakeVM
=
FakeVM
(
timeline:
_kTimelines
,
);
});
...
...
@@ -78,7 +71,7 @@ Future<void> main() async {
});
testWidgets
(
'Test traceAction'
,
(
WidgetTester
tester
)
async
{
await
integrationBinding
.
enableTimeline
(
vmService:
mock
VM
);
await
integrationBinding
.
enableTimeline
(
vmService:
fake
VM
);
await
integrationBinding
.
traceAction
(()
async
{});
expect
(
integrationBinding
.
reportData
,
isNotNull
);
expect
(
integrationBinding
.
reportData
.
containsKey
(
'timeline'
),
true
);
...
...
@@ -121,4 +114,32 @@ Future<void> main() async {
});
}
class
MockVM
extends
Mock
implements
vm
.
VmService
{}
class
FakeVM
extends
Fake
implements
vm
.
VmService
{
FakeVM
({
@required
this
.
timeline
});
vm
.
Timeline
timeline
;
@override
Future
<
vm
.
Timeline
>
getVMTimeline
({
int
timeOriginMicros
,
int
timeExtentMicros
})
async
{
return
timeline
;
}
int
lastTimeStamp
=
0
;
@override
Future
<
vm
.
Timestamp
>
getVMTimelineMicros
()
async
{
lastTimeStamp
+=
100
;
return
vm
.
Timestamp
(
timestamp:
lastTimeStamp
);
}
List
<
String
>
recordedStreams
=
<
String
>[];
@override
Future
<
vm
.
Success
>
setVMTimelineFlags
(
List
<
String
>
recordedStreams
)
async
{
recordedStreams
=
recordedStreams
;
return
vm
.
Success
();
}
@override
Future
<
vm
.
Success
>
clearVMTimeline
()
async
{
return
vm
.
Success
();
}
}
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