mirror of
https://github.com/dart-lang/sdk
synced 2024-09-15 23:29:47 +00:00
85cf783fe8
Change-Id: Iab61ff9f67b40157657fde2d732e970d67c9fcac Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290607 Reviewed-by: Bob Nystrom <rnystrom@google.com> Commit-Queue: Devon Carew <devoncarew@google.com>
47 lines
1.4 KiB
Dart
47 lines
1.4 KiB
Dart
// Copyright (c) 2022, 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 'package:expect/expect.dart';
|
|
import 'package:test_runner/src/browser_controller.dart';
|
|
import 'package:test_runner/src/configuration.dart';
|
|
|
|
void main() async {
|
|
var configuration = TestConfiguration(
|
|
configuration: Configuration.parse(
|
|
const String.fromEnvironment("test_runner.configuration"),
|
|
{'runtime': 'vm'}),
|
|
isVerbose: false,
|
|
localIP: '127.0.0.1',
|
|
testDriverErrorPort: 0,
|
|
testServerPort: 0,
|
|
testServerCrossOriginPort: 0,
|
|
outputDirectory: '',
|
|
reproducingArguments: [],
|
|
sharedOptions: [],
|
|
);
|
|
await configuration.startServers();
|
|
try {
|
|
var testRunner =
|
|
BrowserTestRunner(configuration, '127.0.0.1', 1, (_) => FakeBrowser());
|
|
await testRunner.start();
|
|
try {
|
|
Expect.isTrue(testRunner.testingServerStarted);
|
|
Expect.equals(1, testRunner.numBrowsers);
|
|
} finally {
|
|
await testRunner.terminate();
|
|
}
|
|
} finally {
|
|
configuration.stopServers();
|
|
}
|
|
}
|
|
|
|
class FakeBrowser extends Browser {
|
|
@override
|
|
Future<bool> start(String url) => Future.value(true);
|
|
@override
|
|
Future<bool> close() => Future.value(true);
|
|
@override
|
|
Future<String> version = Future.value('fake version');
|
|
}
|