File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -129,14 +129,21 @@ class TestContext {
129
129
/// External VM service.
130
130
VmService get vmService => debugConnection.vmService;
131
131
132
- TestContext (this .project, this .sdkConfigurationProvider);
132
+ final String _savedCurrentDirectory;
133
+
134
+ TestContext (this .project, this .sdkConfigurationProvider)
135
+ : _savedCurrentDirectory = p.current;
133
136
134
137
Future <void > setUp ({
135
138
TestSettings testSettings = const TestSettings (),
136
139
TestAppMetadata appMetadata = const TestAppMetadata .externalApp (),
137
140
TestDebugSettings debugSettings = const TestDebugSettings .noDevTools (),
138
141
}) async {
139
142
try {
143
+ // The frontend server modifies the current path. Make sure that we
144
+ // restore it every time the context is set up so that if a previous
145
+ // test failed to tear down, we don't affect future tests.
146
+ DartUri .currentDirectory = _savedCurrentDirectory;
140
147
// Build settings to return from load strategy.
141
148
final buildSettings = TestBuildSettings (
142
149
appEntrypoint: project.dartEntryFilePackageUri,
Original file line number Diff line number Diff line change @@ -15,9 +15,7 @@ const newDdcTypeSystemVersion = '3.3.0-242.0.dev';
15
15
/// The path to the webdev directory in the local machine, e.g.
16
16
/// '/workstation/webdev'.
17
17
String get webdevPath {
18
- // Use `Directory.current` instead of `p.current` as the latter is allowed to
19
- // change with `DartUri.currentDirectory` modifications.
20
- final pathParts = p.split (Directory .current.path);
18
+ final pathParts = p.split (p.current);
21
19
assert (pathParts.contains (webdevDirName));
22
20
return p.joinAll (
23
21
pathParts.sublist (0 , pathParts.lastIndexOf (webdevDirName) + 1 ),
You can’t perform that action at this time.
0 commit comments