Skip to content

Commit

Permalink
Revert "Fix test cases failing with latest Dart SDK (dart-lang#2312)"
Browse files Browse the repository at this point in the history
This reverts commit 2ef79f1.
  • Loading branch information
elliette committed Dec 27, 2023
1 parent 04abb18 commit 2563295
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 49 deletions.
5 changes: 0 additions & 5 deletions dwds/test/inspector_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import 'package:dwds/src/utilities/conversions.dart';
import 'package:dwds/src/utilities/globals.dart';
import 'package:test/test.dart';
import 'package:test_common/test_sdk_configuration.dart';
import 'package:test_common/utilities.dart';
import 'package:vm_service/vm_service.dart';
import 'package:webkit_inspection_protocol/webkit_inspection_protocol.dart';

Expand Down Expand Up @@ -161,10 +160,6 @@ void main() {
final names =
properties.map((p) => p.name).where((x) => x != '__proto__').toList();
final expected = [
if (dartSdkIsAtLeast(
newDdcTypeSystemVersion,
))
'\$ti',
'_privateField',
'abstractField',
'closure',
Expand Down
8 changes: 1 addition & 7 deletions dwds/test/instances/common/instance_common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import 'package:dwds/src/utilities/globals.dart';
import 'package:test/test.dart';
import 'package:test_common/logging.dart';
import 'package:test_common/test_sdk_configuration.dart';
import 'package:test_common/utilities.dart';
import 'package:vm_service/vm_service.dart';
import 'package:webkit_inspection_protocol/webkit_inspection_protocol.dart';

Expand Down Expand Up @@ -74,12 +73,7 @@ void runTypeSystemVerificationTests({
);
expect(
remoteObject.json['className'],
canaryFeatures ||
dartSdkIsAtLeast(
newDdcTypeSystemVersion,
)
? 'dart_rti.Rti.new'
: 'Function',
canaryFeatures ? 'dart_rti.Rti.new' : 'Function',
);
});
});
Expand Down
24 changes: 2 additions & 22 deletions dwds/test/variable_scope_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import 'package:dwds/src/services/chrome_proxy_service.dart';
import 'package:test/test.dart';
import 'package:test_common/logging.dart';
import 'package:test_common/test_sdk_configuration.dart';
import 'package:test_common/utilities.dart';
import 'package:vm_service/vm_service.dart';

import 'fixtures/context.dart';
Expand Down Expand Up @@ -204,18 +203,7 @@ void main() {
final variableNames = variables.keys.toList()..sort();
expect(
variableNames,
[
// TODO(https://github.com/dart-lang/webdev/issues/2316): Make sure T
// doesn't show up here.
if (dartSdkIsAtLeast(
newDdcTypeSystemVersion,
))
'T',
'closureLocalInsideMethod',
'local',
'parameter',
'this',
],
['closureLocalInsideMethod', 'local', 'parameter', 'this'],
);
});

Expand All @@ -225,15 +213,7 @@ void main() {
await expectDartVariables(variables);

final variableNames = variables.keys.toList()..sort();
expect(variableNames, [
// TODO(https://github.com/dart-lang/webdev/issues/2316): Make sure T
// doesn't show up here.
if (dartSdkIsAtLeast(
newDdcTypeSystemVersion,
))
'T',
'this',
]);
expect(variableNames, ['this']);
});

test('variables in extension method', () async {
Expand Down
6 changes: 2 additions & 4 deletions frontend_server_client/test/frontend_sever_client_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ String get message => p.join('hello', 'world');

expect(await stdoutLines.next, p.join('goodbye', 'world'));
expect(await process.exitCode, 0);
// TODO(https://github.com/dart-lang/webdev/issues/2315): Fix and re-enable.
}, skip: true);
});

test('can handle compile errors and reload fixes', () async {
var entrypoint = p.join(packageRoot, 'bin', 'main.dart');
Expand Down Expand Up @@ -175,8 +174,7 @@ String get message => p.join('hello', 'world');

expect(await stdoutLines.next, p.join('goodbye', 'world'));
expect(await process.exitCode, 0);
// TODO(https://github.com/dart-lang/webdev/issues/2315): Fix and re-enable.
}, skip: true);
});

test('can compile and recompile a dartdevc app', () async {
var entrypoint =
Expand Down
10 changes: 0 additions & 10 deletions test_common/lib/utilities.dart
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
// 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.
import 'dart:io';

import 'package:path/path.dart' as p;
import 'package:pub_semver/pub_semver.dart';

const webdevDirName = 'webdev';
const dwdsDirName = 'dwds';
const fixturesDirName = 'fixtures';

const newDdcTypeSystemVersion = '3.3.0-242.0.dev';

/// The path to the webdev directory in the local machine, e.g.
/// '/workstation/webdev'.
String get webdevPath {
Expand Down Expand Up @@ -65,9 +61,3 @@ String absolutePath({
}
throw Exception('Expected a path parameter.');
}

bool dartSdkIsAtLeast(String sdkVersion) {
final expectedVersion = Version.parse(sdkVersion);
final actualVersion = Version.parse(Platform.version.split(' ')[0]);
return actualVersion >= expectedVersion;
}
2 changes: 1 addition & 1 deletion test_common/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ dependencies:
file: ">=6.0.0 <8.0.0"
logging: ^1.0.1
path: ^1.8.1
pub_semver: ^2.1.1
test: ^1.21.1

dev_dependencies:
lints: ^2.0.0
pubspec_parse: ^1.2.2
pub_semver: ^2.1.1

0 comments on commit 2563295

Please sign in to comment.