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
05ce6ce5
Unverified
Commit
05ce6ce5
authored
Mar 03, 2021
by
Jonah Williams
Committed by
GitHub
Mar 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] remove mock from android studio test (#77158)
parent
67b2ca89
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
10 deletions
+17
-10
android_studio_test.dart
...tools/test/general.shard/android/android_studio_test.dart
+17
-10
No files found.
packages/flutter_tools/test/general.shard/android/android_studio_test.dart
View file @
05ce6ce5
...
...
@@ -11,7 +11,7 @@ import 'package:flutter_tools/src/base/platform.dart';
import
'package:flutter_tools/src/base/version.dart'
;
import
'package:flutter_tools/src/globals.dart'
as
globals
;
import
'package:flutter_tools/src/ios/plist_parser.dart'
;
import
'package:
mockito/mockito
.dart'
;
import
'package:
test/fake
.dart'
;
import
'../../src/common.dart'
;
import
'../../src/context.dart'
;
...
...
@@ -56,8 +56,6 @@ final Platform windowsPlatform = FakePlatform(
}
);
class
MockPlistUtils
extends
Mock
implements
PlistParser
{}
Platform
macPlatform
(
)
{
return
FakePlatform
(
operatingSystem:
'macos'
,
...
...
@@ -100,10 +98,10 @@ void main() {
group
(
'pluginsPath on Mac'
,
()
{
FileSystemUtils
fsUtils
;
Platform
platform
;
Mock
PlistUtils
plistUtils
;
Fake
PlistUtils
plistUtils
;
setUp
(()
{
plistUtils
=
Mock
PlistUtils
();
plistUtils
=
Fake
PlistUtils
();
platform
=
macPlatform
();
fsUtils
=
FileSystemUtils
(
fileSystem:
fileSystem
,
...
...
@@ -121,7 +119,7 @@ void main() {
globals
.
fs
.
directory
(
studioInApplicationPlistFolder
).
createSync
(
recursive:
true
);
final
String
plistFilePath
=
globals
.
fs
.
path
.
join
(
studioInApplicationPlistFolder
,
'Info.plist'
);
when
(
plistUtils
.
parseFile
(
plistFilePath
)).
thenReturn
(
macStudioInfoPlist4_1
)
;
plistUtils
.
fileContents
[
plistFilePath
]
=
macStudioInfoPlist4_1
;
final
AndroidStudio
studio
=
AndroidStudio
.
fromMacOSBundle
(
globals
.
fs
.
directory
(
studioInApplicationPlistFolder
)?.
parent
?.
path
,
);
...
...
@@ -154,7 +152,7 @@ void main() {
globals
.
fs
.
directory
(
studioInApplicationPlistFolder
).
createSync
(
recursive:
true
);
final
String
plistFilePath
=
globals
.
fs
.
path
.
join
(
studioInApplicationPlistFolder
,
'Info.plist'
);
when
(
plistUtils
.
parseFile
(
plistFilePath
)).
thenReturn
(
macStudioInfoPlist
)
;
plistUtils
.
fileContents
[
plistFilePath
]
=
macStudioInfoPlist
;
final
AndroidStudio
studio
=
AndroidStudio
.
fromMacOSBundle
(
globals
.
fs
.
directory
(
studioInApplicationPlistFolder
)?.
parent
?.
path
,
);
...
...
@@ -186,7 +184,7 @@ void main() {
globals
.
fs
.
directory
(
studioInApplicationPlistFolder
).
createSync
(
recursive:
true
);
final
String
plistFilePath
=
globals
.
fs
.
path
.
join
(
studioInApplicationPlistFolder
,
'Info.plist'
);
when
(
plistUtils
.
parseFile
(
plistFilePath
)).
thenReturn
(
macStudioInfoPlist
)
;
plistUtils
.
fileContents
[
plistFilePath
]
=
macStudioInfoPlist
;
final
AndroidStudio
studio
=
AndroidStudio
.
fromMacOSBundle
(
globals
.
fs
.
directory
(
studioInApplicationPlistFolder
)?.
parent
?.
path
,
);
...
...
@@ -226,7 +224,7 @@ void main() {
jetbrainsStudioInApplicationPlistFolder
,
'Info.plist'
,
);
when
(
plistUtils
.
parseFile
(
jetbrainsPlistFilePath
)).
thenReturn
(
jetbrainsInfoPlist
)
;
plistUtils
.
fileContents
[
jetbrainsPlistFilePath
]
=
jetbrainsInfoPlist
;
final
String
studioInApplicationPlistFolder
=
globals
.
fs
.
path
.
join
(
globals
.
fs
.
path
.
join
(
homeMac
,
'Library'
,
'Application Support'
),
...
...
@@ -243,7 +241,7 @@ void main() {
studioInApplicationPlistFolder
,
'Info.plist'
,
);
when
(
plistUtils
.
parseFile
(
studioPlistFilePath
)).
thenReturn
(
macStudioInfoPlist
)
;
plistUtils
.
fileContents
[
studioPlistFilePath
]
=
macStudioInfoPlist
;
final
AndroidStudio
studio
=
AndroidStudio
.
fromMacOSBundle
(
globals
.
fs
.
directory
(
jetbrainsStudioInApplicationPlistFolder
)?.
parent
?.
path
,
...
...
@@ -382,3 +380,12 @@ void main() {
});
});
}
class
FakePlistUtils
extends
Fake
implements
PlistParser
{
final
Map
<
String
,
Map
<
String
,
dynamic
>>
fileContents
=
<
String
,
Map
<
String
,
dynamic
>>{};
@override
Map
<
String
,
dynamic
>
parseFile
(
String
plistFilePath
)
{
return
fileContents
[
plistFilePath
];
}
}
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