blob: 1eba9fbb48b05586c2b956fce2c1b7d437be6e87 [file] [log] [blame]
Ian Hickson449f4a62019-11-27 15:04:02 -08001// Copyright 2014 The Flutter Authors. All rights reserved.
Kaushik Iska8e8add52019-11-06 10:59:29 -08002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5import 'package:flutter_tools/src/commands/screenshot.dart';
6
7import '../src/common.dart';
8import '../src/context.dart';
9
10void main() {
11 group('Validate screenshot options', () {
12 testUsingContext('rasterizer and skia screenshots do not require a device', () async {
13 ScreenshotCommand.validateOptions('rasterizer', null, 'dummy_observatory_uri');
14 ScreenshotCommand.validateOptions('skia', null, 'dummy_observatory_uri');
15 });
16
17 testUsingContext('rasterizer and skia screenshots require observatory uri', () async {
18 expect(() => ScreenshotCommand.validateOptions('rasterizer', null, null), throwsToolExit());
19 expect(() => ScreenshotCommand.validateOptions('skia', null, null), throwsToolExit());
20 });
21
22 testUsingContext('device screenshots require device', () async {
23 expect(() => ScreenshotCommand.validateOptions('device', null, null), throwsToolExit());
24 });
25 });
26}