Skip to content

Commit

Permalink
Merge with master
Browse files Browse the repository at this point in the history
  • Loading branch information
Anna Gringauze committed Jul 21, 2023
2 parents ec28d05 + 87bd77f commit 6bcd17d
Show file tree
Hide file tree
Showing 17 changed files with 28 additions and 31 deletions.
6 changes: 2 additions & 4 deletions dwds/test/instances/common/instance_common.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) 2023, 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 Expand Up @@ -62,9 +62,7 @@ void runTests({

/// A reference to the the variable `libraryPublicFinal`, an instance of
/// `MyTestClass`.
Future<RemoteObject> libraryPublicFinal(
CompilationMode compilationMode,
) =>
Future<RemoteObject> libraryPublicFinal(CompilationMode compilationMode) =>
inspector.jsEvaluate(
libraryVariableExpression('libraryPublicFinal', compilationMode),
);
Expand Down
7 changes: 1 addition & 6 deletions dwds/test/instances/common/instance_inspection_common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,7 @@ void runTests({
final instanceRef = await getInstanceRef(frame, 'list');

final instanceId = instanceRef.id!;
expect(
await getObject(instanceId),
matchListInstance(
type: canaryFeatures ? 'JSArray<int>' : 'List<int>',
),
);
expect(await getObject(instanceId), matchListInstance(type: 'int'));

expect(await getFields(instanceRef), [0, 1, 2]);
expect(await getFields(instanceRef, offset: 1, count: 0), []);
Expand Down
8 changes: 4 additions & 4 deletions dwds/test/instances/common/patterns_inspection_common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Future<void> runTests({
final frame = event.topFrame!;

expect(await getFrameVariables(frame), {
'obj': matchListInstance(type: matchListClassName('Object')),
'obj': matchListInstance(type: 'Object'),
'a': matchPrimitiveInstance(kind: InstanceKind.kString, value: 'a'),
'n': matchPrimitiveInstance(kind: InstanceKind.kDouble, value: 1),
});
Expand All @@ -90,7 +90,7 @@ Future<void> runTests({
final frame = event.topFrame!;

expect(await getFrameVariables(frame), {
'obj': matchListInstance(type: matchListClassName('Object')),
'obj': matchListInstance(type: 'Object'),
'a': matchPrimitiveInstance(kind: InstanceKind.kString, value: 'b'),
'n': matchPrimitiveInstance(kind: InstanceKind.kDouble, value: 3.14),
});
Expand All @@ -105,7 +105,7 @@ Future<void> runTests({
expect(await getFields(instanceRef), [0, 1]);

expect(await getFrameVariables(frame), {
'obj': matchListInstance(type: matchListClassName('int')),
'obj': matchListInstance(type: 'int'),
});
});
});
Expand Down Expand Up @@ -153,7 +153,7 @@ Future<void> runTests({
final vars = await getFrameVariables(frame);
expect(vars, {
'dog': matchPrimitiveInstance(kind: 'String', value: 'Prismo'),
'cats': matchListInstance(type: matchListClassName('String')),
'cats': matchListInstance(type: 'String'),
'firstCat': matchPrimitiveInstance(kind: 'String', value: 'Garfield'),
'secondCat': matchPrimitiveInstance(kind: 'String', value: 'Tom'),
});
Expand Down
6 changes: 4 additions & 2 deletions dwds/test/instances/common/test_inspector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,10 @@ Matcher matchRecordTypeClassRef = matchClassRef(
);
Matcher matchTypeClassRef =
matchClassRef(name: matchTypeClassName, libraryId: _dartCoreLibrary);
Matcher matchListClassRef(dynamic type) =>
matchClassRef(name: type, libraryId: _matchListLibraryName);
Matcher matchListClassRef(String type) => matchClassRef(
name: matchListClassName(type),
libraryId: _matchListLibraryName,
);
Matcher matchMapClassRef(String type) =>
matchClassRef(name: type, libraryId: _dartJsHelperLibrary);
Matcher matchSetClassRef(String type) =>
Expand Down
5 changes: 2 additions & 3 deletions dwds/test/instances/common/type_inspection_common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ void runTests({
required bool canaryFeatures,
required bool debug,
}) {
final context =
TestContext(TestProject.testExperimentWithSoundNullSafety, provider);
final project = TestProject.testExperimentWithSoundNullSafety;
final context = TestContext(project, provider);
final testInspector = TestInspector(context);

late VmServiceInterface service;
Expand Down Expand Up @@ -105,7 +105,6 @@ void runTests({

final classId = instanceRef.classRef!.id;
expect(await getObject(classId), matchTypeClass);

expect(await getFields(instanceRef, depth: 1), matchTypeObject);
expect(await getDisplayedFields(instanceRef), matchDisplayedTypeObject);
});
Expand Down
2 changes: 1 addition & 1 deletion dwds/test/instances/instance_canary_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void main() {
final debug = false;
final canaryFeatures = true;

group('canaryFeatures: $canaryFeatures |', () {
group('canary: $canaryFeatures |', () {
final provider = TestSdkConfigurationProvider(
canaryFeatures: canaryFeatures,
verbose: debug,
Expand Down
5 changes: 4 additions & 1 deletion dwds/test/instances/instance_inspection_canary_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void main() {
final debug = false;
final canaryFeatures = true;

group('canaryFeatures: $canaryFeatures |', () {
group('canary: $canaryFeatures |', () {
final provider = TestSdkConfigurationProvider(
verbose: debug,
canaryFeatures: canaryFeatures,
Expand All @@ -29,6 +29,9 @@ void main() {
runTests(
provider: provider,
compilationMode: compilationMode,
// Note: not running with weak null safety because it
// requires a special branch of build_web_compilers
// that does not support --canary flag.
nullSafetyMode: NullSafety.sound,
canaryFeatures: canaryFeatures,
debug: debug,
Expand Down
2 changes: 1 addition & 1 deletion dwds/test/instances/instance_inspection_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void main() {
final debug = false;
final canaryFeatures = false;

group('canaryFeatures: $canaryFeatures |', () {
group('canary: $canaryFeatures |', () {
final provider = TestSdkConfigurationProvider(
verbose: debug,
canaryFeatures: canaryFeatures,
Expand Down
2 changes: 1 addition & 1 deletion dwds/test/instances/instance_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ void main() {
final debug = false;
final canaryFeatures = false;

group('canaryFeatures: $canaryFeatures |', () {
group('canary: $canaryFeatures |', () {
final provider = TestSdkConfigurationProvider(
canaryFeatures: canaryFeatures,
verbose: debug,
Expand Down
2 changes: 1 addition & 1 deletion dwds/test/instances/patterns_inspection_canary_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void main() {
final debug = false;
final canaryFeatures = true;

group('canaryFeatures: $canaryFeatures |', () {
group('canary: $canaryFeatures |', () {
final provider = TestSdkConfigurationProvider(
verbose: debug,
canaryFeatures: canaryFeatures,
Expand Down
2 changes: 1 addition & 1 deletion dwds/test/instances/patterns_inspection_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void main() {
final debug = false;
final canaryFeatures = false;

group('canaryFeatures: $canaryFeatures |', () {
group('canary: $canaryFeatures |', () {
final provider = TestSdkConfigurationProvider(
verbose: debug,
canaryFeatures: canaryFeatures,
Expand Down
2 changes: 1 addition & 1 deletion dwds/test/instances/record_inspection_canary_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void main() {
final debug = false;
final canaryFeatures = true;

group('canaryFeatures: $canaryFeatures |', () {
group('canary: $canaryFeatures |', () {
final provider = TestSdkConfigurationProvider(
verbose: debug,
canaryFeatures: canaryFeatures,
Expand Down
2 changes: 1 addition & 1 deletion dwds/test/instances/record_inspection_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void main() {
final debug = false;
final canaryFeatures = false;

group('canaryFeatures: $canaryFeatures |', () {
group('canary: $canaryFeatures |', () {
final provider = TestSdkConfigurationProvider(
verbose: debug,
canaryFeatures: canaryFeatures,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void main() {
final debug = false;
final canaryFeatures = true;

group('canaryFeatures: $canaryFeatures |', () {
group('canary: $canaryFeatures |', () {
final provider = TestSdkConfigurationProvider(
verbose: debug,
canaryFeatures: canaryFeatures,
Expand Down
2 changes: 1 addition & 1 deletion dwds/test/instances/record_type_inspection_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void main() {
final debug = false;
final canaryFeatures = false;

group('canaryFeatures: $canaryFeatures |', () {
group('canary: $canaryFeatures |', () {
final provider = TestSdkConfigurationProvider(
verbose: debug,
canaryFeatures: canaryFeatures,
Expand Down
2 changes: 1 addition & 1 deletion dwds/test/instances/type_inspection_canary_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void main() {
final debug = false;
final canaryFeatures = true;

group('canaryFeatures: $canaryFeatures |', () {
group('canary: $canaryFeatures |', () {
final provider = TestSdkConfigurationProvider(
verbose: debug,
canaryFeatures: canaryFeatures,
Expand Down
2 changes: 1 addition & 1 deletion dwds/test/instances/type_inspection_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void main() {
final debug = false;
final canaryFeatures = false;

group('canaryFeatures: $canaryFeatures |', () {
group('canary: $canaryFeatures |', () {
final provider = TestSdkConfigurationProvider(
verbose: debug,
canaryFeatures: canaryFeatures,
Expand Down

0 comments on commit 6bcd17d

Please sign in to comment.