@@ -114,21 +114,28 @@ class TestContext {
114
114
115
115
NullSafety nullSafety;
116
116
117
+ late String dwdsDirectory;
118
+
117
119
TestContext ({
118
120
String ? directory,
119
121
String ? entry,
120
122
this .nullSafety = NullSafety .sound,
121
123
this .path = 'hello_world/index.html' ,
122
124
this .pathToServe = 'example' ,
123
125
}) {
126
+ final pathParts = p.split (p.current);
127
+ assert (pathParts.contains ('dwds' ));
128
+ dwdsDirectory = p.joinAll (
129
+ pathParts.sublist (0 , pathParts.indexOf ('dwds' ) + 1 ),
130
+ );
124
131
final defaultPackage =
125
132
nullSafety == NullSafety .sound ? '_testSound' : '_test' ;
126
133
final defaultDirectory = p.join ('..' , 'fixtures' , defaultPackage);
127
134
final defaultEntry = p.join ('..' , 'fixtures' , defaultPackage, 'example' ,
128
135
'append_body' , 'main.dart' );
129
136
130
- workingDirectory = p.normalize (
131
- p.absolute (p. relative (directory ?? defaultDirectory, from: p.current )));
137
+ workingDirectory = p.normalize (p. absolute (
138
+ p.relative (directory ?? defaultDirectory, from: dwdsDirectory )));
132
139
133
140
DartUri .currentDirectory = workingDirectory;
134
141
@@ -138,7 +145,7 @@ class TestContext {
138
145
p.toUri (p.join (workingDirectory, '.dart_tool/package_config.json' ));
139
146
140
147
final entryFilePath = p.normalize (
141
- p.absolute (p.relative (entry ?? defaultEntry, from: p.current )));
148
+ p.absolute (p.relative (entry ?? defaultEntry, from: dwdsDirectory )));
142
149
143
150
_logger.info ('Serving: $pathToServe /$path ' );
144
151
_logger.info ('Project: $_projectDirectory ' );
@@ -423,6 +430,12 @@ class TestContext {
423
430
}
424
431
}
425
432
433
+ String absoluteDwdsPath (String relativePath) =>
434
+ p.normalize (p.absolute (p.relative (
435
+ relativePath,
436
+ from: dwdsDirectory,
437
+ )));
438
+
426
439
Future <void > startDebugging () async {
427
440
debugConnection = await testServer.dwds.debugConnection (appConnection);
428
441
_webkitDebugger = WebkitDebugger (WipDebugger (tabConnection));
0 commit comments