Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ void convertToInAppWebView() {
expect(headlessWebView.isRunning(), true);

final InAppWebViewController controller = await controllerCompleter.future;
await tester.pump();
await pageLoaded.future;

final String? url = (await controller.getUrl())?.toString();
Expand Down Expand Up @@ -55,6 +56,7 @@ void convertToInAppWebView() {
);
final InAppWebViewController widgetController =
await widgetControllerCompleter.future;
await tester.pump();

expect(headlessWebView.isRunning(), false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ void getContentHeight() {
);

final InAppWebViewController controller = await controllerCompleter.future;
await pageLoaded.future;

await tester.pump();
await pageLoaded.future;

final contentHeight = await controller.getContentHeight();
expect(contentHeight, isNonZero);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ void getFavicons() {
);

final InAppWebViewController controller = await controllerCompleter.future;
await tester.pump();
await pageLoaded.future;

final List<Favicon>? favicons = await controller.getFavicons();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ void getHtml() {
);

final InAppWebViewController controller = await controllerCompleter.future;
// Platform view creation happens asynchronously.
await tester.pump();
await pageLoaded.future;

final String? html = await controller.getHtml();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ void getMetaTags() {
);

final InAppWebViewController controller = await controllerCompleter.future;
await tester.pump();
await pageLoaded.future;

List<MetaTag> metaTags = await controller.getMetaTags();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ void getMetaThemeColor() {
);

final InAppWebViewController controller = await controllerCompleter.future;
await tester.pump();
await pageLoaded.future;

expect(await controller.getMetaThemeColor(), isNotNull);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ void getOriginalUrl() {
);

final InAppWebViewController controller = await controllerCompleter.future;
await tester.pump();
await pageLoaded.future;
var originUrl = (await controller.getOriginalUrl())?.toString();
expect(originUrl, url.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ void getTitle() {
);

final InAppWebViewController controller = await controllerCompleter.future;
await tester.pump();
await pageStarted.future;
await pageLoaded.future;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ void initialUrlRequest() {
),
),
);
// Platform view creation happens asynchronously.
await tester.pump();

await pageLoaded.future;
final InAppWebViewController controller =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ void injectCSS() {

final InAppWebViewController controller =
await controllerCompleter.future;
await tester.pump();
await pageLoaded.future;

await controller.injectCSSCode(source: """
Expand Down Expand Up @@ -74,6 +75,7 @@ void injectCSS() {

final InAppWebViewController controller =
await controllerCompleter.future;
await tester.pump();
await pageLoaded.future;

await controller.injectCSSFileFromUrl(
Expand Down Expand Up @@ -110,6 +112,7 @@ void injectCSS() {

final InAppWebViewController controller =
await controllerCompleter.future;
await tester.pump();
await pageLoaded.future;

await controller.injectCSSFileFromAsset(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ void injectJavascriptFile() {

final InAppWebViewController controller =
await controllerCompleter.future;
await tester.pump();
await pageLoaded.future;

await controller.injectJavascriptFileFromUrl(
Expand Down Expand Up @@ -97,6 +98,7 @@ void injectJavascriptFile() {

final InAppWebViewController controller =
await controllerCompleter.future;
await tester.pump();
await pageLoaded.future;

await controller.injectJavascriptFileFromAsset(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ void isSecureContext() {
);

final InAppWebViewController controller = await controllerCompleter.future;
await tester.pump();
await pageLoads.stream.first;
expect(await controller.isSecureContext(), true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ void javascriptCodeEvaluation() {
);
final InAppWebViewController controller =
await controllerCompleter.future;
await tester.pump();
await pageLoaded.future;

var result = await controller.evaluateJavascript(source: """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ void loadData() {
);

final InAppWebViewController controller = await controllerCompleter.future;
// do not wait for pump to not miss the load event
tester.pump();
await pageLoads.stream.first;

final data = """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ void loadFile() {
);

final InAppWebViewController controller = await controllerCompleter.future;
// do not wait for pump to not miss the load event
tester.pump();
await pageLoads.stream.first;

await controller.loadFile(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ void loadUrl() {
),
);
final InAppWebViewController controller = await controllerCompleter.future;
await tester.pump();
expect(await firstUrlLoad.future, initialUrl.toString());

await controller.loadUrl(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void onConsoleMessage() {
),
),
);

await tester.pump();
final ConsoleMessage consoleMessage =
await onConsoleMessageCompleter.future;
expect(consoleMessage.message, 'message');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ void onScrollChanged() {
);

final InAppWebViewController controller = await controllerCompleter.future;
await pageLoaded.future;

await tester.pump();
await pageLoaded.future;

controller.scrollTo(x: 0, y: 500);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ void onTitleChanged() {
);

final InAppWebViewController controller = await controllerCompleter.future;
await pageLoaded.future;
await tester.pump();
await pageLoaded.future;
await controller.evaluateJavascript(
source: "document.title = 'title test';");
await expectLater(onTitleChangedCompleter.future, completes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ void onUpdateVisitedHistory() {
);

final InAppWebViewController controller = await controllerCompleter.future;
await tester.pump();
await pageLoaded.future;

await controller.evaluateJavascript(source: """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ void onWindowBlur() {
),
),
);
await tester.pump();
await expectLater(onWindowBlurCompleter.future, completes);
}, skip: shouldSkip);
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ void onWindowFocus() {
),
),
);
await tester.pump();
await expectLater(onWindowFocusCompleter.future, completes);
}, skip: shouldSkip);
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ void printCurrentPage() {
);

final InAppWebViewController controller = await controllerCompleter.future;
await pageLoaded.future;
await tester.pump();
await pageLoaded.future;
await expectLater(controller.printCurrentPage(), completes);
}, skip: shouldSkip);
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,8 @@ void programmaticScroll() {

final InAppWebViewController controller =
await controllerCompleter.future;
await pageLoaded.future;

await tester.pump();
await pageLoaded.future;

await controller.scrollTo(x: 0, y: 0);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ void reload() {
);
final InAppWebViewController controller =
await controllerCompleter.future;
// do not wait for pump to not miss the load event
tester.pump();
String? reloadUrl = await pageLoads.stream.first;
expect(reloadUrl, url.toString());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ void setGetSettings() {
),
),
);
// Platform view creation happens asynchronously.
await tester.pumpAndSettle();
final InAppWebViewController controller = await controllerCompleter.future;
await pageLoaded.future;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void webViewWindows() {
),
),
);

await tester.pump();
await expectLater(pageLoaded.future, completes);
}, skip: shouldSkipTest1);

Expand Down
4 changes: 2 additions & 2 deletions flutter_inappwebview/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ version: 1.0.0+1
publish_to: none

environment:
sdk: ">=2.17.0 <4.0.0"
flutter: ">=3.0.0"
sdk: ">=3.3.0 <4.0.0"
flutter: ">=3.19.0"

dependencies:
flutter:
Expand Down
1 change: 1 addition & 0 deletions flutter_inappwebview_web/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## 1.1.0

- Migrates package to `package:web`.
- Updates minimum supported SDK version to Flutter 3.24/Dart 3.5.

## 1.0.8
Expand Down
Loading