Skip to content

Commit 8a50293

Browse files
committed
Align network status test with cancellation behavior; stabilize eval test teardown
1 parent 76cd92d commit 8a50293

4 files changed

Lines changed: 15 additions & 12 deletions

File tree

packages/devtools_app/lib/src/shared/http/http_request_data.dart

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,7 @@ class DartIOHttpRequestData extends NetworkRequest {
147147
///
148148
/// Derived from observed cancellation wording in HTTP profiler payloads,
149149
/// keeping specific terms to reduce false positives.
150-
const _cancellationMarkers = [
151-
'canceled',
152-
'cancelled',
153-
'aborted',
154-
];
150+
const _cancellationMarkers = ['canceled', 'cancelled', 'aborted'];
155151

156152
return _cancellationMarkers.any(normalized.contains);
157153
}

packages/devtools_app/test/screens/network/network_controller_test.dart

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,28 +207,31 @@ void main() {
207207

208208
controller.setActiveFilter(query: 'status:Error');
209209
expect(profile, hasLength(numRequests));
210-
final errorCount = profile
210+
final errorCount = profile
211211
.whereType<DartIOHttpRequestData>()
212212
.where((request) => request.status == 'Error')
213213
.length;
214-
expect(controller.filteredData.value, hasLength(errorCount));
214+
expect(controller.filteredData.value, hasLength(errorCount));
215215

216216
final firstStatus = profile
217217
.whereType<DartIOHttpRequestData>()
218218
.map((request) => request.status)
219219
.whereType<String>()
220220
.first;
221-
final firstStatusCount = profile
221+
final firstStatusCount = profile
222222
.whereType<DartIOHttpRequestData>()
223223
.where((request) => request.status == firstStatus)
224224
.length;
225225
controller.setActiveFilter(query: 's:$firstStatus');
226226
expect(profile, hasLength(numRequests));
227-
expect(controller.filteredData.value, hasLength(firstStatusCount));
227+
expect(controller.filteredData.value, hasLength(firstStatusCount));
228228

229229
controller.setActiveFilter(query: '-s:Error');
230230
expect(profile, hasLength(numRequests));
231-
expect(controller.filteredData.value, hasLength(numRequests - errorCount));
231+
expect(
232+
controller.filteredData.value,
233+
hasLength(numRequests - errorCount),
234+
);
232235

233236
controller.setActiveFilter(query: 'type:json');
234237
expect(profile, hasLength(numRequests));

packages/devtools_app/test/screens/network/network_profiler_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ void main() {
407407
expect(find.text('Method: '), findsOneWidget);
408408
expect(find.text('GET'), findsOneWidget);
409409
expect(find.text('Status: '), findsOneWidget);
410-
expect(find.text('Error'), findsOneWidget);
410+
expect(find.text('Cancelled'), findsOneWidget);
411411
expect(find.text('Port: '), findsNothing);
412412
expect(find.text('Content type: '), findsNothing);
413413

packages/devtools_app/test/shared/eval_integration_test.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,13 @@ void main() {
2222
isAlive = Disposable();
2323
});
2424

25-
tearDown(() async {
25+
tearDown(() {
2626
isAlive.dispose();
27+
});
28+
29+
tearDownAll(() async {
2730
await env.tearDownEnvironment(force: true);
31+
env.finalTeardown();
2832
});
2933

3034
group('EvalOnDartLibrary', () {

0 commit comments

Comments
 (0)