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
73506f36
Unverified
Commit
73506f36
authored
Feb 02, 2021
by
Jenn Magder
Committed by
GitHub
Feb 02, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace MockConfig with TestConfig (#75044)
parent
d59359f1
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
60 additions
and
75 deletions
+60
-75
config.dart
packages/flutter_tools/lib/src/base/config.dart
+11
-5
persistent_tool_state.dart
packages/flutter_tools/lib/src/persistent_tool_state.dart
+1
-1
analytics_test.dart
...ages/flutter_tools/test/general.shard/analytics_test.dart
+8
-14
android_sdk_test.dart
...er_tools/test/general.shard/android/android_sdk_test.dart
+1
-6
android_studio_validator_test.dart
.../general.shard/android/android_studio_validator_test.dart
+1
-6
features_test.dart
packages/flutter_tools/test/general.shard/features_test.dart
+24
-22
code_signing_test.dart
...utter_tools/test/general.shard/ios/code_signing_test.dart
+11
-12
flutter_tester_test.dart
..._tools/test/general.shard/tester/flutter_tester_test.dart
+2
-8
context.dart
packages/flutter_tools/test/src/context.dart
+1
-1
No files found.
packages/flutter_tools/lib/src/base/config.dart
View file @
73506f36
...
...
@@ -4,6 +4,7 @@
// @dart = 2.8
import
'package:file/memory.dart'
;
import
'package:meta/meta.dart'
;
import
'../convert.dart'
;
...
...
@@ -38,11 +39,16 @@ class Config {
/// Constructs a new [Config] object from a file called [name] in
/// the given [Directory].
factory
Config
.
test
(
String
name
,
{
@required
Directory
directory
,
@required
Logger
logger
,
})
=>
Config
.
createForTesting
(
directory
.
childFile
(
'.
${kConfigDir}
_
$name
'
),
logger
);
///
/// Defaults to [BufferLogger], [MemoryFileSystem], and [name]=test.
factory
Config
.
test
({
String
name
=
'test'
,
Directory
directory
,
Logger
logger
,
})
{
directory
??=
MemoryFileSystem
.
test
().
directory
(
'/'
);
return
Config
.
createForTesting
(
directory
.
childFile
(
'.
${kConfigDir}
_
$name
'
),
logger
??
BufferLogger
.
test
());
}
/// Test only access to the Config constructor.
@visibleForTesting
...
...
packages/flutter_tools/lib/src/persistent_tool_state.dart
View file @
73506f36
...
...
@@ -76,7 +76,7 @@ class _DefaultPersistentToolState implements PersistentToolState {
@required
Directory
directory
,
@required
Logger
logger
,
})
:
_config
=
Config
.
test
(
_kFileName
,
name:
_kFileName
,
directory:
directory
,
logger:
logger
,
);
...
...
packages/flutter_tools/test/general.shard/analytics_test.dart
View file @
73506f36
...
...
@@ -35,12 +35,12 @@ void main() {
group
(
'analytics'
,
()
{
Directory
tempDir
;
MockFlutterConfig
mockFlutter
Config
;
Config
test
Config
;
setUp
(()
{
Cache
.
flutterRoot
=
'../..'
;
tempDir
=
globals
.
fs
.
systemTempDirectory
.
createTempSync
(
'flutter_tools_analytics_test.'
);
mockFlutterConfig
=
MockFlutterConfig
();
testConfig
=
Config
.
test
();
});
tearDown
(()
{
...
...
@@ -105,8 +105,7 @@ void main() {
});
testUsingContext
(
'Usage records one feature in experiment setting'
,
()
async
{
when
<
bool
>(
mockFlutterConfig
.
getValue
(
flutterWebFeature
.
configSetting
)
as
bool
)
.
thenReturn
(
true
);
testConfig
.
setValue
(
flutterWebFeature
.
configSetting
,
true
);
final
Usage
usage
=
Usage
(
runningOnBot:
true
);
usage
.
sendCommand
(
'test'
);
...
...
@@ -115,7 +114,7 @@ void main() {
expect
(
globals
.
fs
.
file
(
'test'
).
readAsStringSync
(),
contains
(
'
$featuresKey
: enable-web'
));
},
overrides:
<
Type
,
Generator
>{
FlutterVersion:
()
=>
FlutterVersion
(
clock:
const
SystemClock
()),
Config:
()
=>
mockFlutter
Config
,
Config:
()
=>
test
Config
,
Platform:
()
=>
FakePlatform
(
environment:
<
String
,
String
>{
'FLUTTER_ANALYTICS_LOG_FILE'
:
'test'
,
}),
...
...
@@ -124,12 +123,9 @@ void main() {
});
testUsingContext
(
'Usage records multiple features in experiment setting'
,
()
async
{
when
<
bool
>(
mockFlutterConfig
.
getValue
(
flutterWebFeature
.
configSetting
)
as
bool
)
.
thenReturn
(
true
);
when
<
bool
>(
mockFlutterConfig
.
getValue
(
flutterLinuxDesktopFeature
.
configSetting
)
as
bool
)
.
thenReturn
(
true
);
when
<
bool
>(
mockFlutterConfig
.
getValue
(
flutterMacOSDesktopFeature
.
configSetting
)
as
bool
)
.
thenReturn
(
true
);
testConfig
.
setValue
(
flutterWebFeature
.
configSetting
,
true
);
testConfig
.
setValue
(
flutterLinuxDesktopFeature
.
configSetting
,
true
);
testConfig
.
setValue
(
flutterMacOSDesktopFeature
.
configSetting
,
true
);
final
Usage
usage
=
Usage
(
runningOnBot:
true
);
usage
.
sendCommand
(
'test'
);
...
...
@@ -141,7 +137,7 @@ void main() {
);
},
overrides:
<
Type
,
Generator
>{
FlutterVersion:
()
=>
FlutterVersion
(
clock:
const
SystemClock
()),
Config:
()
=>
mockFlutter
Config
,
Config:
()
=>
test
Config
,
Platform:
()
=>
FakePlatform
(
environment:
<
String
,
String
>{
'FLUTTER_ANALYTICS_LOG_FILE'
:
'test'
,
}),
...
...
@@ -370,8 +366,6 @@ class FakeFlutterCommand extends FlutterCommand {
class
MockDoctor
extends
Mock
implements
Doctor
{}
class
MockFlutterConfig
extends
Mock
implements
Config
{}
class
FakeClock
extends
Fake
implements
SystemClock
{
List
<
int
>
times
=
<
int
>[];
...
...
packages/flutter_tools/test/general.shard/android/android_sdk_test.dart
View file @
73506f36
...
...
@@ -9,7 +9,6 @@ import 'package:flutter_tools/src/android/android_sdk.dart';
import
'package:flutter_tools/src/base/config.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/io.dart'
show
ProcessResult
;
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/base/platform.dart'
;
import
'package:meta/meta.dart'
;
import
'package:mockito/mockito.dart'
;
...
...
@@ -29,11 +28,7 @@ void main() {
setUp
(()
{
fileSystem
=
MemoryFileSystem
.
test
();
processManager
=
MockProcessManager
();
config
=
Config
.
test
(
'test'
,
directory:
fileSystem
.
currentDirectory
,
logger:
BufferLogger
.
test
(),
);
config
=
Config
.
test
();
});
group
(
'android_sdk AndroidSdk'
,
()
{
...
...
packages/flutter_tools/test/general.shard/android/android_studio_validator_test.dart
View file @
73506f36
...
...
@@ -9,7 +9,6 @@ import 'package:flutter_tools/src/android/android_studio_validator.dart';
import
'package:flutter_tools/src/base/config.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/io.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/base/platform.dart'
;
import
'package:flutter_tools/src/base/user_messages.dart'
;
import
'package:flutter_tools/src/doctor.dart'
;
...
...
@@ -36,11 +35,7 @@ void main() {
});
testWithoutContext
(
'NoAndroidStudioValidator shows Android Studio as "not available" when not available.'
,
()
async
{
final
Config
config
=
Config
.
test
(
'test'
,
directory:
fileSystem
.
currentDirectory
,
logger:
BufferLogger
.
test
(),
);
final
Config
config
=
Config
.
test
();
final
NoAndroidStudioValidator
validator
=
NoAndroidStudioValidator
(
config:
config
,
platform:
linuxPlatform
,
...
...
packages/flutter_tools/test/general.shard/features_test.dart
View file @
73506f36
...
...
@@ -15,20 +15,23 @@ import '../src/common.dart';
void
main
(
)
{
group
(
'Features'
,
()
{
MockFlutterVerion
mockFlutterVerion
;
MockFlutterConfig
mockFlutter
Config
;
Config
test
Config
;
MockPlatform
mockPlatform
;
FlutterFeatureFlags
featureFlags
;
setUp
(()
{
mockFlutterVerion
=
MockFlutterVerion
();
mockFlutterConfig
=
MockFlutterConfig
();
testConfig
=
Config
.
test
();
mockPlatform
=
MockPlatform
();
when
(
mockPlatform
.
environment
).
thenReturn
(<
String
,
String
>{});
when
<
bool
>(
mockFlutterConfig
.
getValue
(
any
)
as
bool
).
thenReturn
(
false
);
for
(
final
Feature
feature
in
allFeatures
)
{
testConfig
.
setValue
(
feature
.
configSetting
,
false
);
}
featureFlags
=
FlutterFeatureFlags
(
flutterVersion:
mockFlutterVerion
,
config:
mockFlutter
Config
,
config:
test
Config
,
platform:
mockPlatform
,
);
});
...
...
@@ -129,7 +132,7 @@ void main() {
testWithoutContext
(
'flutter web enabled with config on master'
,
()
{
when
(
mockFlutterVerion
.
channel
).
thenReturn
(
'master'
);
when
<
bool
>(
mockFlutterConfig
.
getValue
(
'enable-web'
)
as
bool
).
thenReturn
(
true
);
testConfig
.
setValue
(
'enable-web'
,
true
);
expect
(
featureFlags
.
isWebEnabled
,
true
);
});
...
...
@@ -149,7 +152,7 @@ void main() {
testWithoutContext
(
'flutter web enabled with config on dev'
,
()
{
when
(
mockFlutterVerion
.
channel
).
thenReturn
(
'dev'
);
when
<
bool
>(
mockFlutterConfig
.
getValue
(
'enable-web'
)
as
bool
).
thenReturn
(
true
);
testConfig
.
setValue
(
'enable-web'
,
true
);
expect
(
featureFlags
.
isWebEnabled
,
true
);
});
...
...
@@ -169,7 +172,7 @@ void main() {
testWithoutContext
(
'flutter web enabled with config on beta'
,
()
{
when
(
mockFlutterVerion
.
channel
).
thenReturn
(
'beta'
);
when
<
bool
>(
mockFlutterConfig
.
getValue
(
'enable-web'
)
as
bool
).
thenReturn
(
true
);
testConfig
.
setValue
(
'enable-web'
,
true
);
expect
(
featureFlags
.
isWebEnabled
,
true
);
});
...
...
@@ -183,14 +186,14 @@ void main() {
testWithoutContext
(
'flutter web on by default on stable'
,
()
{
when
(
mockFlutterVerion
.
channel
).
thenReturn
(
'stable'
);
when
<
bool
>(
mockFlutterConfig
.
getValue
(
any
)
as
bool
).
thenReturn
(
null
);
testConfig
.
removeValue
(
'enable-web'
);
expect
(
featureFlags
.
isWebEnabled
,
true
);
});
testWithoutContext
(
'flutter web enabled with config on stable'
,
()
{
when
(
mockFlutterVerion
.
channel
).
thenReturn
(
'stable'
);
when
<
bool
>(
mockFlutterConfig
.
getValue
(
'enable-web'
)
as
bool
).
thenReturn
(
true
);
testConfig
.
setValue
(
'enable-web'
,
true
);
expect
(
featureFlags
.
isWebEnabled
,
true
);
});
...
...
@@ -212,7 +215,7 @@ void main() {
testWithoutContext
(
'flutter macos desktop enabled with config on master'
,
()
{
when
(
mockFlutterVerion
.
channel
).
thenReturn
(
'master'
);
when
<
bool
>(
mockFlutterConfig
.
getValue
(
'enable-macos-desktop'
)
as
bool
).
thenReturn
(
true
);
testConfig
.
setValue
(
'enable-macos-desktop'
,
true
);
expect
(
featureFlags
.
isMacOSEnabled
,
true
);
});
...
...
@@ -232,7 +235,7 @@ void main() {
testWithoutContext
(
'flutter macos desktop enabled with config on dev'
,
()
{
when
(
mockFlutterVerion
.
channel
).
thenReturn
(
'dev'
);
when
<
bool
>(
mockFlutterConfig
.
getValue
(
'enable-macos-desktop'
)
as
bool
).
thenReturn
(
true
);
testConfig
.
setValue
(
'enable-macos-desktop'
,
true
);
expect
(
featureFlags
.
isMacOSEnabled
,
true
);
});
...
...
@@ -252,7 +255,7 @@ void main() {
testWithoutContext
(
'flutter macos desktop enabled with config on beta'
,
()
{
when
(
mockFlutterVerion
.
channel
).
thenReturn
(
'beta'
);
when
<
bool
>(
mockFlutterConfig
.
getValue
(
'enable-macos-desktop'
)
as
bool
).
thenReturn
(
true
);
testConfig
.
setValue
(
'enable-macos-desktop'
,
true
);
expect
(
featureFlags
.
isMacOSEnabled
,
true
);
});
...
...
@@ -272,7 +275,7 @@ void main() {
testWithoutContext
(
'flutter macos desktop enabled with config on stable'
,
()
{
when
(
mockFlutterVerion
.
channel
).
thenReturn
(
'stable'
);
when
<
bool
>(
mockFlutterConfig
.
getValue
(
'enable-macos-desktop'
)
as
bool
).
thenReturn
(
true
);
testConfig
.
setValue
(
'enable-macos-desktop'
,
true
);
expect
(
featureFlags
.
isMacOSEnabled
,
true
);
});
...
...
@@ -293,7 +296,7 @@ void main() {
testWithoutContext
(
'flutter linux desktop enabled with config on master'
,
()
{
when
(
mockFlutterVerion
.
channel
).
thenReturn
(
'master'
);
when
<
bool
>(
mockFlutterConfig
.
getValue
(
'enable-linux-desktop'
)
as
bool
).
thenReturn
(
true
);
testConfig
.
setValue
(
'enable-linux-desktop'
,
true
);
expect
(
featureFlags
.
isLinuxEnabled
,
true
);
});
...
...
@@ -313,7 +316,7 @@ void main() {
testWithoutContext
(
'flutter linux desktop enabled with config on dev'
,
()
{
when
(
mockFlutterVerion
.
channel
).
thenReturn
(
'dev'
);
when
<
bool
>(
mockFlutterConfig
.
getValue
(
'enable-linux-desktop'
)
as
bool
).
thenReturn
(
true
);
testConfig
.
setValue
(
'enable-linux-desktop'
,
true
);
expect
(
featureFlags
.
isLinuxEnabled
,
true
);
});
...
...
@@ -333,7 +336,7 @@ void main() {
testWithoutContext
(
'flutter linux desktop enabled with config on beta'
,
()
{
when
(
mockFlutterVerion
.
channel
).
thenReturn
(
'beta'
);
when
<
bool
>(
mockFlutterConfig
.
getValue
(
'enable-linux-desktop'
)
as
bool
).
thenReturn
(
true
);
testConfig
.
setValue
(
'enable-linux-desktop'
,
true
);
expect
(
featureFlags
.
isLinuxEnabled
,
true
);
});
...
...
@@ -353,7 +356,7 @@ void main() {
testWithoutContext
(
'flutter linux desktop enabled with config on stable'
,
()
{
when
(
mockFlutterVerion
.
channel
).
thenReturn
(
'stable'
);
when
<
bool
>(
mockFlutterConfig
.
getValue
(
'enable-linux-desktop'
)
as
bool
).
thenReturn
(
true
);
testConfig
.
setValue
(
'enable-linux-desktop'
,
true
);
expect
(
featureFlags
.
isLinuxEnabled
,
true
);
});
...
...
@@ -374,7 +377,7 @@ void main() {
testWithoutContext
(
'flutter windows desktop enabled with config on master'
,
()
{
when
(
mockFlutterVerion
.
channel
).
thenReturn
(
'master'
);
when
<
bool
>(
mockFlutterConfig
.
getValue
(
'enable-windows-desktop'
)
as
bool
).
thenReturn
(
true
);
testConfig
.
setValue
(
'enable-windows-desktop'
,
true
);
expect
(
featureFlags
.
isWindowsEnabled
,
true
);
});
...
...
@@ -394,7 +397,7 @@ void main() {
testWithoutContext
(
'flutter windows desktop enabled with config on dev'
,
()
{
when
(
mockFlutterVerion
.
channel
).
thenReturn
(
'dev'
);
when
<
bool
>(
mockFlutterConfig
.
getValue
(
'enable-windows-desktop'
)
as
bool
).
thenReturn
(
true
);
testConfig
.
setValue
(
'enable-windows-desktop'
,
true
);
expect
(
featureFlags
.
isWindowsEnabled
,
true
);
});
...
...
@@ -414,7 +417,7 @@ void main() {
testWithoutContext
(
'flutter windows desktop enabled with config on beta'
,
()
{
when
(
mockFlutterVerion
.
channel
).
thenReturn
(
'beta'
);
when
<
bool
>(
mockFlutterConfig
.
getValue
(
'enable-windows-desktop'
)
as
bool
).
thenReturn
(
true
);
testConfig
.
setValue
(
'enable-windows-desktop'
,
true
);
expect
(
featureFlags
.
isWindowsEnabled
,
true
);
});
...
...
@@ -434,7 +437,7 @@ void main() {
testWithoutContext
(
'flutter windows desktop enabled with config on stable'
,
()
{
when
(
mockFlutterVerion
.
channel
).
thenReturn
(
'stable'
);
when
<
bool
>(
mockFlutterConfig
.
getValue
(
'enable-windows-desktop'
)
as
bool
).
thenReturn
(
true
);
testConfig
.
setValue
(
'enable-windows-desktop'
,
true
);
expect
(
featureFlags
.
isWindowsEnabled
,
true
);
});
...
...
@@ -449,7 +452,6 @@ void main() {
}
class
MockFlutterVerion
extends
Mock
implements
FlutterVersion
{}
class
MockFlutterConfig
extends
Mock
implements
Config
{}
class
MockPlatform
extends
Mock
implements
Platform
{}
T
nonconst
<
T
>(
T
item
)
=>
item
;
packages/flutter_tools/test/general.shard/ios/code_signing_test.dart
View file @
73506f36
...
...
@@ -25,7 +25,7 @@ import '../../src/mocks.dart';
void
main
(
)
{
group
(
'Auto signing'
,
()
{
ProcessManager
mockProcessManager
;
Config
mock
Config
;
Config
test
Config
;
IosProject
mockIosProject
;
BuildableIOSApp
app
;
AnsiTerminal
testTerminal
;
...
...
@@ -36,7 +36,7 @@ void main() {
mockProcessManager
=
MockProcessManager
();
// Assume all binaries exist and are executable
when
(
mockProcessManager
.
canRun
(
any
)).
thenReturn
(
true
);
mockConfig
=
MockConfig
();
testConfig
=
Config
.
test
();
mockIosProject
=
MockIosProject
();
when
(
mockIosProject
.
buildSettingsForBuildInfo
(
any
)).
thenAnswer
((
_
)
{
return
Future
<
Map
<
String
,
String
>>.
value
(<
String
,
String
>{
...
...
@@ -343,10 +343,10 @@ void main() {
verify
(
mockOpenSslStdIn
.
write
(
'This is a mock certificate'
));
expect
(
signingConfigs
,
<
String
,
String
>{
'DEVELOPMENT_TEAM'
:
'4444DDDD44'
});
verify
(
globals
.
config
.
setValue
(
'ios-signing-cert'
,
'iPhone Developer: Profile 3 (3333CCCC33)'
)
);
expect
(
testConfig
.
getValue
(
'ios-signing-cert'
),
'iPhone Developer: Profile 3 (3333CCCC33)'
);
},
overrides:
<
Type
,
Generator
>{
Config:
()
=>
mock
Config
,
Config:
()
=>
test
Config
,
AnsiTerminal:
()
=>
testTerminal
,
OutputPreferences:
()
=>
OutputPreferences
(
wrapText:
false
),
});
...
...
@@ -426,7 +426,7 @@ void main() {
expect
(
signingConfigs
,
<
String
,
String
>{
'DEVELOPMENT_TEAM'
:
'5555EEEE55'
});
},
overrides:
<
Type
,
Generator
>{
Config:
()
=>
mock
Config
,
Config:
()
=>
test
Config
,
AnsiTerminal:
()
=>
testTerminal
,
OutputPreferences:
()
=>
OutputPreferences
(
wrapText:
false
),
});
...
...
@@ -486,7 +486,7 @@ void main() {
));
when
(
mockOpenSslProcess
.
stderr
).
thenAnswer
((
Invocation
invocation
)
=>
mockOpenSslStdErr
);
when
(
mockOpenSslProcess
.
exitCode
).
thenAnswer
((
_
)
=>
Future
<
int
>.
value
(
0
));
when
<
String
>(
mockConfig
.
getValue
(
'ios-signing-cert'
)
as
String
).
thenReturn
(
'iPhone Developer: Profile 3 (3333CCCC33)'
);
testConfig
.
setValue
(
'ios-signing-cert'
,
'iPhone Developer: Profile 3 (3333CCCC33)'
);
final
Map
<
String
,
String
>
signingConfigs
=
await
getCodeSigningIdentityDevelopmentTeam
(
iosApp:
app
,
...
...
@@ -508,7 +508,7 @@ void main() {
expect
(
signingConfigs
,
<
String
,
String
>{
'DEVELOPMENT_TEAM'
:
'4444DDDD44'
});
},
overrides:
<
Type
,
Generator
>{
Config:
()
=>
mock
Config
,
Config:
()
=>
test
Config
,
OutputPreferences:
()
=>
OutputPreferences
(
wrapText:
false
),
});
...
...
@@ -570,7 +570,7 @@ void main() {
));
when
(
mockOpenSslProcess
.
stderr
).
thenAnswer
((
Invocation
invocation
)
=>
mockOpenSslStdErr
);
when
(
mockOpenSslProcess
.
exitCode
).
thenAnswer
((
_
)
=>
Future
<
int
>.
value
(
0
));
when
<
String
>(
mockConfig
.
getValue
(
'ios-signing-cert'
)
as
String
).
thenReturn
(
'iPhone Developer: Invalid Profile'
);
testConfig
.
setValue
(
'ios-signing-cert'
,
'iPhone Developer: Invalid Profile'
);
final
Map
<
String
,
String
>
signingConfigs
=
await
getCodeSigningIdentityDevelopmentTeam
(
iosApp:
app
,
...
...
@@ -588,10 +588,10 @@ void main() {
contains
(
'Certificate choice "iPhone Developer: Profile 3 (3333CCCC33)"'
),
);
expect
(
signingConfigs
,
<
String
,
String
>{
'DEVELOPMENT_TEAM'
:
'4444DDDD44'
});
verify
(
globals
.
config
.
setValue
(
'ios-signing-cert'
,
'iPhone Developer: Profile 3 (3333CCCC33)'
)
);
expect
(
testConfig
.
getValue
(
'ios-signing-cert'
),
'iPhone Developer: Profile 3 (3333CCCC33)'
);
},
overrides:
<
Type
,
Generator
>{
Config:
()
=>
mock
Config
,
Config:
()
=>
test
Config
,
AnsiTerminal:
()
=>
testTerminal
,
});
...
...
@@ -667,7 +667,7 @@ void main() {
expect
(
signingConfigs
,
isNull
);
},
overrides:
<
Type
,
Generator
>{
Config:
()
=>
mock
Config
,
Config:
()
=>
test
Config
,
AnsiTerminal:
()
=>
testTerminal
,
});
});
...
...
@@ -691,7 +691,6 @@ class MockProcessManager extends Mock implements ProcessManager {}
class
MockProcess
extends
Mock
implements
Process
{}
class
MockStream
extends
Mock
implements
Stream
<
List
<
int
>>
{}
class
MockStdIn
extends
Mock
implements
IOSink
{}
class
MockConfig
extends
Mock
implements
Config
{}
Stream
<
String
>
mockTerminalStdInStream
;
...
...
packages/flutter_tools/test/general.shard/tester/flutter_tester_test.dart
View file @
73506f36
...
...
@@ -174,18 +174,12 @@ Hello!
}
FlutterTesterDevices
setUpFlutterTesterDevices
(
)
{
final
FileSystem
fileSystem
=
MemoryFileSystem
.
test
();
final
Logger
logger
=
BufferLogger
.
test
();
return
FlutterTesterDevices
(
logger:
logger
,
logger:
BufferLogger
.
test
()
,
artifacts:
Artifacts
.
test
(),
processManager:
FakeProcessManager
.
any
(),
fileSystem:
MemoryFileSystem
.
test
(),
config:
Config
.
test
(
'test'
,
directory:
fileSystem
.
currentDirectory
,
logger:
logger
,
),
config:
Config
.
test
(),
flutterVersion:
MockFlutterVersion
(),
);
}
...
...
packages/flutter_tools/test/src/context.dart
View file @
73506f36
...
...
@@ -87,7 +87,7 @@ void testUsingContext(
'flutter_config_dir_test.'
,
);
return
Config
.
test
(
Config
.
kFlutterSettings
,
name:
Config
.
kFlutterSettings
,
directory:
configDir
,
logger:
globals
.
logger
,
);
...
...
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