vmservice_test.dart 692 Bytes
Newer Older
1 2 3 4 5 6
// Copyright 2017 The Chromium Authors. 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:test/test.dart';

7
import 'package:flutter_tools/src/base/port_scanner.dart';
8 9
import 'package:flutter_tools/src/vmservice.dart';

10 11 12
import 'src/common.dart';
import 'src/context.dart';

13 14
void main() {
  group('VMService', () {
15
    testUsingContext('fails connection eagerly in the connect() method', () async {
16
      final int port = await const HostPortScanner().findAvailablePort();
17
      expect(
18
        VMService.connect(Uri.parse('http://localhost:$port')),
19
        throwsToolExit(),
20 21 22 23
      );
    });
  });
}