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
6728cf34
Unverified
Commit
6728cf34
authored
Jun 10, 2021
by
Jonah Williams
Committed by
GitHub
Jun 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] remove more mocks from runner tests (#84312)
parent
67a57eb9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
136 additions
and
204 deletions
+136
-204
resident_runner_test.dart
...lutter_tools/test/general.shard/resident_runner_test.dart
+2
-7
resident_web_runner_test.dart
...er_tools/test/general.shard/resident_web_runner_test.dart
+134
-197
No files found.
packages/flutter_tools/test/general.shard/resident_runner_test.dart
View file @
6728cf34
...
@@ -143,7 +143,6 @@ final Uri testUri = Uri.parse('foo://bar');
...
@@ -143,7 +143,6 @@ final Uri testUri = Uri.parse('foo://bar');
void
main
(
)
{
void
main
(
)
{
Testbed
testbed
;
Testbed
testbed
;
MockFlutterDevice
mockFlutterDevice
;
MockFlutterDevice
mockFlutterDevice
;
MockVMService
mockVMService
;
FakeDevFS
mockDevFS
;
FakeDevFS
mockDevFS
;
ResidentRunner
residentRunner
;
ResidentRunner
residentRunner
;
FakeDevice
mockDevice
;
FakeDevice
mockDevice
;
...
@@ -168,7 +167,6 @@ void main() {
...
@@ -168,7 +167,6 @@ void main() {
});
});
mockFlutterDevice
=
MockFlutterDevice
();
mockFlutterDevice
=
MockFlutterDevice
();
mockDevice
=
FakeDevice
();
mockDevice
=
FakeDevice
();
mockVMService
=
MockVMService
();
mockDevFS
=
FakeDevFS
();
mockDevFS
=
FakeDevFS
();
// FlutterDevice Mocks.
// FlutterDevice Mocks.
when
(
mockFlutterDevice
.
updateDevFS
(
when
(
mockFlutterDevice
.
updateDevFS
(
...
@@ -2123,12 +2121,11 @@ void main() {
...
@@ -2123,12 +2121,11 @@ void main() {
io
.
CompressionOptions
compression
,
io
.
CompressionOptions
compression
,
Device
device
,
Device
device
,
Logger
logger
,
Logger
logger
,
})
async
=>
mockVM
Service
,
})
async
=>
FakeVmServiceHost
(
requests:
<
VmServiceExpectation
>[]).
vm
Service
,
}));
}));
testUsingContext
(
'Failed DDS start outputs error message'
,
()
=>
testbed
.
run
(()
async
{
testUsingContext
(
'Failed DDS start outputs error message'
,
()
=>
testbed
.
run
(()
async
{
// See https://github.com/flutter/flutter/issues/72385 for context.
// See https://github.com/flutter/flutter/issues/72385 for context.
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
<
VmServiceExpectation
>[]);
final
FakeDevice
mockDevice
=
FakeDevice
()
final
FakeDevice
mockDevice
=
FakeDevice
()
..
dds
=
DartDevelopmentService
();
..
dds
=
DartDevelopmentService
();
ddsLauncherCallback
=
(
Uri
uri
,
{
bool
enableAuthCodes
,
bool
ipv6
,
Uri
serviceUri
})
{
ddsLauncherCallback
=
(
Uri
uri
,
{
bool
enableAuthCodes
,
bool
ipv6
,
Uri
serviceUri
})
{
...
@@ -2165,7 +2162,7 @@ void main() {
...
@@ -2165,7 +2162,7 @@ void main() {
io
.
CompressionOptions
compression
,
io
.
CompressionOptions
compression
,
Device
device
,
Device
device
,
Logger
logger
,
Logger
logger
,
})
async
=>
mockVM
Service
,
})
async
=>
FakeVmServiceHost
(
requests:
<
VmServiceExpectation
>[]).
vm
Service
,
}));
}));
testUsingContext
(
'nextPlatform moves through expected platforms'
,
()
{
testUsingContext
(
'nextPlatform moves through expected platforms'
,
()
{
...
@@ -2193,8 +2190,6 @@ void main() {
...
@@ -2193,8 +2190,6 @@ void main() {
}
}
class
MockFlutterDevice
extends
Mock
implements
FlutterDevice
{}
class
MockFlutterDevice
extends
Mock
implements
FlutterDevice
{}
class
MockVMService
extends
Mock
implements
FlutterVmService
{}
class
MockDevFS
extends
Mock
implements
DevFS
{}
class
MockResidentCompiler
extends
Mock
implements
ResidentCompiler
{}
class
MockResidentCompiler
extends
Mock
implements
ResidentCompiler
{}
class
FakeDartDevelopmentServiceException
implements
dds
.
DartDevelopmentServiceException
{
class
FakeDartDevelopmentServiceException
implements
dds
.
DartDevelopmentServiceException
{
...
...
packages/flutter_tools/test/general.shard/resident_web_runner_test.dart
View file @
6728cf34
...
@@ -10,6 +10,7 @@ import 'dart:io';
...
@@ -10,6 +10,7 @@ import 'dart:io';
import
'package:dwds/dwds.dart'
;
import
'package:dwds/dwds.dart'
;
import
'package:file/memory.dart'
;
import
'package:file/memory.dart'
;
import
'package:flutter_tools/src/asset.dart'
;
import
'package:flutter_tools/src/base/common.dart'
;
import
'package:flutter_tools/src/base/common.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
...
@@ -28,14 +29,16 @@ import 'package:flutter_tools/src/resident_runner.dart';
...
@@ -28,14 +29,16 @@ import 'package:flutter_tools/src/resident_runner.dart';
import
'package:flutter_tools/src/vmservice.dart'
;
import
'package:flutter_tools/src/vmservice.dart'
;
import
'package:flutter_tools/src/web/chrome.dart'
;
import
'package:flutter_tools/src/web/chrome.dart'
;
import
'package:flutter_tools/src/web/web_device.dart'
;
import
'package:flutter_tools/src/web/web_device.dart'
;
import
'package:meta/meta.dart'
;
import
'package:mockito/mockito.dart'
;
import
'package:mockito/mockito.dart'
;
import
'package:package_config/package_config.dart'
;
import
'package:package_config/package_config_types.dart'
;
import
'package:vm_service/vm_service.dart'
as
vm_service
;
import
'package:vm_service/vm_service.dart'
as
vm_service
;
import
'package:webkit_inspection_protocol/webkit_inspection_protocol.dart'
;
import
'package:webkit_inspection_protocol/webkit_inspection_protocol.dart'
;
import
'../src/common.dart'
;
import
'../src/common.dart'
;
import
'../src/context.dart'
;
import
'../src/context.dart'
;
import
'../src/fake_vm_services.dart'
;
import
'../src/fake_vm_services.dart'
;
import
'../src/fakes.dart'
;
const
List
<
VmServiceExpectation
>
kAttachLogExpectations
=
<
VmServiceExpectation
>[
const
List
<
VmServiceExpectation
>
kAttachLogExpectations
=
<
VmServiceExpectation
>[
FakeVmServiceRequest
(
FakeVmServiceRequest
(
...
@@ -95,11 +98,11 @@ const List<VmServiceExpectation> kAttachExpectations = <VmServiceExpectation>[
...
@@ -95,11 +98,11 @@ const List<VmServiceExpectation> kAttachExpectations = <VmServiceExpectation>[
void
main
(
)
{
void
main
(
)
{
MockDebugConnection
mockDebugConnection
;
MockDebugConnection
mockDebugConnection
;
MockChromeDevice
mockC
hromeDevice
;
FakeChromeDevice
c
hromeDevice
;
MockAppConnection
mockAppConnection
;
MockAppConnection
mockAppConnection
;
MockFlutterDevice
mockFlutterDevice
;
MockFlutterDevice
mockFlutterDevice
;
MockWebDevFS
mockW
ebDevFS
;
FakeWebDevFS
w
ebDevFS
;
MockResidentCompiler
mockR
esidentCompiler
;
FakeResidentCompiler
r
esidentCompiler
;
FakeChromeConnection
chromeConnection
;
FakeChromeConnection
chromeConnection
;
FakeChromeTab
chromeTab
;
FakeChromeTab
chromeTab
;
MockWebServerDevice
mockWebServerDevice
;
MockWebServerDevice
mockWebServerDevice
;
...
@@ -117,20 +120,13 @@ void main() {
...
@@ -117,20 +120,13 @@ void main() {
mockDevice
=
MockDevice
();
mockDevice
=
MockDevice
();
mockAppConnection
=
MockAppConnection
();
mockAppConnection
=
MockAppConnection
();
mockFlutterDevice
=
MockFlutterDevice
();
mockFlutterDevice
=
MockFlutterDevice
();
mockWebDevFS
=
Mock
WebDevFS
();
webDevFS
=
Fake
WebDevFS
();
mockResidentCompiler
=
Mock
ResidentCompiler
();
residentCompiler
=
Fake
ResidentCompiler
();
chromeConnection
=
FakeChromeConnection
();
chromeConnection
=
FakeChromeConnection
();
chromeTab
=
FakeChromeTab
(
'index.html'
);
chromeTab
=
FakeChromeTab
(
'index.html'
);
mockWebServerDevice
=
MockWebServerDevice
();
mockWebServerDevice
=
MockWebServerDevice
();
when
(
mockFlutterDevice
.
devFS
).
thenReturn
(
mockW
ebDevFS
);
when
(
mockFlutterDevice
.
devFS
).
thenReturn
(
w
ebDevFS
);
when
(
mockFlutterDevice
.
device
).
thenReturn
(
mockDevice
);
when
(
mockFlutterDevice
.
device
).
thenReturn
(
mockDevice
);
when
(
mockWebDevFS
.
connect
(
any
)).
thenAnswer
((
Invocation
invocation
)
async
{
return
ConnectionResult
(
mockAppConnection
,
mockDebugConnection
,
mockDebugConnection
.
vmService
,
);
});
fileSystem
.
file
(
'.packages'
).
writeAsStringSync
(
'
\n
'
);
fileSystem
.
file
(
'.packages'
).
writeAsStringSync
(
'
\n
'
);
});
});
...
@@ -138,34 +134,21 @@ void main() {
...
@@ -138,34 +134,21 @@ void main() {
fileSystem
.
file
(
'pubspec.yaml'
).
createSync
();
fileSystem
.
file
(
'pubspec.yaml'
).
createSync
();
fileSystem
.
file
(
'lib/main.dart'
).
createSync
(
recursive:
true
);
fileSystem
.
file
(
'lib/main.dart'
).
createSync
(
recursive:
true
);
fileSystem
.
file
(
'web/index.html'
).
createSync
(
recursive:
true
);
fileSystem
.
file
(
'web/index.html'
).
createSync
(
recursive:
true
);
when
(
mockWebDevFS
.
update
(
webDevFS
.
report
=
UpdateFSReport
(
success:
true
,
syncedBytes:
0
);
mainUri:
anyNamed
(
'mainUri'
),
target:
anyNamed
(
'target'
),
bundle:
anyNamed
(
'bundle'
),
firstBuildTime:
anyNamed
(
'firstBuildTime'
),
bundleFirstUpload:
anyNamed
(
'bundleFirstUpload'
),
generator:
anyNamed
(
'generator'
),
fullRestart:
anyNamed
(
'fullRestart'
),
dillOutputPath:
anyNamed
(
'dillOutputPath'
),
projectRootPath:
anyNamed
(
'projectRootPath'
),
pathToReload:
anyNamed
(
'pathToReload'
),
invalidatedFiles:
anyNamed
(
'invalidatedFiles'
),
trackWidgetCreation:
anyNamed
(
'trackWidgetCreation'
),
packageConfig:
anyNamed
(
'packageConfig'
),
)).
thenAnswer
((
Invocation
_
)
async
{
return
UpdateFSReport
(
success:
true
,
syncedBytes:
0
);
});
when
(
mockDebugConnection
.
vmService
).
thenAnswer
((
Invocation
invocation
)
{
when
(
mockDebugConnection
.
vmService
).
thenAnswer
((
Invocation
invocation
)
{
return
fakeVmServiceHost
.
vmService
.
service
;
return
fakeVmServiceHost
.
vmService
.
service
;
});
});
when
(
mockDebugConnection
.
onDone
).
thenAnswer
((
Invocation
invocation
)
{
when
(
mockDebugConnection
.
onDone
).
thenAnswer
((
Invocation
invocation
)
{
return
Completer
<
void
>().
future
;
return
Completer
<
void
>().
future
;
});
});
webDevFS
.
result
=
ConnectionResult
(
mockAppConnection
,
mockDebugConnection
,
mockDebugConnection
.
vmService
,
);
when
(
mockDebugConnection
.
uri
).
thenReturn
(
'ws://127.0.0.1/abcd/'
);
when
(
mockDebugConnection
.
uri
).
thenReturn
(
'ws://127.0.0.1/abcd/'
);
when
(
mockFlutterDevice
.
devFS
).
thenReturn
(
mockWebDevFS
);
when
(
mockFlutterDevice
.
devFS
).
thenReturn
(
webDevFS
);
when
(
mockWebDevFS
.
sources
).
thenReturn
(<
Uri
>[]);
when
(
mockFlutterDevice
.
generator
).
thenReturn
(
residentCompiler
);
when
(
mockWebDevFS
.
baseUri
).
thenReturn
(
Uri
.
parse
(
'http://localhost:12345'
));
when
(
mockFlutterDevice
.
generator
).
thenReturn
(
mockResidentCompiler
);
chromeConnection
.
tabs
.
add
(
chromeTab
);
chromeConnection
.
tabs
.
add
(
chromeTab
);
}
}
...
@@ -190,7 +173,7 @@ void main() {
...
@@ -190,7 +173,7 @@ void main() {
expect
(
profileResidentWebRunner
.
debuggingEnabled
,
false
);
expect
(
profileResidentWebRunner
.
debuggingEnabled
,
false
);
when
(
mockFlutterDevice
.
device
).
thenReturn
(
Mock
ChromeDevice
());
when
(
mockFlutterDevice
.
device
).
thenReturn
(
Fake
ChromeDevice
());
expect
(
residentWebRunner
.
debuggingEnabled
,
true
);
expect
(
residentWebRunner
.
debuggingEnabled
,
true
);
expect
(
fakeVmServiceHost
.
hasRemainingExpectations
,
false
);
expect
(
fakeVmServiceHost
.
hasRemainingExpectations
,
false
);
...
@@ -200,9 +183,6 @@ void main() {
...
@@ -200,9 +183,6 @@ void main() {
});
});
testUsingContext
(
'runner with web server device supports debugging with --start-paused'
,
()
{
testUsingContext
(
'runner with web server device supports debugging with --start-paused'
,
()
{
fileSystem
.
file
(
'.packages'
)
..
createSync
(
recursive:
true
)
..
writeAsStringSync
(
'
\n
'
);
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
<
VmServiceExpectation
>[]);
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
<
VmServiceExpectation
>[]);
_setupMocks
();
_setupMocks
();
when
(
mockFlutterDevice
.
device
).
thenReturn
(
WebServerDevice
(
when
(
mockFlutterDevice
.
device
).
thenReturn
(
WebServerDevice
(
...
@@ -221,16 +201,13 @@ void main() {
...
@@ -221,16 +201,13 @@ void main() {
systemClock:
globals
.
systemClock
,
systemClock:
globals
.
systemClock
,
);
);
expect
(
profileResidentWebRunner
.
uri
,
mockW
ebDevFS
.
baseUri
);
expect
(
profileResidentWebRunner
.
uri
,
w
ebDevFS
.
baseUri
);
expect
(
profileResidentWebRunner
.
debuggingEnabled
,
true
);
expect
(
profileResidentWebRunner
.
debuggingEnabled
,
true
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fileSystem
,
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
processManager
,
ProcessManager:
()
=>
processManager
,
});
});
testUsingContext
(
'profile does not supportsServiceProtocol'
,
()
{
testUsingContext
(
'profile does not supportsServiceProtocol'
,
()
{
fileSystem
.
file
(
'.packages'
)
..
createSync
(
recursive:
true
)
..
writeAsStringSync
(
'
\n
'
);
final
ResidentRunner
residentWebRunner
=
ResidentWebRunner
(
final
ResidentRunner
residentWebRunner
=
ResidentWebRunner
(
mockFlutterDevice
,
mockFlutterDevice
,
flutterProject:
FlutterProject
.
fromDirectoryTest
(
fileSystem
.
currentDirectory
),
flutterProject:
FlutterProject
.
fromDirectoryTest
(
fileSystem
.
currentDirectory
),
...
@@ -244,7 +221,7 @@ void main() {
...
@@ -244,7 +221,7 @@ void main() {
systemClock:
globals
.
systemClock
,
systemClock:
globals
.
systemClock
,
);
);
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
<
VmServiceExpectation
>[]);
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
<
VmServiceExpectation
>[]);
when
(
mockFlutterDevice
.
device
).
thenReturn
(
mockC
hromeDevice
);
when
(
mockFlutterDevice
.
device
).
thenReturn
(
c
hromeDevice
);
final
ResidentRunner
profileResidentWebRunner
=
ResidentWebRunner
(
final
ResidentRunner
profileResidentWebRunner
=
ResidentWebRunner
(
mockFlutterDevice
,
mockFlutterDevice
,
flutterProject:
FlutterProject
.
fromDirectoryTest
(
fileSystem
.
currentDirectory
),
flutterProject:
FlutterProject
.
fromDirectoryTest
(
fileSystem
.
currentDirectory
),
...
@@ -266,16 +243,11 @@ void main() {
...
@@ -266,16 +243,11 @@ void main() {
});
});
testUsingContext
(
'Can successfully run and connect to vmservice'
,
()
async
{
testUsingContext
(
'Can successfully run and connect to vmservice'
,
()
async
{
final
BufferLogger
bufferLogger
=
BufferLogger
.
test
();
final
BufferLogger
logger
=
BufferLogger
.
test
();
final
FakeStatusLogger
logger
=
FakeStatusLogger
(
bufferLogger
);
fileSystem
.
file
(
'.packages'
)
..
createSync
(
recursive:
true
)
..
writeAsStringSync
(
'
\n
'
);
final
ResidentRunner
residentWebRunner
=
setUpResidentRunner
(
mockFlutterDevice
,
logger:
logger
);
final
ResidentRunner
residentWebRunner
=
setUpResidentRunner
(
mockFlutterDevice
,
logger:
logger
);
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
kAttachExpectations
.
toList
());
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
kAttachExpectations
.
toList
());
_setupMocks
();
_setupMocks
();
final
MockStatus
status
=
MockStatus
();
logger
.
status
=
status
;
final
Completer
<
DebugConnectionInfo
>
connectionInfoCompleter
=
Completer
<
DebugConnectionInfo
>();
final
Completer
<
DebugConnectionInfo
>
connectionInfoCompleter
=
Completer
<
DebugConnectionInfo
>();
unawaited
(
residentWebRunner
.
run
(
unawaited
(
residentWebRunner
.
run
(
connectionInfoCompleter:
connectionInfoCompleter
,
connectionInfoCompleter:
connectionInfoCompleter
,
...
@@ -283,11 +255,9 @@ void main() {
...
@@ -283,11 +255,9 @@ void main() {
final
DebugConnectionInfo
debugConnectionInfo
=
await
connectionInfoCompleter
.
future
;
final
DebugConnectionInfo
debugConnectionInfo
=
await
connectionInfoCompleter
.
future
;
verify
(
mockAppConnection
.
runMain
()).
called
(
1
);
verify
(
mockAppConnection
.
runMain
()).
called
(
1
);
verify
(
status
.
stop
()).
called
(
1
);
expect
(
logger
.
statusText
,
contains
(
'Debug service listening on ws://127.0.0.1/abcd/'
));
expect
(
bufferLogger
.
statusText
,
contains
(
'Debug service listening on ws://127.0.0.1/abcd/'
));
expect
(
debugConnectionInfo
.
wsUri
.
toString
(),
'ws://127.0.0.1/abcd/'
);
expect
(
debugConnectionInfo
.
wsUri
.
toString
(),
'ws://127.0.0.1/abcd/'
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
Logger:
()
=>
FakeStatusLogger
(
BufferLogger
.
test
()),
FileSystem:
()
=>
fileSystem
,
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
processManager
,
ProcessManager:
()
=>
processManager
,
});
});
...
@@ -317,23 +287,7 @@ void main() {
...
@@ -317,23 +287,7 @@ void main() {
fileSystem
.
file
(
globals
.
fs
.
path
.
join
(
'lib'
,
'main.dart'
))
fileSystem
.
file
(
globals
.
fs
.
path
.
join
(
'lib'
,
'main.dart'
))
.
createSync
(
recursive:
true
);
.
createSync
(
recursive:
true
);
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
kAttachExpectations
.
toList
());
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
kAttachExpectations
.
toList
());
when
(
mockWebDevFS
.
update
(
webDevFS
.
report
=
UpdateFSReport
(
success:
false
,
syncedBytes:
0
);
mainUri:
anyNamed
(
'mainUri'
),
target:
anyNamed
(
'target'
),
bundle:
anyNamed
(
'bundle'
),
firstBuildTime:
anyNamed
(
'firstBuildTime'
),
bundleFirstUpload:
anyNamed
(
'bundleFirstUpload'
),
generator:
anyNamed
(
'generator'
),
fullRestart:
anyNamed
(
'fullRestart'
),
dillOutputPath:
anyNamed
(
'dillOutputPath'
),
projectRootPath:
anyNamed
(
'projectRootPath'
),
pathToReload:
anyNamed
(
'pathToReload'
),
invalidatedFiles:
anyNamed
(
'invalidatedFiles'
),
trackWidgetCreation:
anyNamed
(
'trackWidgetCreation'
),
packageConfig:
anyNamed
(
'packageConfig'
),
)).
thenAnswer
((
Invocation
_
)
async
{
return
UpdateFSReport
(
success:
false
,
syncedBytes:
0
);
});
expect
(
await
residentWebRunner
.
run
(),
1
);
expect
(
await
residentWebRunner
.
run
(),
1
);
// Completing this future ensures that the daemon can exit correctly.
// Completing this future ensures that the daemon can exit correctly.
...
@@ -546,25 +500,8 @@ void main() {
...
@@ -546,25 +500,8 @@ void main() {
platform:
FakePlatform
(
operatingSystem:
'linux'
),
platform:
FakePlatform
(
operatingSystem:
'linux'
),
processManager:
FakeProcessManager
.
any
(),
processManager:
FakeProcessManager
.
any
(),
));
));
when
(
mockWebDevFS
.
update
(
webDevFS
.
report
=
UpdateFSReport
(
success:
true
);
mainUri:
anyNamed
(
'mainUri'
),
target:
anyNamed
(
'target'
),
bundle:
anyNamed
(
'bundle'
),
firstBuildTime:
anyNamed
(
'firstBuildTime'
),
bundleFirstUpload:
anyNamed
(
'bundleFirstUpload'
),
generator:
anyNamed
(
'generator'
),
fullRestart:
anyNamed
(
'fullRestart'
),
dillOutputPath:
anyNamed
(
'dillOutputPath'
),
trackWidgetCreation:
anyNamed
(
'trackWidgetCreation'
),
projectRootPath:
anyNamed
(
'projectRootPath'
),
pathToReload:
anyNamed
(
'pathToReload'
),
invalidatedFiles:
anyNamed
(
'invalidatedFiles'
),
packageConfig:
anyNamed
(
'packageConfig'
),
)).
thenAnswer
((
Invocation
invocation
)
async
{
// Generated entrypoint file in temp dir.
expect
(
invocation
.
namedArguments
[
#mainUri
].
toString
(),
contains
(
'entrypoint.dart'
));
return
UpdateFSReport
(
success:
true
);
});
final
Completer
<
DebugConnectionInfo
>
connectionInfoCompleter
=
Completer
<
DebugConnectionInfo
>();
final
Completer
<
DebugConnectionInfo
>
connectionInfoCompleter
=
Completer
<
DebugConnectionInfo
>();
unawaited
(
residentWebRunner
.
run
(
unawaited
(
residentWebRunner
.
run
(
connectionInfoCompleter:
connectionInfoCompleter
,
connectionInfoCompleter:
connectionInfoCompleter
,
...
@@ -577,7 +514,7 @@ void main() {
...
@@ -577,7 +514,7 @@ void main() {
expect
(
logger
.
statusText
,
contains
(
'Restarted application in'
));
expect
(
logger
.
statusText
,
contains
(
'Restarted application in'
));
expect
(
result
.
code
,
0
);
expect
(
result
.
code
,
0
);
verify
(
mockResidentCompiler
.
accept
()).
called
(
2
);
expect
(
webDevFS
.
mainUri
.
toString
(),
contains
(
'entrypoint.dart'
)
);
// ensure that analytics are sent.
// ensure that analytics are sent.
expect
(
testUsage
.
events
,
<
TestUsageEvent
>[
expect
(
testUsage
.
events
,
<
TestUsageEvent
>[
...
@@ -620,25 +557,8 @@ void main() {
...
@@ -620,25 +557,8 @@ void main() {
platform:
FakePlatform
(
operatingSystem:
'linux'
),
platform:
FakePlatform
(
operatingSystem:
'linux'
),
processManager:
FakeProcessManager
.
any
(),
processManager:
FakeProcessManager
.
any
(),
));
));
Uri
entrypointFileUri
;
webDevFS
.
report
=
UpdateFSReport
(
success:
true
);
when
(
mockWebDevFS
.
update
(
mainUri:
anyNamed
(
'mainUri'
),
target:
anyNamed
(
'target'
),
bundle:
anyNamed
(
'bundle'
),
firstBuildTime:
anyNamed
(
'firstBuildTime'
),
bundleFirstUpload:
anyNamed
(
'bundleFirstUpload'
),
generator:
anyNamed
(
'generator'
),
fullRestart:
anyNamed
(
'fullRestart'
),
dillOutputPath:
anyNamed
(
'dillOutputPath'
),
trackWidgetCreation:
anyNamed
(
'trackWidgetCreation'
),
projectRootPath:
anyNamed
(
'projectRootPath'
),
pathToReload:
anyNamed
(
'pathToReload'
),
invalidatedFiles:
anyNamed
(
'invalidatedFiles'
),
packageConfig:
anyNamed
(
'packageConfig'
),
)).
thenAnswer
((
Invocation
invocation
)
async
{
entrypointFileUri
=
invocation
.
namedArguments
[
#mainUri
]
as
Uri
;
return
UpdateFSReport
(
success:
true
);
});
final
Completer
<
DebugConnectionInfo
>
connectionInfoCompleter
=
Completer
<
DebugConnectionInfo
>();
final
Completer
<
DebugConnectionInfo
>
connectionInfoCompleter
=
Completer
<
DebugConnectionInfo
>();
unawaited
(
residentWebRunner
.
run
(
unawaited
(
residentWebRunner
.
run
(
connectionInfoCompleter:
connectionInfoCompleter
,
connectionInfoCompleter:
connectionInfoCompleter
,
...
@@ -647,15 +567,14 @@ void main() {
...
@@ -647,15 +567,14 @@ void main() {
final
OperationResult
result
=
await
residentWebRunner
.
restart
(
fullRestart:
true
);
final
OperationResult
result
=
await
residentWebRunner
.
restart
(
fullRestart:
true
);
// Ensure that generated entrypoint is generated correctly.
// Ensure that generated entrypoint is generated correctly.
expect
(
entrypointFile
Uri
,
isNotNull
);
expect
(
webDevFS
.
main
Uri
,
isNotNull
);
final
String
entrypointContents
=
fileSystem
.
file
(
entrypointFile
Uri
).
readAsStringSync
();
final
String
entrypointContents
=
fileSystem
.
file
(
webDevFS
.
main
Uri
).
readAsStringSync
();
expect
(
entrypointContents
,
contains
(
'// Flutter web bootstrap script'
));
expect
(
entrypointContents
,
contains
(
'// Flutter web bootstrap script'
));
expect
(
entrypointContents
,
contains
(
"import 'dart:ui' as ui;"
));
expect
(
entrypointContents
,
contains
(
"import 'dart:ui' as ui;"
));
expect
(
entrypointContents
,
contains
(
'await ui.webOnlyInitializePlatform();'
));
expect
(
entrypointContents
,
contains
(
'await ui.webOnlyInitializePlatform();'
));
expect
(
logger
.
statusText
,
contains
(
'Restarted application in'
));
expect
(
logger
.
statusText
,
contains
(
'Restarted application in'
));
expect
(
result
.
code
,
0
);
expect
(
result
.
code
,
0
);
verify
(
mockResidentCompiler
.
accept
()).
called
(
2
);
// ensure that analytics are sent.
// ensure that analytics are sent.
expect
(
testUsage
.
events
,
<
TestUsageEvent
>[
expect
(
testUsage
.
events
,
<
TestUsageEvent
>[
...
@@ -680,23 +599,8 @@ void main() {
...
@@ -680,23 +599,8 @@ void main() {
fakeVmServiceHost
=
FakeVmServiceHost
(
requests
:
kAttachExpectations
);
fakeVmServiceHost
=
FakeVmServiceHost
(
requests
:
kAttachExpectations
);
_setupMocks
();
_setupMocks
();
when
(
mockFlutterDevice
.
device
).
thenReturn
(
mockWebServerDevice
);
when
(
mockFlutterDevice
.
device
).
thenReturn
(
mockWebServerDevice
);
when
(
mockWebDevFS
.
update
(
webDevFS
.
report
=
UpdateFSReport
(
success:
true
);
mainUri:
anyNamed
(
'mainUri'
),
target:
anyNamed
(
'target'
),
bundle:
anyNamed
(
'bundle'
),
firstBuildTime:
anyNamed
(
'firstBuildTime'
),
bundleFirstUpload:
anyNamed
(
'bundleFirstUpload'
),
generator:
anyNamed
(
'generator'
),
fullRestart:
anyNamed
(
'fullRestart'
),
dillOutputPath:
anyNamed
(
'dillOutputPath'
),
trackWidgetCreation:
anyNamed
(
'trackWidgetCreation'
),
projectRootPath:
anyNamed
(
'projectRootPath'
),
pathToReload:
anyNamed
(
'pathToReload'
),
invalidatedFiles:
anyNamed
(
'invalidatedFiles'
),
packageConfig:
anyNamed
(
'packageConfig'
),
)).
thenAnswer
((
Invocation
invocation
)
async
{
return
UpdateFSReport
(
success:
true
);
});
final
Completer
<
DebugConnectionInfo
>
connectionInfoCompleter
=
Completer
<
DebugConnectionInfo
>();
final
Completer
<
DebugConnectionInfo
>
connectionInfoCompleter
=
Completer
<
DebugConnectionInfo
>();
unawaited
(
residentWebRunner
.
run
(
unawaited
(
residentWebRunner
.
run
(
connectionInfoCompleter:
connectionInfoCompleter
,
connectionInfoCompleter:
connectionInfoCompleter
,
...
@@ -706,7 +610,6 @@ void main() {
...
@@ -706,7 +610,6 @@ void main() {
expect
(
logger
.
statusText
,
contains
(
'Restarted application in'
));
expect
(
logger
.
statusText
,
contains
(
'Restarted application in'
));
expect
(
result
.
code
,
0
);
expect
(
result
.
code
,
0
);
verify
(
mockResidentCompiler
.
accept
()).
called
(
2
);
// web-server device does not send restart analytics
// web-server device does not send restart analytics
expect
(
testUsage
.
events
,
isEmpty
);
expect
(
testUsage
.
events
,
isEmpty
);
...
@@ -731,23 +634,8 @@ void main() {
...
@@ -731,23 +634,8 @@ void main() {
final
ResidentRunner
residentWebRunner
=
setUpResidentRunner
(
mockFlutterDevice
);
final
ResidentRunner
residentWebRunner
=
setUpResidentRunner
(
mockFlutterDevice
);
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
<
VmServiceExpectation
>[]);
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
<
VmServiceExpectation
>[]);
_setupMocks
();
_setupMocks
();
when
(
mockWebDevFS
.
update
(
webDevFS
.
report
=
UpdateFSReport
(
success:
false
,
syncedBytes:
0
);
mainUri:
anyNamed
(
'mainUri'
),
target:
anyNamed
(
'target'
),
bundle:
anyNamed
(
'bundle'
),
firstBuildTime:
anyNamed
(
'firstBuildTime'
),
bundleFirstUpload:
anyNamed
(
'bundleFirstUpload'
),
generator:
anyNamed
(
'generator'
),
fullRestart:
anyNamed
(
'fullRestart'
),
dillOutputPath:
anyNamed
(
'dillOutputPath'
),
projectRootPath:
anyNamed
(
'projectRootPath'
),
pathToReload:
anyNamed
(
'pathToReload'
),
invalidatedFiles:
anyNamed
(
'invalidatedFiles'
),
packageConfig:
anyNamed
(
'packageConfig'
),
trackWidgetCreation:
anyNamed
(
'trackWidgetCreation'
),
)).
thenAnswer
((
Invocation
_
)
async
{
return
UpdateFSReport
(
success:
false
,
syncedBytes:
0
);
});
final
Completer
<
DebugConnectionInfo
>
connectionInfoCompleter
=
Completer
<
DebugConnectionInfo
>();
final
Completer
<
DebugConnectionInfo
>
connectionInfoCompleter
=
Completer
<
DebugConnectionInfo
>();
unawaited
(
residentWebRunner
.
run
(
unawaited
(
residentWebRunner
.
run
(
connectionInfoCompleter:
connectionInfoCompleter
,
connectionInfoCompleter:
connectionInfoCompleter
,
...
@@ -803,23 +691,7 @@ void main() {
...
@@ -803,23 +691,7 @@ void main() {
connectionInfoCompleter:
connectionInfoCompleter
,
connectionInfoCompleter:
connectionInfoCompleter
,
));
));
await
connectionInfoCompleter
.
future
;
await
connectionInfoCompleter
.
future
;
when
(
mockWebDevFS
.
update
(
webDevFS
.
report
=
UpdateFSReport
(
success:
false
,
syncedBytes:
0
);
mainUri:
anyNamed
(
'mainUri'
),
target:
anyNamed
(
'target'
),
bundle:
anyNamed
(
'bundle'
),
firstBuildTime:
anyNamed
(
'firstBuildTime'
),
bundleFirstUpload:
anyNamed
(
'bundleFirstUpload'
),
generator:
anyNamed
(
'generator'
),
fullRestart:
anyNamed
(
'fullRestart'
),
dillOutputPath:
anyNamed
(
'dillOutputPath'
),
projectRootPath:
anyNamed
(
'projectRootPath'
),
pathToReload:
anyNamed
(
'pathToReload'
),
invalidatedFiles:
anyNamed
(
'invalidatedFiles'
),
packageConfig:
anyNamed
(
'packageConfig'
),
trackWidgetCreation:
anyNamed
(
'trackWidgetCreation'
),
)).
thenAnswer
((
Invocation
_
)
async
{
return
UpdateFSReport
(
success:
false
,
syncedBytes:
0
);
});
final
OperationResult
result
=
await
residentWebRunner
.
restart
(
fullRestart:
true
);
final
OperationResult
result
=
await
residentWebRunner
.
restart
(
fullRestart:
true
);
...
@@ -994,9 +866,8 @@ void main() {
...
@@ -994,9 +866,8 @@ void main() {
platform:
FakePlatform
(
operatingSystem:
'linux'
),
platform:
FakePlatform
(
operatingSystem:
'linux'
),
processManager:
FakeProcessManager
.
any
(),
processManager:
FakeProcessManager
.
any
(),
));
));
when
(
mockWebDevFS
.
create
()).
thenAnswer
((
Invocation
invocation
)
async
{
webDevFS
.
baseUri
=
Uri
.
parse
(
'http://localhost:8765/app/'
);
return
Uri
.
parse
(
'http://localhost:8765/app/'
);
});
final
FakeChromeTab
chromeTab
=
FakeChromeTab
(
'index.html'
);
final
FakeChromeTab
chromeTab
=
FakeChromeTab
(
'index.html'
);
chromeConnection
.
tabs
.
add
(
chromeTab
);
chromeConnection
.
tabs
.
add
(
chromeTab
);
...
@@ -1031,7 +902,6 @@ void main() {
...
@@ -1031,7 +902,6 @@ void main() {
)));
)));
expect
(
fakeVmServiceHost
.
hasRemainingExpectations
,
false
);
expect
(
fakeVmServiceHost
.
hasRemainingExpectations
,
false
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
Logger:
()
=>
FakeStatusLogger
(
BufferLogger
.
test
()),
FileSystem:
()
=>
fileSystem
,
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
processManager
,
ProcessManager:
()
=>
processManager
,
});
});
...
@@ -1043,9 +913,7 @@ void main() {
...
@@ -1043,9 +913,7 @@ void main() {
when
(
mockFlutterDevice
.
device
).
thenReturn
(
WebServerDevice
(
when
(
mockFlutterDevice
.
device
).
thenReturn
(
WebServerDevice
(
logger:
logger
,
logger:
logger
,
));
));
when
(
mockWebDevFS
.
create
()).
thenAnswer
((
Invocation
invocation
)
async
{
webDevFS
.
baseUri
=
Uri
.
parse
(
'http://localhost:8765/app/'
);
return
Uri
.
parse
(
'http://localhost:8765/app/'
);
});
final
ResidentWebRunner
runner
=
ResidentWebRunner
(
final
ResidentWebRunner
runner
=
ResidentWebRunner
(
mockFlutterDevice
,
mockFlutterDevice
,
...
@@ -1086,9 +954,7 @@ void main() {
...
@@ -1086,9 +954,7 @@ void main() {
final
ResidentRunner
residentWebRunner
=
setUpResidentRunner
(
mockFlutterDevice
);
final
ResidentRunner
residentWebRunner
=
setUpResidentRunner
(
mockFlutterDevice
);
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
<
VmServiceExpectation
>[]);
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
<
VmServiceExpectation
>[]);
_setupMocks
();
_setupMocks
();
webDevFS
.
exception
=
const
WebSocketException
();
when
(
mockWebDevFS
.
connect
(
any
))
.
thenThrow
(
const
WebSocketException
());
await
expectLater
(
residentWebRunner
.
run
,
throwsToolExit
());
await
expectLater
(
residentWebRunner
.
run
,
throwsToolExit
());
expect
(
fakeVmServiceHost
.
hasRemainingExpectations
,
false
);
expect
(
fakeVmServiceHost
.
hasRemainingExpectations
,
false
);
...
@@ -1101,9 +967,7 @@ void main() {
...
@@ -1101,9 +967,7 @@ void main() {
final
ResidentRunner
residentWebRunner
=
setUpResidentRunner
(
mockFlutterDevice
);
final
ResidentRunner
residentWebRunner
=
setUpResidentRunner
(
mockFlutterDevice
);
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
<
VmServiceExpectation
>[]);
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
<
VmServiceExpectation
>[]);
_setupMocks
();
_setupMocks
();
webDevFS
.
exception
=
AppConnectionException
(
''
);
when
(
mockWebDevFS
.
connect
(
any
))
.
thenThrow
(
AppConnectionException
(
''
));
await
expectLater
(
residentWebRunner
.
run
,
throwsToolExit
());
await
expectLater
(
residentWebRunner
.
run
,
throwsToolExit
());
expect
(
fakeVmServiceHost
.
hasRemainingExpectations
,
false
);
expect
(
fakeVmServiceHost
.
hasRemainingExpectations
,
false
);
...
@@ -1117,8 +981,7 @@ void main() {
...
@@ -1117,8 +981,7 @@ void main() {
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
<
VmServiceExpectation
>[]);
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
<
VmServiceExpectation
>[]);
_setupMocks
();
_setupMocks
();
when
(
mockWebDevFS
.
connect
(
any
))
webDevFS
.
exception
=
ChromeDebugException
(<
String
,
dynamic
>{});
.
thenThrow
(
ChromeDebugException
(<
String
,
dynamic
>{}));
await
expectLater
(
residentWebRunner
.
run
,
throwsToolExit
());
await
expectLater
(
residentWebRunner
.
run
,
throwsToolExit
());
expect
(
fakeVmServiceHost
.
hasRemainingExpectations
,
false
);
expect
(
fakeVmServiceHost
.
hasRemainingExpectations
,
false
);
...
@@ -1131,7 +994,7 @@ void main() {
...
@@ -1131,7 +994,7 @@ void main() {
final
ResidentRunner
residentWebRunner
=
setUpResidentRunner
(
mockFlutterDevice
);
final
ResidentRunner
residentWebRunner
=
setUpResidentRunner
(
mockFlutterDevice
);
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
<
VmServiceExpectation
>[]);
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
<
VmServiceExpectation
>[]);
_setupMocks
();
_setupMocks
();
w
hen
(
mockWebDevFS
.
connect
(
any
)).
thenThrow
(
Exception
()
);
w
ebDevFS
.
exception
=
Exception
(
);
await
expectLater
(
residentWebRunner
.
run
,
throwsException
);
await
expectLater
(
residentWebRunner
.
run
,
throwsException
);
expect
(
fakeVmServiceHost
.
hasRemainingExpectations
,
false
);
expect
(
fakeVmServiceHost
.
hasRemainingExpectations
,
false
);
...
@@ -1142,17 +1005,12 @@ void main() {
...
@@ -1142,17 +1005,12 @@ void main() {
testUsingContext
(
'Rethrows unknown Error type from dwds tooling'
,
()
async
{
testUsingContext
(
'Rethrows unknown Error type from dwds tooling'
,
()
async
{
final
BufferLogger
logger
=
BufferLogger
.
test
();
final
BufferLogger
logger
=
BufferLogger
.
test
();
final
FakeStatusLogger
fakeStatusLogger
=
FakeStatusLogger
(
logger
);
final
ResidentRunner
residentWebRunner
=
setUpResidentRunner
(
mockFlutterDevice
,
logger:
logger
);
final
ResidentRunner
residentWebRunner
=
setUpResidentRunner
(
mockFlutterDevice
,
logger:
fakeStatusLogger
);
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
<
VmServiceExpectation
>[]);
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
<
VmServiceExpectation
>[]);
_setupMocks
();
_setupMocks
();
final
MockStatus
mockStatus
=
MockStatus
();
webDevFS
.
exception
=
StateError
(
''
);
fakeStatusLogger
.
status
=
mockStatus
;
when
(
mockWebDevFS
.
connect
(
any
)).
thenThrow
(
StateError
(
''
));
await
expectLater
(
residentWebRunner
.
run
,
throwsStateError
);
await
expectLater
(
residentWebRunner
.
run
,
throwsStateError
);
verify
(
mockStatus
.
stop
()).
called
(
1
);
expect
(
fakeVmServiceHost
.
hasRemainingExpectations
,
false
);
expect
(
fakeVmServiceHost
.
hasRemainingExpectations
,
false
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fileSystem
,
FileSystem:
()
=>
fileSystem
,
...
@@ -1178,13 +1036,97 @@ ResidentRunner setUpResidentRunner(FlutterDevice flutterDevice, {
...
@@ -1178,13 +1036,97 @@ ResidentRunner setUpResidentRunner(FlutterDevice flutterDevice, {
);
);
}
}
class
MockChromeDevice
extends
Mock
implements
ChromiumDevice
{}
class
MockDebugConnection
extends
Mock
implements
DebugConnection
{}
class
MockDebugConnection
extends
Mock
implements
DebugConnection
{}
class
MockAppConnection
extends
Mock
implements
AppConnection
{}
class
MockAppConnection
extends
Mock
implements
AppConnection
{}
class
MockStatus
extends
Mock
implements
Status
{}
class
MockFlutterDevice
extends
Mock
implements
FlutterDevice
{}
class
MockFlutterDevice
extends
Mock
implements
FlutterDevice
{}
class
MockWebDevFS
extends
Mock
implements
WebDevFS
{}
class
MockWebServerDevice
extends
Mock
implements
WebServerDevice
{}
class
MockResidentCompiler
extends
Mock
implements
ResidentCompiler
{}
class
MockDevice
extends
Mock
implements
Device
{}
class
FakeChromeDevice
extends
Fake
implements
ChromiumDevice
{}
class
FakeWipDebugger
extends
Fake
implements
WipDebugger
{}
class
FakeResidentCompiler
extends
Fake
implements
ResidentCompiler
{
@override
Future
<
CompilerOutput
>
recompile
(
Uri
mainUri
,
List
<
Uri
>
invalidatedFiles
,
{
@required
String
outputPath
,
@required
PackageConfig
packageConfig
,
@required
String
projectRootPath
,
@required
FileSystem
fs
,
bool
suppressErrors
=
false
,
})
async
{
return
const
CompilerOutput
(
'foo.dill'
,
0
,
<
Uri
>[]);
}
@override
void
accept
()
{
}
@override
void
reset
()
{
}
@override
Future
<
CompilerOutput
>
reject
()
async
{
return
const
CompilerOutput
(
'foo.dill'
,
0
,
<
Uri
>[]);
}
@override
void
addFileSystemRoot
(
String
root
)
{
}
}
class
FakeWebDevFS
extends
Fake
implements
WebDevFS
{
Object
exception
;
ConnectionResult
result
;
UpdateFSReport
report
;
Uri
mainUri
;
@override
List
<
Uri
>
sources
=
<
Uri
>[];
@override
Uri
baseUri
=
Uri
.
parse
(
'http://localhost:12345'
);
@override
DateTime
lastCompiled
=
DateTime
.
now
();
@override
PackageConfig
lastPackageConfig
=
PackageConfig
.
empty
;
@override
Future
<
Uri
>
create
()
async
{
return
baseUri
;
}
@override
Future
<
UpdateFSReport
>
update
({
@required
Uri
mainUri
,
@required
ResidentCompiler
generator
,
@required
bool
trackWidgetCreation
,
@required
String
pathToReload
,
@required
List
<
Uri
>
invalidatedFiles
,
@required
PackageConfig
packageConfig
,
@required
String
dillOutputPath
,
DevFSWriter
devFSWriter
,
String
target
,
AssetBundle
bundle
,
DateTime
firstBuildTime
,
bool
bundleFirstUpload
=
false
,
bool
fullRestart
=
false
,
String
projectRootPath
,
})
async
{
this
.
mainUri
=
mainUri
;
return
report
;
}
@override
Future
<
ConnectionResult
>
connect
(
bool
useDebugExtension
)
async
{
if
(
exception
!=
null
)
{
throw
exception
;
}
return
result
;
}
}
class
FakeChromeConnection
extends
Fake
implements
ChromeConnection
{
class
FakeChromeConnection
extends
Fake
implements
ChromeConnection
{
final
List
<
ChromeTab
>
tabs
=
<
ChromeTab
>[];
final
List
<
ChromeTab
>
tabs
=
<
ChromeTab
>[];
...
@@ -1213,11 +1155,6 @@ class FakeWipConnection extends Fake implements WipConnection {
...
@@ -1213,11 +1155,6 @@ class FakeWipConnection extends Fake implements WipConnection {
final
WipDebugger
debugger
=
FakeWipDebugger
();
final
WipDebugger
debugger
=
FakeWipDebugger
();
}
}
class
FakeWipDebugger
extends
Fake
implements
WipDebugger
{}
class
MockWebServerDevice
extends
Mock
implements
WebServerDevice
{}
class
MockDevice
extends
Mock
implements
Device
{}
/// A test implementation of the [ChromiumLauncher] that launches a fixed instance.
/// A test implementation of the [ChromiumLauncher] that launches a fixed instance.
class
TestChromiumLauncher
implements
ChromiumLauncher
{
class
TestChromiumLauncher
implements
ChromiumLauncher
{
TestChromiumLauncher
();
TestChromiumLauncher
();
...
...
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