Skip to content

Commit cc7b6ad

Browse files
committed
Updates android_webview_controller_test mock & updates changelogs and readmes
1 parent ebae18f commit cc7b6ad

File tree

9 files changed

+45
-38
lines changed

9 files changed

+45
-38
lines changed

packages/webview_flutter/webview_flutter/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# NEXT
1+
## 4.0.6
22

33
* Adds onPageError callback to NavigationDelegate to catch HTTP error status codes.
44

packages/webview_flutter/webview_flutter/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ controller = WebViewController()
3232
},
3333
onPageStarted: (String url) {},
3434
onPageFinished: (String url) {},
35+
onPageError: (int statusCode) {},
3536
onWebResourceError: (WebResourceError error) {},
3637
onNavigationRequest: (NavigationRequest request) {
3738
if (request.url.startsWith('https://www.youtube.com/')) {

packages/webview_flutter/webview_flutter_android/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## NEXT
1+
## 3.3.2
22

33
* Adds onReceivedHttpError WebView callback to support the onPageError callback.
44

packages/webview_flutter/webview_flutter_android/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: webview_flutter_android
22
description: A Flutter plugin that provides a WebView widget on Android.
33
repository: https://github.com/flutter/packages/tree/main/packages/webview_flutter/webview_flutter_android
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+webview%22
5-
version: 3.3.1
5+
version: 3.3.2
66

77
environment:
88
sdk: ">=2.17.0 <3.0.0"

packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart

Lines changed: 37 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,12 @@ class MockAndroidNavigationDelegate extends _i1.Mock
359359
class MockAndroidWebViewController extends _i1.Mock
360360
implements _i8.AndroidWebViewController {
361361
@override
362+
int get webViewIdentifier => (super.noSuchMethod(
363+
Invocation.getter(#webViewIdentifier),
364+
returnValue: 0,
365+
returnValueForMissingStub: 0,
366+
) as int);
367+
@override
362368
_i3.PlatformWebViewControllerCreationParams get params => (super.noSuchMethod(
363369
Invocation.getter(#params),
364370
returnValue: _FakePlatformWebViewControllerCreationParams_4(
@@ -660,11 +666,11 @@ class MockAndroidWebViewController extends _i1.Mock
660666
@override
661667
_i9.Future<void> setOnShowFileSelector(
662668
_i9.Future<List<String>> Function(_i8.FileSelectorParams)?
663-
onShowFileSelectorCallback) =>
669+
onShowFileSelector) =>
664670
(super.noSuchMethod(
665671
Invocation.method(
666672
#setOnShowFileSelector,
667-
[onShowFileSelectorCallback],
673+
[onShowFileSelector],
668674
),
669675
returnValue: _i9.Future<void>.value(),
670676
returnValueForMissingStub: _i9.Future<void>.value(),
@@ -751,6 +757,11 @@ class MockAndroidWebViewProxy extends _i1.Mock
751757
}));
752758
@override
753759
_i2.WebViewClient Function({
760+
void Function(
761+
_i2.WebView,
762+
int,
763+
)?
764+
onPageError,
754765
void Function(
755766
_i2.WebView,
756767
String,
@@ -787,6 +798,11 @@ class MockAndroidWebViewProxy extends _i1.Mock
787798
}) get createAndroidWebViewClient => (super.noSuchMethod(
788799
Invocation.getter(#createAndroidWebViewClient),
789800
returnValue: ({
801+
void Function(
802+
_i2.WebView,
803+
int,
804+
)?
805+
onPageError,
790806
void Function(
791807
_i2.WebView,
792808
String,
@@ -826,6 +842,11 @@ class MockAndroidWebViewProxy extends _i1.Mock
826842
Invocation.getter(#createAndroidWebViewClient),
827843
),
828844
returnValueForMissingStub: ({
845+
void Function(
846+
_i2.WebView,
847+
int,
848+
)?
849+
onPageError,
829850
void Function(
830851
_i2.WebView,
831852
String,
@@ -865,6 +886,11 @@ class MockAndroidWebViewProxy extends _i1.Mock
865886
Invocation.getter(#createAndroidWebViewClient),
866887
),
867888
) as _i2.WebViewClient Function({
889+
void Function(
890+
_i2.WebView,
891+
int,
892+
)?
893+
onPageError,
868894
void Function(
869895
_i2.WebView,
870896
String,
@@ -1067,11 +1093,11 @@ class MockAndroidWebViewWidgetCreationParams extends _i1.Mock
10671093
class MockExpensiveAndroidViewController extends _i1.Mock
10681094
implements _i7.ExpensiveAndroidViewController {
10691095
@override
1070-
bool get requiresViewComposition => (super.noSuchMethod(
1071-
Invocation.getter(#requiresViewComposition),
1072-
returnValue: false,
1073-
returnValueForMissingStub: false,
1074-
) as bool);
1096+
int get textureId => (super.noSuchMethod(
1097+
Invocation.getter(#textureId),
1098+
returnValue: 0,
1099+
returnValueForMissingStub: 0,
1100+
) as int);
10751101
@override
10761102
int get viewId => (super.noSuchMethod(
10771103
Invocation.getter(#viewId),
@@ -1127,18 +1153,11 @@ class MockExpensiveAndroidViewController extends _i1.Mock
11271153
returnValueForMissingStub: _i9.Future<void>.value(),
11281154
) as _i9.Future<void>);
11291155
@override
1130-
_i9.Future<void> create({
1131-
_i4.Size? size,
1132-
_i4.Offset? position,
1133-
}) =>
1134-
(super.noSuchMethod(
1156+
_i9.Future<void> create({_i4.Size? size}) => (super.noSuchMethod(
11351157
Invocation.method(
11361158
#create,
11371159
[],
1138-
{
1139-
#size: size,
1140-
#position: position,
1141-
},
1160+
{#size: size},
11421161
),
11431162
returnValue: _i9.Future<void>.value(),
11441163
returnValueForMissingStub: _i9.Future<void>.value(),
@@ -1419,12 +1438,6 @@ class MockPlatformViewsServiceProxy extends _i1.Mock
14191438
class MockSurfaceAndroidViewController extends _i1.Mock
14201439
implements _i7.SurfaceAndroidViewController {
14211440
@override
1422-
bool get requiresViewComposition => (super.noSuchMethod(
1423-
Invocation.getter(#requiresViewComposition),
1424-
returnValue: false,
1425-
returnValueForMissingStub: false,
1426-
) as bool);
1427-
@override
14281441
int get viewId => (super.noSuchMethod(
14291442
Invocation.getter(#viewId),
14301443
returnValue: 0,
@@ -1479,18 +1492,11 @@ class MockSurfaceAndroidViewController extends _i1.Mock
14791492
returnValueForMissingStub: _i9.Future<void>.value(),
14801493
) as _i9.Future<void>);
14811494
@override
1482-
_i9.Future<void> create({
1483-
_i4.Size? size,
1484-
_i4.Offset? position,
1485-
}) =>
1486-
(super.noSuchMethod(
1495+
_i9.Future<void> create({_i4.Size? size}) => (super.noSuchMethod(
14871496
Invocation.method(
14881497
#create,
14891498
[],
1490-
{
1491-
#size: size,
1492-
#position: position,
1493-
},
1499+
{#size: size},
14941500
),
14951501
returnValue: _i9.Future<void>.value(),
14961502
returnValueForMissingStub: _i9.Future<void>.value(),

packages/webview_flutter/webview_flutter_platform_interface/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## NEXT
1+
## 2.0.3
22

33
* Adds platform interface for onPageError callback
44

packages/webview_flutter/webview_flutter_platform_interface/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/webview_flutt
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+webview_flutter%22
55
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
66
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
7-
version: 2.0.2
7+
version: 2.0.3
88

99
environment:
1010
sdk: ">=2.12.0 <3.0.0"

packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## NEXT
1+
## 3.1.2
22

33
* Adds decidePolicyForNavigationResponse WKWebView delegate to support the onPageError callback.
44

packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: webview_flutter_wkwebview
22
description: A Flutter plugin that provides a WebView widget based on Apple's WKWebView control.
33
repository: https://github.com/flutter/packages/tree/main/packages/webview_flutter/webview_flutter_wkwebview
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+webview%22
5-
version: 3.1.1
5+
version: 3.1.2
66

77
environment:
88
sdk: ">=2.17.0 <3.0.0"

0 commit comments

Comments
 (0)