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
9e30d51a
Unverified
Commit
9e30d51a
authored
Jun 24, 2020
by
Jonah Williams
Committed by
GitHub
Jun 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] start fixing command tests (#60172)
parent
77bc1ee5
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
186 deletions
+73
-186
devices_test.dart
...tter_tools/test/commands.shard/hermetic/devices_test.dart
+10
-1
doctor_test.dart
...utter_tools/test/commands.shard/hermetic/doctor_test.dart
+24
-4
run_test.dart
.../flutter_tools/test/commands.shard/hermetic/run_test.dart
+39
-181
No files found.
packages/flutter_tools/test/commands.shard/hermetic/devices_test.dart
View file @
9e30d51a
...
@@ -34,7 +34,7 @@ void main() {
...
@@ -34,7 +34,7 @@ void main() {
expect
(
testLogger
.
statusText
,
containsIgnoringWhitespace
(
'No devices detected'
));
expect
(
testLogger
.
statusText
,
containsIgnoringWhitespace
(
'No devices detected'
));
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
AndroidSdk:
()
=>
null
,
AndroidSdk:
()
=>
null
,
DeviceManager:
()
=>
Device
Manager
(),
DeviceManager:
()
=>
NoDevices
Manager
(),
ProcessManager:
()
=>
MockProcessManager
(),
ProcessManager:
()
=>
MockProcessManager
(),
});
});
...
@@ -160,3 +160,12 @@ class _FakeDeviceManager extends DeviceManager {
...
@@ -160,3 +160,12 @@ class _FakeDeviceManager extends DeviceManager {
<
String
>[
'Cannot connect to device ABC'
]
<
String
>[
'Cannot connect to device ABC'
]
);
);
}
}
class
NoDevicesManager
extends
DeviceManager
{
@override
Future
<
List
<
Device
>>
getAllConnectedDevices
()
async
=>
<
Device
>[];
@override
Future
<
List
<
Device
>>
refreshAllConnectedDevices
({
Duration
timeout
})
=>
getAllConnectedDevices
();
}
packages/flutter_tools/test/commands.shard/hermetic/doctor_test.dart
View file @
9e30d51a
...
@@ -43,6 +43,11 @@ final Map<Type, Generator> noColorTerminalOverride = <Type, Generator>{
...
@@ -43,6 +43,11 @@ final Map<Type, Generator> noColorTerminalOverride = <Type, Generator>{
Platform:
_kNoColorOutputPlatform
,
Platform:
_kNoColorOutputPlatform
,
};
};
final
Platform
macPlatform
=
FakePlatform
(
operatingSystem:
'macos'
,
environment:
<
String
,
String
>{
'HOME'
:
'/foo/bar'
}
);
void
main
(
)
{
void
main
(
)
{
MockProcessManager
mockProcessManager
;
MockProcessManager
mockProcessManager
;
MockFlutterVersion
mockFlutterVersion
;
MockFlutterVersion
mockFlutterVersion
;
...
@@ -93,11 +98,14 @@ void main() {
...
@@ -93,11 +98,14 @@ void main() {
expect
(
validator
.
plistFile
,
'/path/to/app/Contents/Info.plist'
);
expect
(
validator
.
plistFile
,
'/path/to/app/Contents/Info.plist'
);
expect
(
validator
.
pluginsPath
,
pluginsDirectory
.
path
);
expect
(
validator
.
pluginsPath
,
pluginsDirectory
.
path
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
FakePlatform
()
Platform:
()
=>
macPlatform
,
..
environment
=
<
String
,
String
>{
'HOME'
:
'/foo/bar'
},
PlistParser:
()
=>
mockPlistParser
,
PlistParser:
()
=>
mockPlistParser
,
FileSystem:
()
=>
fileSystem
,
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
mockProcessManager
,
ProcessManager:
()
=>
mockProcessManager
,
FileSystemUtils:
()
=>
FileSystemUtils
(
fileSystem:
fileSystem
,
platform:
macPlatform
,
)
});
});
testUsingContext
(
'legacy intellij plugins path checking on mac'
,
()
async
{
testUsingContext
(
'legacy intellij plugins path checking on mac'
,
()
async
{
...
@@ -106,9 +114,14 @@ void main() {
...
@@ -106,9 +114,14 @@ void main() {
final
IntelliJValidatorOnMac
validator
=
IntelliJValidatorOnMac
(
'Test'
,
'TestID'
,
'/foo'
);
final
IntelliJValidatorOnMac
validator
=
IntelliJValidatorOnMac
(
'Test'
,
'TestID'
,
'/foo'
);
expect
(
validator
.
pluginsPath
,
'/foo/bar/Library/Application Support/TestID2020.10'
);
expect
(
validator
.
pluginsPath
,
'/foo/bar/Library/Application Support/TestID2020.10'
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
FakePlatform
()
Platform:
()
=>
macPlatform
,
..
environment
=
<
String
,
String
>{
'HOME'
:
'/foo/bar'
},
PlistParser:
()
=>
mockPlistParser
,
PlistParser:
()
=>
mockPlistParser
,
FileSystem:
()
=>
fileSystem
,
FileSystemUtils:
()
=>
FileSystemUtils
(
fileSystem:
fileSystem
,
platform:
macPlatform
,
),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
});
testUsingContext
(
'intellij plugins path checking on mac with override'
,
()
async
{
testUsingContext
(
'intellij plugins path checking on mac with override'
,
()
async
{
...
@@ -118,6 +131,13 @@ void main() {
...
@@ -118,6 +131,13 @@ void main() {
expect
(
validator
.
pluginsPath
,
'/path/to/JetBrainsToolboxApp.plugins'
);
expect
(
validator
.
pluginsPath
,
'/path/to/JetBrainsToolboxApp.plugins'
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
PlistParser:
()
=>
mockPlistParser
,
PlistParser:
()
=>
mockPlistParser
,
Platform:
()
=>
macPlatform
,
FileSystem:
()
=>
fileSystem
,
FileSystemUtils:
()
=>
FileSystemUtils
(
fileSystem:
fileSystem
,
platform:
macPlatform
,
),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
});
testUsingContext
(
'vs code validator when both installed'
,
()
async
{
testUsingContext
(
'vs code validator when both installed'
,
()
async
{
...
...
packages/flutter_tools/test/commands.shard/hermetic/run_test.dart
View file @
9e30d51a
This diff is collapsed.
Click to expand it.
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