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
24883e1c
Unverified
Commit
24883e1c
authored
Mar 06, 2020
by
Dan Field
Committed by
GitHub
Mar 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add overrides for FileSystemUtils (#52080)
parent
fc3f0388
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
3 deletions
+49
-3
simulators_test.dart
...flutter_tools/test/general.shard/ios/simulators_test.dart
+49
-3
No files found.
packages/flutter_tools/test/general.shard/ios/simulators_test.dart
View file @
24883e1c
...
...
@@ -39,10 +39,14 @@ class MockPlistUtils extends Mock implements PlistParser {}
void
main
(
)
{
FakePlatform
osx
;
FileSystemUtils
fsUtils
;
MemoryFileSystem
fileSystem
;
setUp
(()
{
osx
=
FakePlatform
.
fromPlatform
(
const
LocalPlatform
());
osx
.
operatingSystem
=
'macos'
;
fileSystem
=
MemoryFileSystem
();
fsUtils
=
FileSystemUtils
(
fileSystem:
fileSystem
,
platform:
osx
);
});
group
(
'_IOSSimulatorDevicePortForwarder'
,
()
{
...
...
@@ -60,6 +64,8 @@ void main() {
expect
(
portForwarder
.
forwardedPorts
.
length
,
0
);
},
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
osx
,
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
},
testOn:
'posix'
);
});
...
...
@@ -69,6 +75,9 @@ void main() {
expect
(
IOSSimulator
(
'123'
).
logFilePath
,
'/foo/bar/Library/Logs/CoreSimulator/123/system.log'
);
},
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
osx
,
FileSystemUtils:
()
=>
fsUtils
,
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
},
testOn:
'posix'
);
testUsingContext
(
'respects IOS_SIMULATOR_LOG_FILE_PATH'
,
()
{
...
...
@@ -77,6 +86,9 @@ void main() {
expect
(
IOSSimulator
(
'456'
).
logFilePath
,
'/baz/qux/456/system.log'
);
},
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
osx
,
FileSystemUtils:
()
=>
fsUtils
,
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
});
...
...
@@ -155,54 +167,72 @@ void main() {
expect
(
IOSSimulator
(
'x'
,
name:
'Apple TV'
).
isSupported
(),
false
);
},
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
osx
,
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
testUsingContext
(
'Apple Watch is unsupported'
,
()
{
expect
(
IOSSimulator
(
'x'
,
name:
'Apple Watch'
).
isSupported
(),
false
);
},
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
osx
,
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
testUsingContext
(
'iPad 2 is supported'
,
()
{
expect
(
IOSSimulator
(
'x'
,
name:
'iPad 2'
).
isSupported
(),
true
);
},
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
osx
,
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
testUsingContext
(
'iPad Retina is supported'
,
()
{
expect
(
IOSSimulator
(
'x'
,
name:
'iPad Retina'
).
isSupported
(),
true
);
},
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
osx
,
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
testUsingContext
(
'iPhone 5 is supported'
,
()
{
expect
(
IOSSimulator
(
'x'
,
name:
'iPhone 5'
).
isSupported
(),
true
);
},
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
osx
,
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
testUsingContext
(
'iPhone 5s is supported'
,
()
{
expect
(
IOSSimulator
(
'x'
,
name:
'iPhone 5s'
).
isSupported
(),
true
);
},
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
osx
,
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
testUsingContext
(
'iPhone SE is supported'
,
()
{
expect
(
IOSSimulator
(
'x'
,
name:
'iPhone SE'
).
isSupported
(),
true
);
},
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
osx
,
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
testUsingContext
(
'iPhone 7 Plus is supported'
,
()
{
expect
(
IOSSimulator
(
'x'
,
name:
'iPhone 7 Plus'
).
isSupported
(),
true
);
},
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
osx
,
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
testUsingContext
(
'iPhone X is supported'
,
()
{
expect
(
IOSSimulator
(
'x'
,
name:
'iPhone X'
).
isSupported
(),
true
);
},
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
osx
,
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
});
...
...
@@ -224,6 +254,8 @@ void main() {
});
},
overrides:
<
Type
,
Generator
>{
BuildSystem:
()
=>
MockBuildSystem
(),
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
group
(
'Simulator screenshot'
,
()
{
...
...
@@ -251,7 +283,11 @@ void main() {
when
(
mockXcode
.
minorVersion
).
thenReturn
(
1
);
expect
(
deviceUnderTest
.
supportsScreenshot
,
false
);
},
overrides:
<
Type
,
Generator
>{
Xcode:
()
=>
mockXcode
},
overrides:
<
Type
,
Generator
>{
Xcode:
()
=>
mockXcode
,
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
},
);
testUsingContext
(
...
...
@@ -281,6 +317,7 @@ void main() {
// Test a real one. Screenshot doesn't require instance states.
SimControl:
()
=>
SimControl
(),
Xcode:
()
=>
mockXcode
,
FileSystem:
()
=>
fileSystem
,
},
);
});
...
...
@@ -304,6 +341,7 @@ void main() {
},
overrides:
<
Type
,
Generator
>{
ProcessManager:
()
=>
mockProcessManager
,
FileSystem:
()
=>
fileSystem
,
});
testUsingContext
(
'uses /usr/bin/log on iOS 11 and above'
,
()
async
{
...
...
@@ -316,6 +354,7 @@ void main() {
},
overrides:
<
Type
,
Generator
>{
ProcessManager:
()
=>
mockProcessManager
,
FileSystem:
()
=>
fileSystem
,
});
});
...
...
@@ -338,6 +377,7 @@ void main() {
},
overrides:
<
Type
,
Generator
>{
ProcessManager:
()
=>
mockProcessManager
,
FileSystem:
()
=>
fileSystem
,
});
testUsingContext
(
'uses /usr/bin/log on iOS 11 and above'
,
()
async
{
...
...
@@ -347,6 +387,7 @@ void main() {
},
overrides:
<
Type
,
Generator
>{
ProcessManager:
()
=>
mockProcessManager
,
FileSystem:
()
=>
fileSystem
,
});
});
...
...
@@ -392,6 +433,7 @@ void main() {
]);
},
overrides:
<
Type
,
Generator
>{
ProcessManager:
()
=>
mockProcessManager
,
FileSystem:
()
=>
fileSystem
,
});
});
...
...
@@ -469,6 +511,7 @@ void main() {
},
overrides:
<
Type
,
Generator
>{
ProcessManager:
()
=>
mockProcessManager
,
SimControl:
()
=>
simControl
,
FileSystem:
()
=>
fileSystem
,
});
testUsingContext
(
'getDevices handles bad simctl output'
,
()
async
{
...
...
@@ -480,6 +523,7 @@ void main() {
},
overrides:
<
Type
,
Generator
>{
ProcessManager:
()
=>
mockProcessManager
,
SimControl:
()
=>
simControl
,
FileSystem:
()
=>
fileSystem
,
});
testUsingContext
(
'sdkMajorVersion defaults to 11 when sdkNameAndVersion is junk'
,
()
async
{
...
...
@@ -511,6 +555,8 @@ void main() {
},
overrides:
<
Type
,
Generator
>{
SimControl:
()
=>
simControl
,
PlistParser:
()
=>
MockPlistUtils
(),
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
});
...
...
@@ -540,8 +586,8 @@ flutter:
expect
(
IOSSimulator
(
'test'
).
isSupportedForProject
(
flutterProject
),
true
);
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
MemoryFileSystem
(),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
FileSystem:
()
=>
fileSystem
,
});
testUsingContext
(
'IOSDevice.isSupportedForProject is false with no host app and no module'
,
()
async
{
...
...
@@ -551,7 +597,7 @@ flutter:
expect
(
IOSSimulator
(
'test'
).
isSupportedForProject
(
flutterProject
),
false
);
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
MemoryFileSystem
()
,
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
}
...
...
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