updated tests, fixed ios and macos headless to inappwebview conversion
This commit is contained in:
parent
b190d02925
commit
79024b24da
@ -194,6 +194,12 @@ void main() {
|
||||
].contains(defaultTargetPlatform);
|
||||
|
||||
skippableGroup('InAppWebView', () {
|
||||
setUpAll(() async {
|
||||
if (!kIsWeb && defaultTargetPlatform == TargetPlatform.android) {
|
||||
await InAppWebViewController.setWebContentsDebuggingEnabled(true);
|
||||
}
|
||||
});
|
||||
|
||||
initialUrlRequest();
|
||||
setGetSettings();
|
||||
javascriptCodeEvaluation();
|
||||
|
@ -121,7 +121,7 @@ void webMessage() {
|
||||
if (event.ports[0] != null) {
|
||||
port = event.ports[0];
|
||||
port.onmessage = function (event) {
|
||||
console.log(event.data);
|
||||
console.log(bufferToString(event.data));
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -18,10 +18,6 @@ import 'tracing_controller/main.dart' as tracing_controller_tests;
|
||||
void main() {
|
||||
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
if (!kIsWeb && defaultTargetPlatform == TargetPlatform.android) {
|
||||
InAppWebViewController.setWebContentsDebuggingEnabled(true);
|
||||
}
|
||||
|
||||
WebView.debugLoggingSettings.usePrint = true;
|
||||
WebView.debugLoggingSettings.maxLogMessageLength = 7000;
|
||||
InAppBrowser.debugLoggingSettings.usePrint = true;
|
||||
|
@ -71,20 +71,26 @@ public class HeadlessInAppWebView : Disposable {
|
||||
view.alpha = 1.0
|
||||
// remove from parent
|
||||
view.removeFromSuperview()
|
||||
dispose()
|
||||
dispose(disposeWebView: false)
|
||||
}
|
||||
return newFlutterWebView
|
||||
}
|
||||
|
||||
public func dispose() {
|
||||
public func dispose(disposeWebView: Bool) {
|
||||
channelDelegate?.dispose()
|
||||
channelDelegate = nil
|
||||
plugin?.headlessInAppWebViewManager?.webViews[id] = nil
|
||||
flutterWebView?.dispose(removeFromSuperview: true)
|
||||
if disposeWebView {
|
||||
flutterWebView?.dispose(removeFromSuperview: true)
|
||||
}
|
||||
flutterWebView = nil
|
||||
plugin = nil
|
||||
}
|
||||
|
||||
public func dispose() {
|
||||
dispose(disposeWebView: true)
|
||||
}
|
||||
|
||||
deinit {
|
||||
debugPrint("HeadlessInAppWebView - dealloc")
|
||||
dispose()
|
||||
|
@ -72,21 +72,27 @@ public class HeadlessInAppWebView : Disposable {
|
||||
view.alphaValue = 1.0
|
||||
// remove from parent
|
||||
view.removeFromSuperview()
|
||||
dispose()
|
||||
dispose(disposeWebView: false)
|
||||
}
|
||||
return newFlutterWebView
|
||||
}
|
||||
|
||||
|
||||
public func dispose() {
|
||||
public func dispose(disposeWebView: Bool) {
|
||||
channelDelegate?.dispose()
|
||||
channelDelegate = nil
|
||||
plugin?.headlessInAppWebViewManager?.webViews[id] = nil
|
||||
flutterWebView?.dispose(removeFromSuperview: true)
|
||||
if disposeWebView {
|
||||
flutterWebView?.dispose(removeFromSuperview: true)
|
||||
}
|
||||
flutterWebView = nil
|
||||
plugin = nil
|
||||
}
|
||||
|
||||
public func dispose() {
|
||||
dispose(disposeWebView: true)
|
||||
}
|
||||
|
||||
deinit {
|
||||
debugPrint("HeadlessInAppWebView - dealloc")
|
||||
dispose()
|
||||
|
Loading…
x
Reference in New Issue
Block a user