From c2d4778f326f4e9a53ab7e1be1722edf6b8ce856 Mon Sep 17 00:00:00 2001 From: "yh106.jung" Date: Mon, 18 Dec 2023 19:33:30 +0900 Subject: [PATCH] [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 --- tct-suite-vs/Tizen.WebView.Tests/testcase/TSSettings.cs | 6 +++--- tct-suite-vs/Tizen.WebView.Tests/testcase/TSWebView.cs | 13 ++++--------- 2 files changed, 7 insertions(+), 12 deletions(-) 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] -- 2.7.4