trace_test.dart 770 Bytes
Newer Older
1 2 3 4
// Copyright 2015 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.

5
import 'package:flutter_tools/src/base/common.dart';
6
import 'package:flutter_tools/src/commands/trace.dart';
7

8 9
import 'src/common.dart';
import 'src/context.dart';
10
import 'src/mocks.dart';
11

12
void main() {
13
  group('trace', () {
14
    testUsingContext('returns 1 when no Android device is connected', () async {
15
      final TraceCommand command = TraceCommand();
16
      applyMocksToCommand(command);
17 18 19 20 21 22
      try {
        await createTestCommandRunner(command).run(<String>['trace']);
        fail('Exception expected');
      } on ToolExit catch (e) {
        expect(e.exitCode ?? 1, 1);
      }
23 24 25
    });
  });
}