[webview_flutter] use hard coded values in `setAndGetScrollPosition` test (#2785)
diff --git a/packages/webview_flutter/CHANGELOG.md b/packages/webview_flutter/CHANGELOG.md
index 1a3bfdb..04155a5 100644
--- a/packages/webview_flutter/CHANGELOG.md
+++ b/packages/webview_flutter/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 0.3.22+1
+
+* Update the `setAndGetScrollPosition` to use hard coded values and add a `pumpAndSettle` call.
+
## 0.3.22
* Add support for passing a failing url.
diff --git a/packages/webview_flutter/example/test_driver/webview_flutter_e2e.dart b/packages/webview_flutter/example/test_driver/webview_flutter_e2e.dart
index 1632964..3468067 100644
--- a/packages/webview_flutter/example/test_driver/webview_flutter_e2e.dart
+++ b/packages/webview_flutter/example/test_driver/webview_flutter_e2e.dart
@@ -542,41 +542,22 @@
testWidgets('setAndGetScrollPosition', (WidgetTester tester) async {
final String scrollTestPage = '''
<!DOCTYPE html>
- <html>
+ <html>
<head>
<style>
- html {
- height: 100%;
- width: 100%;
- overflow-x: auto;
- overflow-y: auto;
- }
-
body {
height: 100%;
width: 100%;
}
+ #container{
+ width:5000px;
+ height:5000px;
+ }
</style>
-
- <script type="text/javascript">
- function config() {
- // Create a page with dimensions big enough to allow scrolling on both x & y.
- document.body.style.padding = getScreenHeight() + 'px'
- }
-
- function getScreenHeight() {
- var body = document.body,
- html = document.documentElement;
-
- var height = Math.max(body.clientHeight, body.scrollHeight, body.offsetHeight,
- html.clientHeight, html.scrollHeight, html.offsetHeight);
-
- return height;
- }
- </script>
</head>
-
- <body onload="config();"/>
+ <body>
+ <div id="container"/>
+ </body>
</html>
''';
@@ -606,6 +587,8 @@
final WebViewController controller = await controllerCompleter.future;
await pageLoaded.future;
+ await tester.pumpAndSettle(Duration(seconds: 3));
+
// Check scrollTo()
const int X_SCROLL = 123;
const int Y_SCROLL = 321;
diff --git a/packages/webview_flutter/pubspec.yaml b/packages/webview_flutter/pubspec.yaml
index c65dac0..2ccc3ef 100644
--- a/packages/webview_flutter/pubspec.yaml
+++ b/packages/webview_flutter/pubspec.yaml
@@ -1,6 +1,6 @@
name: webview_flutter
description: A Flutter plugin that provides a WebView widget on Android and iOS.
-version: 0.3.22
+version: 0.3.22+1
homepage: https://github.com/flutter/plugins/tree/master/packages/webview_flutter
environment: