Skip to content

Commit b1a80a9

Browse files
committed
Remove saved current directory and instead make _chromeDriver not late
The failed tear down was due to a late variable being accessed. This cascaded into the current directory not being restored. Instead, make this variable nullable only.
1 parent 3b35f9d commit b1a80a9

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

dwds/test/fixtures/context.dart

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class TestContext {
8989
WebDriver? _webDriver;
9090

9191
Process get chromeDriver => _chromeDriver!;
92-
late Process? _chromeDriver;
92+
Process? _chromeDriver;
9393

9494
WebkitDebugger get webkitDebugger => _webkitDebugger!;
9595
late WebkitDebugger? _webkitDebugger;
@@ -129,21 +129,14 @@ class TestContext {
129129
/// External VM service.
130130
VmService get vmService => debugConnection.vmService;
131131

132-
final String _savedCurrentDirectory;
133-
134-
TestContext(this.project, this.sdkConfigurationProvider)
135-
: _savedCurrentDirectory = p.current;
132+
TestContext(this.project, this.sdkConfigurationProvider);
136133

137134
Future<void> setUp({
138135
TestSettings testSettings = const TestSettings(),
139136
TestAppMetadata appMetadata = const TestAppMetadata.externalApp(),
140137
TestDebugSettings debugSettings = const TestDebugSettings.noDevTools(),
141138
}) async {
142139
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;
147140
// Build settings to return from load strategy.
148141
final buildSettings = TestBuildSettings(
149142
appEntrypoint: project.dartEntryFilePackageUri,

0 commit comments

Comments
 (0)