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
5d61bff2
Unverified
Commit
5d61bff2
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] even more test fixes (#60156)
Fix tests broken under tester
parent
61b93d25
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
131 additions
and
29 deletions
+131
-29
device_test.dart
packages/flutter_tools/test/general.shard/device_test.dart
+23
-0
fuchsia_device_test.dart
...tools/test/general.shard/fuchsia/fuchsia_device_test.dart
+14
-4
hot_test.dart
packages/flutter_tools/test/general.shard/hot_test.dart
+62
-15
ios_device_start_nonprebuilt_test.dart
.../general.shard/ios/ios_device_start_nonprebuilt_test.dart
+3
-0
simulators_test.dart
...flutter_tools/test/general.shard/ios/simulators_test.dart
+12
-6
cocoapods_test.dart
...lutter_tools/test/general.shard/macos/cocoapods_test.dart
+3
-2
resident_runner_test.dart
...lutter_tools/test/general.shard/resident_runner_test.dart
+7
-1
resident_web_runner_test.dart
...er_tools/test/general.shard/resident_web_runner_test.dart
+4
-0
devfs_web_test.dart
.../flutter_tools/test/general.shard/web/devfs_web_test.dart
+3
-1
No files found.
packages/flutter_tools/test/general.shard/device_test.dart
View file @
5d61bff2
...
...
@@ -4,6 +4,7 @@
import
'dart:async'
;
import
'package:flutter_tools/src/artifacts.dart'
;
import
'package:flutter_tools/src/build_info.dart'
;
import
'package:flutter_tools/src/device.dart'
;
import
'package:flutter_tools/src/base/io.dart'
;
...
...
@@ -25,6 +26,8 @@ void main() {
final
List
<
Device
>
devices
=
<
Device
>[
device1
,
device2
,
device3
];
final
DeviceManager
deviceManager
=
TestDeviceManager
(
devices
);
expect
(
await
deviceManager
.
getDevices
(),
devices
);
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
Artifacts
.
test
(),
});
testUsingContext
(
'getDeviceById'
,
()
async
{
...
...
@@ -43,6 +46,8 @@ void main() {
await
expectDevice
(
'Nexus 5'
,
<
Device
>[
device1
]);
await
expectDevice
(
'0553790'
,
<
Device
>[
device1
]);
await
expectDevice
(
'Nexus'
,
<
Device
>[
device1
,
device2
]);
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
Artifacts
.
test
(),
});
testUsingContext
(
'getAllConnectedDevices caches'
,
()
async
{
...
...
@@ -53,6 +58,8 @@ void main() {
final
FakeDevice
device2
=
FakeDevice
(
'Nexus 5X'
,
'01abfc49119c410e'
);
deviceManager
.
resetDevices
(<
Device
>[
device2
]);
expect
(
await
deviceManager
.
getAllConnectedDevices
(),
<
Device
>[
device1
]);
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
Artifacts
.
test
(),
});
testUsingContext
(
'refreshAllConnectedDevices does not cache'
,
()
async
{
...
...
@@ -63,6 +70,8 @@ void main() {
final
FakeDevice
device2
=
FakeDevice
(
'Nexus 5X'
,
'01abfc49119c410e'
);
deviceManager
.
resetDevices
(<
Device
>[
device2
]);
expect
(
await
deviceManager
.
refreshAllConnectedDevices
(),
<
Device
>[
device2
]);
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
Artifacts
.
test
(),
});
});
...
...
@@ -83,6 +92,8 @@ void main() {
expect
(
pollingDeviceDiscovery
.
lastPollingTimeout
,
const
Duration
(
seconds:
30
));
await
pollingDeviceDiscovery
.
stopPolling
();
});
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
Artifacts
.
test
(),
});
});
...
...
@@ -117,6 +128,8 @@ void main() {
final
List
<
Device
>
filtered
=
await
deviceManager
.
findTargetDevices
(
FlutterProject
.
current
());
expect
(
filtered
.
single
,
ephemeral
);
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
Artifacts
.
test
(),
});
testUsingContext
(
'does not remove all non-ephemeral'
,
()
async
{
...
...
@@ -132,6 +145,8 @@ void main() {
nonEphemeralOne
,
nonEphemeralTwo
,
]);
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
Artifacts
.
test
(),
});
testUsingContext
(
'Removes a single unsupported device'
,
()
async
{
...
...
@@ -143,6 +158,8 @@ void main() {
final
List
<
Device
>
filtered
=
await
deviceManager
.
findTargetDevices
(
FlutterProject
.
current
());
expect
(
filtered
,
<
Device
>[]);
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
Artifacts
.
test
(),
});
testUsingContext
(
'Removes web and fuchsia from --all'
,
()
async
{
...
...
@@ -156,6 +173,8 @@ void main() {
final
List
<
Device
>
filtered
=
await
deviceManager
.
findTargetDevices
(
FlutterProject
.
current
());
expect
(
filtered
,
<
Device
>[]);
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
Artifacts
.
test
(),
});
testUsingContext
(
'Removes unsupported devices from --all'
,
()
async
{
...
...
@@ -173,6 +192,8 @@ void main() {
nonEphemeralOne
,
nonEphemeralTwo
,
]);
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
Artifacts
.
test
(),
});
testUsingContext
(
'uses DeviceManager.isDeviceSupportedForProject instead of device.isSupportedForProject'
,
()
async
{
...
...
@@ -187,6 +208,8 @@ void main() {
expect
(
filtered
,
<
Device
>[
unsupported
,
]);
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
Artifacts
.
test
(),
});
});
group
(
'ForwardedPort'
,
()
{
...
...
packages/flutter_tools/test/general.shard/fuchsia/fuchsia_device_test.dart
View file @
5d61bff2
...
...
@@ -17,6 +17,7 @@ import 'package:flutter_tools/src/base/os.dart';
import
'package:flutter_tools/src/base/platform.dart'
;
import
'package:flutter_tools/src/base/time.dart'
;
import
'package:flutter_tools/src/build_info.dart'
;
import
'package:flutter_tools/src/cache.dart'
;
import
'package:flutter_tools/src/device.dart'
;
import
'package:flutter_tools/src/fuchsia/amber_ctl.dart'
;
import
'package:flutter_tools/src/fuchsia/application_package.dart'
;
...
...
@@ -791,28 +792,36 @@ void main() {
});
testUsingContext
(
'Correct flutter runner'
,
()
async
{
expect
(
globals
.
artifacts
.
getArtifactPath
(
final
MockCache
cache
=
MockCache
();
final
FileSystem
fileSystem
=
MemoryFileSystem
.
test
();
when
(
cache
.
getArtifactDirectory
(
'flutter_runner'
)).
thenReturn
(
fileSystem
.
directory
(
'fuchsia'
));
final
CachedArtifacts
artifacts
=
CachedArtifacts
(
cache:
cache
,
fileSystem:
fileSystem
,
platform:
FakePlatform
(
operatingSystem:
'linux'
),
);
expect
(
artifacts
.
getArtifactPath
(
Artifact
.
fuchsiaFlutterRunner
,
platform:
TargetPlatform
.
fuchsia_x64
,
mode:
BuildMode
.
debug
,
),
contains
(
'flutter_jit_runner'
),
);
expect
(
globals
.
artifacts
.
getArtifactPath
(
expect
(
artifacts
.
getArtifactPath
(
Artifact
.
fuchsiaFlutterRunner
,
platform:
TargetPlatform
.
fuchsia_x64
,
mode:
BuildMode
.
profile
,
),
contains
(
'flutter_aot_runner'
),
);
expect
(
globals
.
artifacts
.
getArtifactPath
(
expect
(
artifacts
.
getArtifactPath
(
Artifact
.
fuchsiaFlutterRunner
,
platform:
TargetPlatform
.
fuchsia_x64
,
mode:
BuildMode
.
release
,
),
contains
(
'flutter_aot_product_runner'
),
);
expect
(
globals
.
artifacts
.
getArtifactPath
(
expect
(
artifacts
.
getArtifactPath
(
Artifact
.
fuchsiaFlutterRunner
,
platform:
TargetPlatform
.
fuchsia_x64
,
mode:
BuildMode
.
jitRelease
,
...
...
@@ -1550,3 +1559,4 @@ class MockFuchsiaSdk extends Mock implements FuchsiaSdk {
}
class
MockFuchsiaWorkflow
extends
Mock
implements
FuchsiaWorkflow
{}
class
MockCache
extends
Mock
implements
Cache
{}
packages/flutter_tools/test/general.shard/hot_test.dart
View file @
5d61bff2
...
...
@@ -4,6 +4,10 @@
import
'dart:async'
;
import
'package:file/memory.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/platform.dart'
;
import
'package:flutter_tools/src/dart/package_map.dart'
;
import
'package:vm_service/vm_service.dart'
as
vm_service
;
import
'package:flutter_tools/src/artifacts.dart'
;
import
'package:flutter_tools/src/base/io.dart'
;
...
...
@@ -131,7 +135,7 @@ void main() {
group
(
'hotRestart'
,
()
{
final
MockResidentCompiler
residentCompiler
=
MockResidentCompiler
();
final
MockDevFs
mockDevFs
=
MockDevFs
();
MockLocalEngineArtifacts
mockArtifacts
;
FileSystem
fileSystem
;
when
(
mockDevFs
.
update
(
mainUri:
anyNamed
(
'mainUri'
),
...
...
@@ -155,11 +159,13 @@ void main() {
when
(
mockDevFs
.
lastCompiled
).
thenReturn
(
DateTime
.
now
());
setUp
(()
{
mockArtifacts
=
MockLocalEngineArtifacts
();
when
(
mockArtifacts
.
getArtifactPath
(
Artifact
.
flutterPatchedSdkPath
)).
thenReturn
(
'some/path'
);
fileSystem
=
MemoryFileSystem
.
test
();
});
testUsingContext
(
'Does not hot restart when device does not support it'
,
()
async
{
fileSystem
.
file
(
globalPackagesPath
)
..
createSync
(
recursive:
true
)
..
writeAsStringSync
(
'
\n
'
);
// Setup mocks
final
MockDevice
mockDevice
=
MockDevice
();
when
(
mockDevice
.
supportsHotReload
).
thenReturn
(
true
);
...
...
@@ -174,11 +180,17 @@ void main() {
expect
(
result
.
isOk
,
false
);
expect
(
result
.
message
,
'hotRestart not supported'
);
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
mockArtifacts
,
HotRunnerConfig:
()
=>
TestHotRunnerConfig
(
successfulSetup:
true
),
Artifacts:
()
=>
Artifacts
.
test
(),
FileSystem:
()
=>
fileSystem
,
Platform:
()
=>
FakePlatform
(
operatingSystem:
'linux'
),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
testUsingContext
(
'Does not hot restart when one of many devices does not support it'
,
()
async
{
fileSystem
.
file
(
globalPackagesPath
)
..
createSync
(
recursive:
true
)
..
writeAsStringSync
(
'
\n
'
);
// Setup mocks
final
MockDevice
mockDevice
=
MockDevice
();
final
MockDevice
mockHotDevice
=
MockDevice
();
...
...
@@ -196,8 +208,11 @@ void main() {
expect
(
result
.
isOk
,
false
);
expect
(
result
.
message
,
'hotRestart not supported'
);
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
mockArtifacts
,
HotRunnerConfig:
()
=>
TestHotRunnerConfig
(
successfulSetup:
true
),
Artifacts:
()
=>
Artifacts
.
test
(),
FileSystem:
()
=>
fileSystem
,
Platform:
()
=>
FakePlatform
(
operatingSystem:
'linux'
),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
testUsingContext
(
'Does hot restarts when all devices support it'
,
()
async
{
...
...
@@ -294,11 +309,17 @@ void main() {
expect
(
result
.
isOk
,
true
);
expect
(
result
.
message
,
isNot
(
'hotRestart not supported'
));
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
mockArtifacts
,
HotRunnerConfig:
()
=>
TestHotRunnerConfig
(
successfulSetup:
true
),
Artifacts:
()
=>
Artifacts
.
test
(),
FileSystem:
()
=>
fileSystem
,
Platform:
()
=>
FakePlatform
(
operatingSystem:
'linux'
),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
testUsingContext
(
'setup function fails'
,
()
async
{
fileSystem
.
file
(
globalPackagesPath
)
..
createSync
(
recursive:
true
)
..
writeAsStringSync
(
'
\n
'
);
final
MockDevice
mockDevice
=
MockDevice
();
when
(
mockDevice
.
supportsHotReload
).
thenReturn
(
true
);
when
(
mockDevice
.
supportsHotRestart
).
thenReturn
(
true
);
...
...
@@ -310,11 +331,17 @@ void main() {
expect
(
result
.
isOk
,
false
);
expect
(
result
.
message
,
'setupHotRestart failed'
);
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
mockArtifacts
,
HotRunnerConfig:
()
=>
TestHotRunnerConfig
(
successfulSetup:
false
),
Artifacts:
()
=>
Artifacts
.
test
(),
FileSystem:
()
=>
fileSystem
,
Platform:
()
=>
FakePlatform
(
operatingSystem:
'linux'
),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
testUsingContext
(
'hot restart supported'
,
()
async
{
fileSystem
.
file
(
globalPackagesPath
)
..
createSync
(
recursive:
true
)
..
writeAsStringSync
(
'
\n
'
);
// Setup mocks
final
FakeVmServiceHost
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
<
VmServiceExpectation
>[
listViews
,
...
...
@@ -369,8 +396,11 @@ void main() {
expect
(
result
.
isOk
,
true
);
expect
(
result
.
message
,
isNot
(
'setupHotRestart failed'
));
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
mockArtifacts
,
HotRunnerConfig:
()
=>
TestHotRunnerConfig
(
successfulSetup:
true
),
Artifacts:
()
=>
Artifacts
.
test
(),
FileSystem:
()
=>
fileSystem
,
Platform:
()
=>
FakePlatform
(
operatingSystem:
'linux'
),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
group
(
'shutdown hook tests'
,
()
{
...
...
@@ -383,6 +413,9 @@ void main() {
});
testUsingContext
(
'shutdown hook called after signal'
,
()
async
{
fileSystem
.
file
(
globalPackagesPath
)
..
createSync
(
recursive:
true
)
..
writeAsStringSync
(
'
\n
'
);
final
MockDevice
mockDevice
=
MockDevice
();
when
(
mockDevice
.
supportsHotReload
).
thenReturn
(
true
);
when
(
mockDevice
.
supportsHotRestart
).
thenReturn
(
true
);
...
...
@@ -393,11 +426,17 @@ void main() {
await
HotRunner
(
devices
).
cleanupAfterSignal
();
expect
(
shutdownTestingConfig
.
shutdownHookCalled
,
true
);
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
mockArtifacts
,
HotRunnerConfig:
()
=>
shutdownTestingConfig
,
Artifacts:
()
=>
Artifacts
.
test
(),
FileSystem:
()
=>
fileSystem
,
Platform:
()
=>
FakePlatform
(
operatingSystem:
'linux'
),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
testUsingContext
(
'shutdown hook called after app stop'
,
()
async
{
fileSystem
.
file
(
globalPackagesPath
)
..
createSync
(
recursive:
true
)
..
writeAsStringSync
(
'
\n
'
);
final
MockDevice
mockDevice
=
MockDevice
();
when
(
mockDevice
.
supportsHotReload
).
thenReturn
(
true
);
when
(
mockDevice
.
supportsHotRestart
).
thenReturn
(
true
);
...
...
@@ -408,21 +447,28 @@ void main() {
await
HotRunner
(
devices
).
preExit
();
expect
(
shutdownTestingConfig
.
shutdownHookCalled
,
true
);
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
mockArtifacts
,
HotRunnerConfig:
()
=>
shutdownTestingConfig
,
Artifacts:
()
=>
Artifacts
.
test
(),
FileSystem:
()
=>
fileSystem
,
Platform:
()
=>
FakePlatform
(
operatingSystem:
'linux'
),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
});
});
group
(
'hot attach'
,
()
{
MockLocalEngineArtifacts
mockArtifacts
;
FileSystem
fileSystem
;
setUp
(()
{
mockArtifacts
=
MockLocalEngineArtifacts
();
fileSystem
=
MemoryFileSystem
.
test
();
});
testUsingContext
(
'Exits with code 2 when when HttpException is thrown '
'during VM service connection'
,
()
async
{
fileSystem
.
file
(
globalPackagesPath
)
..
createSync
(
recursive:
true
)
..
writeAsStringSync
(
'
\n
'
);
final
MockResidentCompiler
residentCompiler
=
MockResidentCompiler
();
final
MockDevice
mockDevice
=
MockDevice
();
when
(
mockDevice
.
supportsHotReload
).
thenReturn
(
true
);
...
...
@@ -444,8 +490,11 @@ void main() {
).
attach
();
expect
(
exitCode
,
2
);
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
mockArtifacts
,
HotRunnerConfig:
()
=>
TestHotRunnerConfig
(
successfulSetup:
true
),
Artifacts:
()
=>
Artifacts
.
test
(),
FileSystem:
()
=>
fileSystem
,
Platform:
()
=>
FakePlatform
(
operatingSystem:
'linux'
),
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
});
...
...
@@ -482,8 +531,6 @@ void main() {
class
MockDevFs
extends
Mock
implements
DevFS
{}
class
MockLocalEngineArtifacts
extends
Mock
implements
LocalEngineArtifacts
{}
class
MockDevice
extends
Mock
implements
Device
{
MockDevice
()
{
when
(
isSupported
()).
thenReturn
(
true
);
...
...
packages/flutter_tools/test/general.shard/ios/ios_device_start_nonprebuilt_test.dart
View file @
5d61bff2
...
...
@@ -92,6 +92,9 @@ void main() {
);
mockXcode
=
MockXcode
();
when
(
mockXcode
.
isVersionSatisfactory
).
thenReturn
(
true
);
fileSystem
.
file
(
'foo/.packages'
)
..
createSync
(
recursive:
true
)
..
writeAsStringSync
(
'
\n
'
);
});
testUsingContext
(
'with buildable app'
,
()
async
{
...
...
packages/flutter_tools/test/general.shard/ios/simulators_test.dart
View file @
5d61bff2
...
...
@@ -37,6 +37,13 @@ class MockXcode extends Mock implements Xcode {}
class
MockSimControl
extends
Mock
implements
SimControl
{}
class
MockPlistUtils
extends
Mock
implements
PlistParser
{}
final
Platform
macosPlatform
=
FakePlatform
(
operatingSystem:
'macos'
,
environment:
<
String
,
String
>{
'HOME'
:
'/'
},
);
void
main
(
)
{
FakePlatform
osx
;
FileSystemUtils
fsUtils
;
...
...
@@ -458,12 +465,11 @@ void main() {
overrides:
<
Type
,
Generator
>{
ProcessManager:
()
=>
mockProcessManager
,
FileSystem:
()
=>
fileSystem
,
Platform:
()
=>
FakePlatform
(
operatingSystem:
'macos'
,
environment:
<
String
,
String
>{
'HOME'
:
'/'
},
),
Platform:
()
=>
macosPlatform
,
FileSystemUtils:
()
=>
FileSystemUtils
(
fileSystem:
fileSystem
,
platform:
macosPlatform
,
)
});
testUsingContext
(
'unified logging with app name'
,
()
async
{
...
...
packages/flutter_tools/test/general.shard/macos/cocoapods_test.dart
View file @
5d61bff2
...
...
@@ -43,7 +43,6 @@ void main() {
void
podsIsInHomeDir
()
{
fileSystem
.
directory
(
fileSystem
.
path
.
join
(
globals
.
fsUtils
.
homeDirPath
,
'.cocoapods'
,
'repos'
,
'master'
,
...
...
@@ -52,7 +51,6 @@ void main() {
String
podsIsInCustomDir
({
String
cocoapodsReposDir
})
{
cocoapodsReposDir
??=
fileSystem
.
path
.
join
(
globals
.
fsUtils
.
homeDirPath
,
'cache'
,
'cocoapods'
,
'repos'
,
...
...
@@ -292,6 +290,9 @@ void main() {
group
(
'Update xcconfig'
,
()
{
testUsingContext
(
'includes Pod config in xcconfig files, if the user manually added Pod dependencies without using Flutter plugins'
,
()
async
{
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
'project'
,
'foo'
,
'.packages'
))
..
createSync
(
recursive:
true
)
..
writeAsStringSync
(
'
\n
'
);
projectUnderTest
.
ios
.
podfile
..
createSync
()..
writeAsStringSync
(
'Custom Podfile'
);
projectUnderTest
.
ios
.
podfileLock
..
createSync
()..
writeAsStringSync
(
'Podfile.lock from user executed `pod install`'
);
projectUnderTest
.
packagesFile
..
createSync
()..
writeAsStringSync
(
''
);
...
...
packages/flutter_tools/test/general.shard/resident_runner_test.dart
View file @
5d61bff2
...
...
@@ -5,6 +5,7 @@
import
'dart:async'
;
import
'package:flutter_tools/src/cache.dart'
;
import
'package:flutter_tools/src/dart/package_map.dart'
;
import
'package:vm_service/vm_service.dart'
as
vm_service
;
import
'package:file/memory.dart'
;
import
'package:file_testing/file_testing.dart'
;
...
...
@@ -92,7 +93,7 @@ void main() {
setUp
(()
{
testbed
=
Testbed
(
setup:
()
{
globals
.
fs
.
file
(
'.packages'
).
writeAsStringSync
(
'
\n
'
);
globals
.
fs
.
file
(
globalPackagesPath
).
writeAsStringSync
(
'
\n
'
);
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
'build'
,
'app.dill'
))
..
createSync
(
recursive:
true
)
..
writeAsStringSync
(
'ABC'
);
...
...
@@ -844,6 +845,11 @@ void main() {
'data'
:
<
String
,
Object
>{
'A'
:
'B'
}
});
expect
(
fakeVmServiceHost
.
hasRemainingExpectations
,
false
);
},
overrides:
<
Type
,
Generator
>{
FileSystemUtils:
()
=>
FileSystemUtils
(
fileSystem:
globals
.
fs
,
platform:
globals
.
platform
,
)
}));
testUsingContext
(
'ResidentRunner can take screenshot on debug device'
,
()
=>
testbed
.
run
(()
async
{
...
...
packages/flutter_tools/test/general.shard/resident_web_runner_test.dart
View file @
5d61bff2
...
...
@@ -16,6 +16,7 @@ import 'package:flutter_tools/src/build_info.dart';
import
'package:flutter_tools/src/build_runner/devfs_web.dart'
;
import
'package:flutter_tools/src/build_runner/resident_web_runner.dart'
;
import
'package:flutter_tools/src/compile.dart'
;
import
'package:flutter_tools/src/dart/package_map.dart'
;
import
'package:flutter_tools/src/dart/pub.dart'
;
import
'package:flutter_tools/src/devfs.dart'
;
import
'package:flutter_tools/src/device.dart'
;
...
...
@@ -115,6 +116,9 @@ void main() {
});
testbed
=
Testbed
(
setup:
()
{
globals
.
fs
.
file
(
globalPackagesPath
)
..
createSync
(
recursive:
true
)
..
writeAsStringSync
(
'
\n
'
);
residentWebRunner
=
DwdsWebRunnerFactory
().
createWebRunner
(
mockFlutterDevice
,
flutterProject:
FlutterProject
.
current
(),
...
...
packages/flutter_tools/test/general.shard/web/devfs_web_test.dart
View file @
5d61bff2
...
...
@@ -43,7 +43,9 @@ void main() {
MockHttpServer
mockHttpServer
;
setUpAll
(()
async
{
packages
=
await
loadPackageConfigUri
(
Uri
.
base
.
resolve
(
'.packages'
));
packages
=
PackageConfig
(<
Package
>[
Package
(
'flutter_tools'
,
Uri
.
file
(
'/flutter_tools/lib/'
).
normalizePath
())
]);
});
setUp
(()
{
...
...
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