[WebView][Non-ACR] Do not check loading state for download test 31/212931/1
authoryh106.jung <yh106.jung@samsung.com>
Wed, 28 Aug 2019 07:55:44 +0000 (16:55 +0900)
committeryh106.jung <yh106.jung@samsung.com>
Wed, 28 Aug 2019 07:55:44 +0000 (16:55 +0900)
In download case, it works on navigation phase not loading.
So we don't need to check loading state.

Change-Id: I76f9cf9187d0bb3d7f4eb0ad02327a1b381b15a8
Signed-off-by: yh106.jung <yh106.jung@samsung.com>
tct-suite-vs/Tizen.WebView.Tests/testcase/TSResponsePolicyEventArgs.cs

index d1d3448e0f163cc54c986c7a7f1ac59ed4402043..af83b86f2a0bf22308e6e7129a179a5bcbf15a0b 100755 (executable)
@@ -113,26 +113,21 @@ namespace Tizen.WebView.Tests
             Assert.IsFalse(isDownload, "IsDownload should be false");
 
             TaskCompletionSource<bool> tcsDownload = new TaskCompletionSource<bool>(false);
-            EventHandler onLoadFinishedDownload = (s, e) => { tcsDownload.TrySetResult(true); };
-            EventHandler<SmartCallbackLoadErrorArgs> onLoadErrorDownload = (s, e) => { tcsDownload.TrySetResult(false); };
             EventHandler<ResponsePolicyEventArgs> onResponsePolicyDecideDownload = (s, e) =>
             {
                 isDownload = e.IsDownload;
                 e.Use();
+                tcsDownload.TrySetResult(true);
             };
 
-            _webView.LoadFinished += onLoadFinishedDownload;
-            _webView.LoadError += onLoadErrorDownload;
             _webView.ResponsePolicyDecideRequested += onResponsePolicyDecideDownload;
 
             _webView.LoadUrl(WebViewCommon.TestUrlForDownload);
             result = await tcsDownload.Task;
 
-            _webView.LoadFinished -= onLoadFinishedDownload;
-            _webView.LoadError -= onLoadErrorDownload;
             _webView.ResponsePolicyDecideRequested -= onResponsePolicyDecideDownload;
 
-            Assert.IsFalse(result, "LoadUrl method should be failed for download");
+            Assert.IsTrue(result, "ResponsePolicyDecideRequested should be invoked");
             Assert.IsTrue(isDownload, "IsDownload should be true");
         }