Skip to content

Commit

Permalink
fixed broken test - decoded response body to match source and renamed…
Browse files Browse the repository at this point in the history
… stack property
  • Loading branch information
jyameo committed Jan 15, 2025
1 parent 22cdf34 commit db9abfb
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
10 changes: 10 additions & 0 deletions dwds/lib/src/debugging/dart_scope.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ Future<List<Property>> visibleVariables({
final objectId = scope.object.objectId;
if (objectId != null) {
final properties = await inspector.getProperties(objectId);
for (final property in properties) {
if (property.name == '_\$35wc2\$35formal') {
final newProperty = Property({
'name': '_',
'value': property.value,
});
properties.remove(property);
properties.add(newProperty);
}
}
allProperties.addAll(properties);
}
}
Expand Down
2 changes: 1 addition & 1 deletion dwds/test/chrome_proxy_service_amd_test.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

Expand Down
12 changes: 10 additions & 2 deletions dwds/test/common/chrome_proxy_service_common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -739,10 +739,18 @@ void runTests({
for (final scriptRef in scripts.scripts!) {
final script =
await service.getObject(isolate.id!, scriptRef.id!) as Script;
final serverPath = DartUri(script.uri!, 'hello_world/').serverPath;
var serverPath = DartUri(script.uri!, 'hello_world/').serverPath;
if (serverPath.startsWith('hello_world/packages/')) {
serverPath = serverPath.replaceFirst('hello_world/', '');
}
final result = await http
.get(Uri.parse('http://localhost:${context.port}/$serverPath'));
expect(script.source, result.body);
// TODO: Figure out if we can encode the sript as utf8 and avoid this
final body =
(moduleFormat == ModuleFormat.ddc && canaryFeatures == true)
? utf8.decode(result.body.codeUnits)
: result.body;
expect(script.source, body);
expect(scriptRef.uri, endsWith('.dart'));
expect(script.tokenPosTable, isNotEmpty);
}
Expand Down
1 change: 1 addition & 0 deletions fixtures/_testSound/example/hello_world/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<html>

<head>
<meta charset='utf-8'>
<script defer src="main.dart.js"></script>
</head>

Expand Down

0 comments on commit db9abfb

Please sign in to comment.