Skip to content

Commit db9abfb

Browse files
committed
fixed broken test - decoded response body to match source and renamed stack property
1 parent 22cdf34 commit db9abfb

File tree

4 files changed

+22
-3
lines changed

4 files changed

+22
-3
lines changed

dwds/lib/src/debugging/dart_scope.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,16 @@ Future<List<Property>> visibleVariables({
6060
final objectId = scope.object.objectId;
6161
if (objectId != null) {
6262
final properties = await inspector.getProperties(objectId);
63+
for (final property in properties) {
64+
if (property.name == '_\$35wc2\$35formal') {
65+
final newProperty = Property({
66+
'name': '_',
67+
'value': property.value,
68+
});
69+
properties.remove(property);
70+
properties.add(newProperty);
71+
}
72+
}
6373
allProperties.addAll(properties);
6474
}
6575
}

dwds/test/chrome_proxy_service_amd_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
1+
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

dwds/test/common/chrome_proxy_service_common.dart

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -739,10 +739,18 @@ void runTests({
739739
for (final scriptRef in scripts.scripts!) {
740740
final script =
741741
await service.getObject(isolate.id!, scriptRef.id!) as Script;
742-
final serverPath = DartUri(script.uri!, 'hello_world/').serverPath;
742+
var serverPath = DartUri(script.uri!, 'hello_world/').serverPath;
743+
if (serverPath.startsWith('hello_world/packages/')) {
744+
serverPath = serverPath.replaceFirst('hello_world/', '');
745+
}
743746
final result = await http
744747
.get(Uri.parse('http://localhost:${context.port}/$serverPath'));
745-
expect(script.source, result.body);
748+
// TODO: Figure out if we can encode the sript as utf8 and avoid this
749+
final body =
750+
(moduleFormat == ModuleFormat.ddc && canaryFeatures == true)
751+
? utf8.decode(result.body.codeUnits)
752+
: result.body;
753+
expect(script.source, body);
746754
expect(scriptRef.uri, endsWith('.dart'));
747755
expect(script.tokenPosTable, isNotEmpty);
748756
}

fixtures/_testSound/example/hello_world/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<html>
22

33
<head>
4+
<meta charset='utf-8'>
45
<script defer src="main.dart.js"></script>
56
</head>
67

0 commit comments

Comments
 (0)