@@ -8,7 +8,6 @@ import 'package:build_daemon/client.dart';
8
8
import 'package:build_daemon/constants.dart' ;
9
9
import 'package:build_daemon/data/server_log.dart' ;
10
10
import 'package:dds/devtools_server.dart' ;
11
- import 'package:dwds/asset_reader.dart' ;
12
11
import 'package:dwds/src/config/tool_configuration.dart' ;
13
12
import 'package:dwds/src/loaders/strategy.dart' ;
14
13
import 'package:dwds/src/servers/devtools.dart' ;
@@ -117,33 +116,20 @@ class TestDebugSettings extends DebugSettings {
117
116
118
117
const TestDebugSettings .noDevTools () : super (enableDevToolsLaunch: false );
119
118
120
- const TestDebugSettings ._({
121
- required bool enableDebugging,
122
- required bool enableDebugExtension,
123
- required bool useSseForDebugBackend,
124
- required bool useSseForDebugProxy,
125
- required bool useSseForInjectedClient,
126
- required bool spawnDds,
127
- required bool enableDevToolsLaunch,
128
- required bool launchDevToolsInNewWindow,
129
- required bool emitDebugEvents,
130
- required DevToolsLauncher ? devToolsLauncher,
131
- required ExpressionCompiler ? expressionCompiler,
132
- required UrlEncoder ? urlEncoder,
133
- }) : super (
134
- enableDebugging: enableDebugging,
135
- enableDebugExtension: enableDebugExtension,
136
- useSseForDebugBackend: useSseForDebugBackend,
137
- useSseForDebugProxy: useSseForDebugProxy,
138
- useSseForInjectedClient: useSseForInjectedClient,
139
- spawnDds: spawnDds,
140
- enableDevToolsLaunch: enableDevToolsLaunch,
141
- launchDevToolsInNewWindow: launchDevToolsInNewWindow,
142
- emitDebugEvents: emitDebugEvents,
143
- devToolsLauncher: devToolsLauncher,
144
- expressionCompiler: expressionCompiler,
145
- urlEncoder: urlEncoder,
146
- );
119
+ TestDebugSettings ._({
120
+ required super .enableDebugging,
121
+ required super .enableDebugExtension,
122
+ required super .useSseForDebugBackend,
123
+ required super .useSseForDebugProxy,
124
+ required super .useSseForInjectedClient,
125
+ required super .spawnDds,
126
+ required super .enableDevToolsLaunch,
127
+ required super .launchDevToolsInNewWindow,
128
+ required super .emitDebugEvents,
129
+ required super .devToolsLauncher,
130
+ required super .expressionCompiler,
131
+ required super .urlEncoder,
132
+ });
147
133
148
134
TestDebugSettings copyWith ({
149
135
bool ? enableDebugging,
@@ -177,20 +163,16 @@ class TestDebugSettings extends DebugSettings {
177
163
178
164
class TestAppMetadata extends AppMetadata {
179
165
const TestAppMetadata ({
180
- bool isInternalBuild = false ,
181
- String ? workspaceName,
182
- String hostname = 'localhost' ,
183
- }) : super (
184
- isInternalBuild: isInternalBuild,
185
- workspaceName: workspaceName,
186
- hostname: hostname,
187
- );
166
+ super .isInternalBuild,
167
+ super .workspaceName,
168
+ super .hostname = 'localhost' ,
169
+ });
188
170
189
171
TestAppMetadata copyWith ({
190
172
bool ? isFlutterApp,
191
173
bool ? isInternalBuild,
192
174
String ? workspaceName,
193
- String ? hostname = 'localhost' ,
175
+ String ? hostname,
194
176
}) =>
195
177
TestAppMetadata (
196
178
isInternalBuild: isInternalBuild ?? this .isInternalBuild,
@@ -205,24 +187,20 @@ class TestAppMetadata extends AppMetadata {
205
187
206
188
class TestToolConfiguration extends ToolConfiguration {
207
189
TestToolConfiguration .withDefaultLoadStrategy ({
208
- TestAppMetadata appMetadata = const TestAppMetadata .externalApp (),
209
- TestDebugSettings debugSettings = const TestDebugSettings .noDevTools (),
190
+ TestAppMetadata super .appMetadata = const TestAppMetadata .externalApp (),
191
+ TestDebugSettings super .debugSettings =
192
+ const TestDebugSettings .noDevTools (),
210
193
TestBuildSettings buildSettings = const TestBuildSettings .dart (),
211
194
}) : super (
212
195
loadStrategy: TestStrategy (const FakeAssetReader (), buildSettings),
213
- debugSettings: debugSettings,
214
- appMetadata: appMetadata,
215
196
);
216
197
217
198
TestToolConfiguration .withLoadStrategy ({
218
- TestAppMetadata appMetadata = const TestAppMetadata .externalApp (),
219
- TestDebugSettings debugSettings = const TestDebugSettings .noDevTools (),
220
- required LoadStrategy loadStrategy,
221
- }) : super (
222
- loadStrategy: loadStrategy,
223
- debugSettings: debugSettings,
224
- appMetadata: appMetadata,
225
- );
199
+ TestAppMetadata super .appMetadata = const TestAppMetadata .externalApp (),
200
+ TestDebugSettings super .debugSettings =
201
+ const TestDebugSettings .noDevTools (),
202
+ required super .loadStrategy,
203
+ });
226
204
}
227
205
228
206
void setGlobalsForTesting ({
@@ -242,12 +220,9 @@ void setGlobalsForTestingFromBuild({
242
220
243
221
class TestStrategy extends FakeStrategy {
244
222
TestStrategy (
245
- AssetReader assetReader,
223
+ super . assetReader,
246
224
BuildSettings buildSettings,
247
- ) : super (
248
- assetReader,
249
- buildSettings: buildSettings,
250
- );
225
+ ) : super (buildSettings: buildSettings);
251
226
252
227
@override
253
228
String serverPathForAppUri (String appUri) {
@@ -290,16 +265,11 @@ class TestSettings {
290
265
/// App build settings for tests.
291
266
class TestBuildSettings extends BuildSettings {
292
267
const TestBuildSettings ({
293
- Uri ? appEntrypoint,
294
- bool canaryFeatures = false ,
295
- bool isFlutterApp = true ,
296
- List <String > experiments = const < String > [],
297
- }) : super (
298
- appEntrypoint: appEntrypoint,
299
- canaryFeatures: canaryFeatures,
300
- isFlutterApp: isFlutterApp,
301
- experiments: experiments,
302
- );
268
+ super .appEntrypoint,
269
+ super .canaryFeatures,
270
+ super .isFlutterApp,
271
+ super .experiments,
272
+ });
303
273
304
274
const TestBuildSettings .dart ({Uri ? appEntrypoint})
305
275
: this (appEntrypoint: appEntrypoint, isFlutterApp: false );
@@ -324,12 +294,11 @@ class TestBuildSettings extends BuildSettings {
324
294
class TestCompilerOptions extends CompilerOptions {
325
295
TestCompilerOptions ({
326
296
required NullSafety nullSafety,
327
- required bool canaryFeatures,
297
+ required super . canaryFeatures,
328
298
required List <String > experiments,
329
299
}) : super (
330
300
moduleFormat: 'amd' ,
331
301
soundNullSafety: nullSafety == NullSafety .sound,
332
- canaryFeatures: canaryFeatures,
333
302
experiments: const < String > [],
334
303
);
335
304
}
0 commit comments