Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit c223060

Browse files
author
Emmanuel Garcia
committed
More checks
1 parent 911cd97 commit c223060

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/webview_flutter/example/integration_test/webview_flutter_test.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ void main() {
823823
});
824824
});
825825

826-
group('$SurfaceAndroidWebView', () {
826+
group('SurfaceAndroidWebView', () {
827827
setUpAll(() {
828828
WebView.platform = SurfaceAndroidWebView();
829829
});
@@ -902,6 +902,8 @@ void main() {
902902

903903
testWidgets('inputs are scrolled into view when focused',
904904
(WidgetTester tester) async {
905+
expect(Platform.isAndroid, isTrue);
906+
905907
final String scrollTestPage = '''
906908
<!DOCTYPE html>
907909
<html>
@@ -1004,7 +1006,7 @@ void main() {
10041006
viewportRectRelativeToViewport['right'],
10051007
isTrue);
10061008
});
1007-
}, skip: !Platform.isAndroid);
1009+
}, skip: Platform.isAndroid ? false : 'Platform isn\'t Android');
10081010

10091011
group('NavigationDelegate', () {
10101012
final String blankPage = "<!DOCTYPE html><head></head><body></body></html>";

packages/webview_flutter/lib/webview_flutter.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// found in the LICENSE file.
44

55
import 'dart:async';
6+
import 'dart:io';
67

78
import 'package:flutter/foundation.dart';
89
import 'package:flutter/gestures.dart';
@@ -85,6 +86,7 @@ class SurfaceAndroidWebView extends AndroidWebView {
8586
Set<Factory<OneSequenceGestureRecognizer>>? gestureRecognizers,
8687
required WebViewPlatformCallbacksHandler webViewPlatformCallbacksHandler,
8788
}) {
89+
assert(Platform.isAndroid);
8890
assert(webViewPlatformCallbacksHandler != null);
8991
return PlatformViewLink(
9092
viewType: 'plugins.flutter.io/webview',

0 commit comments

Comments
 (0)