mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00

Instead of completely private. This has been broken for Impeller for years, which shows how much this method is getting used. Fixes https://github.com/flutter/flutter/issues/130461
31 lines
748 B
Dart
31 lines
748 B
Dart
// Copyright 2014 The Flutter 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 'dart:typed_data';
|
|
|
|
import 'package:flutter_driver/flutter_driver.dart';
|
|
|
|
import '../test/common.dart';
|
|
|
|
void main() {
|
|
late FlutterDriver driver;
|
|
|
|
setUpAll(() async {
|
|
driver = await FlutterDriver.connect();
|
|
await driver.waitUntilFirstFrameRasterized();
|
|
});
|
|
|
|
test('it takes a screenshot', () async {
|
|
// PNG Encoded Bytes.
|
|
final Uint8List bytes = (await driver.screenshot()) as Uint8List;
|
|
|
|
// Check PNG header.
|
|
expect(bytes.sublist(0, 8), <int>[137, 80, 78, 71, 13, 10, 26, 10]);
|
|
});
|
|
|
|
tearDownAll(() async {
|
|
await driver.close();
|
|
});
|
|
}
|