60b217ff2d
Also cleans up some references to Observatory in various places. Work towards https://github.com/dart-lang/sdk/issues/50233 TEST=N/A CoreLibraryReviewExempt: Not modifying public core libraries. Change-Id: I1f36b4e6f1fd9a59a579d719aafa599906eedb3f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429141 Reviewed-by: Siva Annamalai <asiva@google.com> Commit-Queue: Ben Konyi <bkonyi@google.com>
64 lines
1.9 KiB
Dart
64 lines
1.9 KiB
Dart
// Copyright (c) 2021, 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:convert';
|
|
import 'dart:io';
|
|
|
|
import 'package:dds/dds.dart';
|
|
|
|
import 'package:test/test.dart';
|
|
import 'common/test_helper.dart';
|
|
|
|
// Regression test for https://github.com/dart-lang/sdk/issues/45933.
|
|
|
|
void main() {
|
|
Process? process;
|
|
DartDevelopmentService? dds;
|
|
|
|
setUp(() async {
|
|
// We don't care what's actually running in the target process for this
|
|
// test, so we're just using an existing one that invokes `debugger()` so
|
|
// we know it won't exit before we can connect.
|
|
process = await spawnDartProcess(
|
|
'get_stream_history_script.dart',
|
|
pauseOnStart: false,
|
|
);
|
|
});
|
|
|
|
tearDown(() async {
|
|
await dds?.shutdown();
|
|
process?.kill();
|
|
dds = null;
|
|
process = null;
|
|
});
|
|
|
|
defineTest({required bool authCodesEnabled}) {
|
|
test(
|
|
'Ensure DevTools assets are available with '
|
|
'${authCodesEnabled ? '' : 'no'} auth codes', () async {
|
|
dds = await DartDevelopmentService.startDartDevelopmentService(
|
|
remoteVmServiceUri,
|
|
devToolsConfiguration: DevToolsConfiguration(
|
|
enable: true,
|
|
customBuildDirectoryPath: devtoolsAppUri(),
|
|
),
|
|
);
|
|
expect(dds!.isRunning, true);
|
|
|
|
final client = HttpClient();
|
|
|
|
// Check that DevTools assets are accessible.
|
|
final devtoolsRequest = await client.getUrl(dds!.devToolsUri!);
|
|
final devtoolsResponse = await devtoolsRequest.close();
|
|
expect(devtoolsResponse.statusCode, 200);
|
|
final devtoolsContent =
|
|
await devtoolsResponse.transform(utf8.decoder).join();
|
|
expect(devtoolsContent, startsWith('<!DOCTYPE html>'));
|
|
});
|
|
}
|
|
|
|
defineTest(authCodesEnabled: true);
|
|
defineTest(authCodesEnabled: false);
|
|
}
|