var settings = _webView.GetSettings();
Assert.IsInstanceOf<Settings>(settings, "GetSettings method failed");
- settings.ScriptsCanOpenWindows = true;
- Assert.IsTrue(settings.ScriptsCanOpenWindows, "Fail to get/set ScriptCanOpenWindows");
-
settings.ScriptsCanOpenWindows = false;
Assert.IsFalse(settings.ScriptsCanOpenWindows, "Fail to get/set ScriptCanOpenWindows");
+
+ settings.ScriptsCanOpenWindows = true;
+ Assert.IsTrue(settings.ScriptsCanOpenWindows, "Fail to get/set ScriptCanOpenWindows");
}
}
}
public async Task StopLoading_CHANGE_STATUS()
{
/* TEST CODE */
- var isCancellation = false;
TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
- EventHandler onLoadStarted = (s, e) => { _webView.StopLoading(); };
- EventHandler onLoadFinished = (s, e) => { tcs.TrySetResult(false); };
- EventHandler<SmartCallbackLoadErrorArgs> onLoadError = (s, e) => {
- isCancellation = e.Cancellation;
+ EventHandler onLoadStarted = (s, e) => {
+ _webView.StopLoading();
tcs.TrySetResult(true);
};
+ EventHandler onLoadFinished = (s, e) => { tcs.TrySetResult(false); };
_webView.LoadStarted += onLoadStarted;
_webView.LoadFinished += onLoadFinished;
- _webView.LoadError += onLoadError;
_webView.LoadUrl(WebViewCommon.TestUrl);
var result = await tcs.Task;
_webView.LoadStarted -= onLoadStarted;
_webView.LoadFinished -= onLoadFinished;
- _webView.LoadError -= onLoadError;
- Assert.IsTrue(result, "LoadError should be invoked");
- Assert.IsTrue(isCancellation, "Cancellation should be true");
+ Assert.IsTrue(result, "LoadStarted event should be invoked");
}
[Test]