iosWebViewFix/example/integration_test/in_app_browser/set_get_settings.dart

36 lines
1.2 KiB
Dart
Raw Normal View History

part of 'main.dart';
2022-04-28 21:23:38 +00:00
void setGetSettings() {
2022-04-29 00:07:01 +00:00
final shouldSkip = kIsWeb
? true
: ![
TargetPlatform.android,
TargetPlatform.iOS,
TargetPlatform.macOS,
].contains(defaultTargetPlatform);
2022-04-28 21:23:38 +00:00
skippableTest('set/get settings', () async {
2022-04-28 21:23:38 +00:00
var inAppBrowser = new MyInAppBrowser();
await inAppBrowser.openUrlRequest(
urlRequest: URLRequest(url: TEST_URL_1),
settings: InAppBrowserClassSettings(
browserSettings: InAppBrowserSettings(hideToolbarTop: true)));
await inAppBrowser.browserCreated.future;
await inAppBrowser.firstPageLoaded.future;
InAppBrowserClassSettings? settings = await inAppBrowser.getSettings();
expect(settings, isNotNull);
expect(settings!.browserSettings.hideToolbarTop, true);
await inAppBrowser.setSettings(
settings: InAppBrowserClassSettings(
browserSettings: InAppBrowserSettings(hideToolbarTop: false)));
settings = await inAppBrowser.getSettings();
expect(settings, isNotNull);
expect(settings!.browserSettings.hideToolbarTop, false);
await expectLater(inAppBrowser.close(), completes);
2022-04-28 21:23:38 +00:00
}, skip: shouldSkip);
}