Provide flutter sdk kernel files to dwds launcher instead of dart ones (#103436)

* Provide flutter sdk kernel files to dwds launcher instead of dart ones

* Update log test to report all warnings

* Update licences for new files

* Addressed CR comments

* Addressed CR comments
This commit is contained in:
Anna Gringauze
2022-05-11 08:52:43 -07:00
committed by GitHub
parent 7c822310ee
commit 29fecb5980
5 changed files with 105 additions and 19 deletions

View File

@@ -76,28 +76,26 @@ void main() {
});
});
test('.log() filters events', () => testbed.run(() {
// harmless warning that should be filtered out
const String harmlessMessage = 'Unresolved uri: dart:ui';
// serious warning
const String seriousMessage = 'Something bad happened';
test('.log() reports warnings', () => testbed.run(() {
const String unresolvedUriMessage = 'Unresolved uri:';
const String otherMessage = 'Something bad happened';
final List<logging.LogRecord> events = <logging.LogRecord>[
logging.LogRecord(
logging.Level.WARNING,
harmlessMessage,
unresolvedUriMessage,
'DartUri',
),
logging.LogRecord(
logging.Level.WARNING,
seriousMessage,
otherMessage,
'DartUri',
),
];
events.forEach(log);
expect(logger.warningText, contains(seriousMessage));
expect(logger.warningText, isNot(contains(harmlessMessage)));
expect(logger.warningText, contains(unresolvedUriMessage));
expect(logger.warningText, contains(otherMessage));
}));
test('Handles against malformed manifest', () => testbed.run(() async {

View File

@@ -23,6 +23,9 @@ void main() {
tempDir = createResolvedTempDirectorySync('run_expression_eval_test.');
await project.setUpIn(tempDir);
flutter = FlutterRunTestDriver(tempDir);
flutter.stdout.listen((String line) {
expect(line, isNot(contains('Unresolved uri:')));
});
});
tearDown(() async {

View File

@@ -0,0 +1,45 @@
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import 'package:dwds/dwds.dart';
import 'package:file/file.dart';
import 'package:file/memory.dart';
import 'package:flutter_tools/src/artifacts.dart';
import 'package:flutter_tools/src/isolated/sdk_web_configuration.dart';
import '../src/common.dart';
void main() {
FileSystem fileSystem;
group('Flutter SDK configuration for web', () {
SdkConfiguration configuration;
setUp(() async {
fileSystem = MemoryFileSystem.test();
fileSystem.directory('HostArtifact.flutterWebSdk').createSync();
fileSystem.file('HostArtifact.webPlatformKernelDill').createSync();
fileSystem.file('HostArtifact.webPlatformSoundKernelDill').createSync();
fileSystem.file('HostArtifact.flutterWebLibrariesJson').createSync();
final SdkWebConfigurationProvider provider =
SdkWebConfigurationProvider(Artifacts.test(fileSystem: fileSystem));
configuration = await provider.configuration;
});
testWithoutContext('can be validated', () {
SdkWebConfigurationProvider.validate(configuration, fileSystem: fileSystem);
});
testWithoutContext('is correct', () {
expect(configuration.sdkDirectory, 'HostArtifact.flutterWebSdk');
expect(configuration.unsoundSdkSummaryPath, 'HostArtifact.webPlatformKernelDill');
expect(configuration.soundSdkSummaryPath, 'HostArtifact.webPlatformSoundKernelDill');
expect(configuration.librariesPath, 'HostArtifact.flutterWebLibrariesJson');
expect(configuration.compilerWorkerPath, isNull);
});
});
}