From: yh106.jung Date: Mon, 18 Dec 2023 10:33:30 +0000 (+0900) Subject: [WebView][Non-ACR] Fix some TCs due to Chromium upstream change X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F94%2F302994%2F3;p=test%2Ftct%2Fcsharp%2Fapi.git [WebView][Non-ACR] Fix some TCs due to Chromium upstream change This patch fixes 2 TCs due to Chromium upstream change. 1. Tizen.WebView.Tests.SettingsTests.ScriptsCanOpenWindows_READ_WRITE Default value of new window policy is 'Allowed', so it is appropriate to perform the negative case first. 2. Tizen.WebView.Tests.WebViewTests.StopLoading_CHANGE_STATUS Error event is no longer occurred by the user's stop request, this patch checks only stop request at the start of loading. Change-Id: I6fdb91e92beb8920753cc666074360bfd760c93d Signed-off-by: yh106.jung --- diff --git a/tct-suite-vs/Tizen.WebView.Tests/testcase/TSSettings.cs b/tct-suite-vs/Tizen.WebView.Tests/testcase/TSSettings.cs index 6158151..963db86 100755 --- a/tct-suite-vs/Tizen.WebView.Tests/testcase/TSSettings.cs +++ b/tct-suite-vs/Tizen.WebView.Tests/testcase/TSSettings.cs @@ -131,11 +131,11 @@ namespace Tizen.WebView.Tests var settings = _webView.GetSettings(); Assert.IsInstanceOf(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"); } } } diff --git a/tct-suite-vs/Tizen.WebView.Tests/testcase/TSWebView.cs b/tct-suite-vs/Tizen.WebView.Tests/testcase/TSWebView.cs index 8b1ba33..1910c8a 100755 --- a/tct-suite-vs/Tizen.WebView.Tests/testcase/TSWebView.cs +++ b/tct-suite-vs/Tizen.WebView.Tests/testcase/TSWebView.cs @@ -625,28 +625,23 @@ namespace Tizen.WebView.Tests public async Task StopLoading_CHANGE_STATUS() { /* TEST CODE */ - var isCancellation = false; TaskCompletionSource tcs = new TaskCompletionSource(false); - EventHandler onLoadStarted = (s, e) => { _webView.StopLoading(); }; - EventHandler onLoadFinished = (s, e) => { tcs.TrySetResult(false); }; - EventHandler 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]