Gray Mackall 112f1704d1
Reland hybrid views test (#181336)
This test was deleted in https://github.com/flutter/flutter/pull/162903
under the claim that it wasn't running, but it was actually (just only
in bringup). In fact the [glue
code](dbed04aa32/dev/devicelab/lib/tasks/integration_tests.dart (L75))
and
[ci.yaml](https://github.com/flutter/flutter/blob/master/.ci.yaml#L2874)
target are still around. It tested stuff that isn't covered by the
current testing landscape, like alert dialogue popup and event types
being preserved.

The original pr was not a pure deletion so I maintained the good changes
(mostly a change to use shared code for the app under test).

Had to make some changes (described in comments below) but the test is
passing in its current state.

---------

Co-authored-by: Gray Mackall <mackall@google.com>
2026-01-23 02:22:09 +00:00

49 lines
1.3 KiB
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 'package:flutter/material.dart';
import 'package:flutter_driver/driver_extension.dart';
import 'future_data_handler.dart';
import 'motion_events_page.dart';
import 'nested_view_event_page.dart';
import 'page.dart';
final List<PageWidget> _allPages = <PageWidget>[
const MotionEventsPage(),
const NestedViewEventPage(),
];
void main() {
enableFlutterDriverExtension(handler: driverDataHandler.handleMessage);
runApp(const MaterialApp(home: Home()));
}
class Home extends StatelessWidget {
const Home({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: ListView(
children: _allPages.map((PageWidget p) => _buildPageListTile(context, p)).toList(),
),
);
}
Widget _buildPageListTile(BuildContext context, PageWidget page) {
return ListTile(
title: Text(page.title),
key: page.tileKey,
onTap: () {
_pushPage(context, page);
},
);
}
void _pushPage(BuildContext context, PageWidget page) {
Navigator.of(context).push(MaterialPageRoute<void>(builder: (_) => Scaffold(body: page)));
}
}