mirror of
https://github.com/flutter/flutter
synced 2024-09-13 05:11:45 +00:00
[web] remove platform_messages_integration test (#147654)
This functionality is already fully covered by https://github.com/flutter/engine/blob/main/lib/web_ui/test/engine/platform_views/message_handler_test.dart This might help with https://github.com/flutter/flutter/issues/146189 a little.
This commit is contained in:
parent
5181086fac
commit
f256f68831
|
@ -142,11 +142,6 @@ class WebTestsSuite {
|
|||
),
|
||||
],
|
||||
|
||||
// This test doesn't do anything interesting w.r.t. rendering, so we don't run the full build mode x renderer matrix.
|
||||
() => _runWebE2eTest('platform_messages_integration', buildMode: 'debug', renderer: 'canvaskit'),
|
||||
() => _runWebE2eTest('platform_messages_integration', buildMode: 'profile', renderer: 'html'),
|
||||
() => _runWebE2eTest('platform_messages_integration', buildMode: 'release', renderer: 'html'),
|
||||
|
||||
// This test doesn't do anything interesting w.r.t. rendering, so we don't run the full build mode x renderer matrix.
|
||||
() => _runWebE2eTest('profile_diagnostics_integration', buildMode: 'debug', renderer: 'html'),
|
||||
() => _runWebE2eTest('profile_diagnostics_integration', buildMode: 'profile', renderer: 'canvaskit'),
|
||||
|
|
|
@ -1,63 +0,0 @@
|
|||
// 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';
|
||||
|
||||
void main() => runApp(const MyApp());
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const MaterialApp(
|
||||
key: Key('mainapp'),
|
||||
title: 'Integration Test App For Platform Messages',
|
||||
home: MyHomePage(title: 'Integration Test App For Platform Messages'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyHomePage extends StatefulWidget {
|
||||
const MyHomePage({super.key, required this.title});
|
||||
|
||||
final String title;
|
||||
|
||||
@override
|
||||
State createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage> {
|
||||
final TextEditingController _controller =
|
||||
TextEditingController(text: 'Text1');
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(widget.title),
|
||||
),
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
const Text('Hello World',
|
||||
),
|
||||
// Create a text form field since we can't test clipboard unless
|
||||
// html document has focus.
|
||||
TextFormField(
|
||||
key: const Key('input'),
|
||||
enabled: true,
|
||||
controller: _controller,
|
||||
//initialValue: 'Text1',
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Text Input Field:',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
// 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:ui_web' as ui_web;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:integration_test/integration_test.dart';
|
||||
import 'package:web/web.dart' as web;
|
||||
import 'package:web_e2e_tests/platform_messages_main.dart' as app;
|
||||
|
||||
void main() {
|
||||
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
testWidgets('platform message for Clipboard.setData reply with future',
|
||||
(WidgetTester tester) async {
|
||||
app.main();
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
// TODO(nurhan): https://github.com/flutter/flutter/issues/51885
|
||||
tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.textInput, null);
|
||||
// Focus on a TextFormField.
|
||||
final Finder finder = find.byKey(const Key('input'));
|
||||
expect(finder, findsOneWidget);
|
||||
await tester.tap(find.byKey(const Key('input')));
|
||||
// Focus in input, otherwise clipboard will fail with
|
||||
// 'document is not focused' platform exception.
|
||||
(web.document.querySelector('input') as web.HTMLElement?)?.focus();
|
||||
await Clipboard.setData(const ClipboardData(text: 'sample text'));
|
||||
}, skip: true); // https://github.com/flutter/flutter/issues/54296
|
||||
|
||||
testWidgets('Should create and dispose view embedder',
|
||||
(WidgetTester tester) async {
|
||||
int viewInstanceCount = 0;
|
||||
|
||||
platformViewsRegistry.getNextPlatformViewId();
|
||||
ui_web.platformViewRegistry.registerViewFactory('MyView', (int viewId) {
|
||||
viewInstanceCount += 1;
|
||||
return web.HTMLDivElement();
|
||||
});
|
||||
|
||||
app.main();
|
||||
await tester.pumpAndSettle();
|
||||
final Map<String, dynamic> createArgs = <String, dynamic>{
|
||||
'id': 567,
|
||||
'viewType': 'MyView',
|
||||
};
|
||||
await SystemChannels.platform_views.invokeMethod<void>('create', createArgs);
|
||||
await SystemChannels.platform_views.invokeMethod<void>('dispose', 567);
|
||||
expect(viewInstanceCount, 1);
|
||||
});
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
// 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:integration_test/integration_test_driver.dart' as test;
|
||||
|
||||
Future<void> main() async => test.integrationDriver();
|
Loading…
Reference in a new issue