[Android] add runtime flag to determine if HCPP is supported. (#163004)

Developers will need to _conditionally_ use HCPP (or the framework will
need to handle it automatically). This requires the ability to query at
runtime whether HCPP mode is enabled + supported.

Add a message channel to do so, and add the usage of this to the
android_engine_test. Does not yet add any automatic selection.

---------

Co-authored-by: Matan Lurey <matanlurey@users.noreply.github.com>
This commit is contained in:
Jonah Williams
2025-02-10 14:43:25 -08:00
committed by GitHub
parent 5e37c966c0
commit 9438fd4471
13 changed files with 95 additions and 4 deletions

View File

@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:convert';
import 'package:android_driver_extensions/native_driver.dart';
import 'package:android_driver_extensions/skia_gold.dart';
import 'package:flutter_driver/flutter_driver.dart';
@@ -43,6 +45,13 @@ void main() async {
await flutterDriver.close();
});
test('verify that HCPP is supported and enabled', () async {
final Map<String, Object?> response =
json.decode(await flutterDriver.requestData('')) as Map<String, Object?>;
expect(response['supported'], true);
}, timeout: Timeout.none);
test('should screenshot an HCPP platform view', () async {
await expectLater(
nativeDriver.screenshot(),