Ian Hickson | 449f4a6 | 2019-11-27 15:04:02 -0800 | [diff] [blame] | 1 | // Copyright 2014 The Flutter Authors. All rights reserved. |
Kaushik Iska | 8e8add5 | 2019-11-06 10:59:29 -0800 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | import 'package:flutter_tools/src/commands/screenshot.dart'; |
| 6 | |
| 7 | import '../src/common.dart'; |
| 8 | import '../src/context.dart'; |
| 9 | |
| 10 | void 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 | } |