02abdf92cdde682d9d5ab5d76842700756dfb676
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / public / WebView / TSWebView.cs
1 using global::System;
2 using NUnit.Framework;
3 using NUnit.Framework.TUnit;
4 using Tizen.NUI.Components;
5 using Tizen.NUI.BaseComponents;
6 using System.Threading.Tasks;
7
8 namespace Tizen.NUI.Devel.Tests
9 {
10     using tlog = Tizen.Log;
11
12     [TestFixture]
13     [Description("public/WebView/WebView")]
14     public class PublicWebViewTest
15     {
16         private const string tag = "NUITEST";
17         private string url = $"file://{Applications.Application.Current.DirectoryInfo.Resource}webview/index.html";
18         private string secondUrl = $"file://{Applications.Application.Current.DirectoryInfo.Resource}webview/second.html";
19         private string urlForNavigationPolicyTest = "http://www.google.com";
20         private string urlForCertificateConfirmTest = "https://wrong.host.badssl.com/";
21         private string urlForResponsePolicyTest = "http://www.samsung.com";
22         private string urlForConsoleMessageTest = $"file://{Applications.Application.Current.DirectoryInfo.Resource}webview/console_info.html";
23
24         private static string[] runtimeArgs = { "--enable-dali-window", "--enable-spatial-navigation" };
25         private const string USER_AGENT = "Mozilla/5.0 (SMART-TV; Linux; Tizen 6.0) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/4.0 Chrome/76.0.3809.146 TV Safari/537.36";
26         private BaseComponents.WebView webView = null;
27
28         private void JsCallback(string arg) { }
29         private void VideoCallback(bool arg) { }
30         private void GeolocationCallback(string arg1, string arg2) { }
31         private void PromptCallback(string arg1, string arg2) { }
32         private void PlainReceivedCallback(string arg2) { }
33         private void ScreenshotAcquiredCallbackCase(ImageView image) { }
34
35         internal class MyWebView : BaseComponents.WebView
36         {
37             public MyWebView() : base()
38             { }
39
40             public void OnDispose(DisposeTypes type)
41             {
42                 base.Dispose(type);
43             }
44         }
45
46         [SetUp]
47         public void Init()
48         {
49             webView = new BaseComponents.WebView(runtimeArgs)
50             {
51                 Size = new Size(150, 100),
52             };
53             tlog.Info(tag, "Init() is called!");
54         }
55
56         [TearDown]
57         public void Destroy()
58         {
59             tlog.Info(tag, "Destroy() is being called!");
60             webView.Dispose();
61             tlog.Info(tag, "Destroy() is called!");
62         }
63
64         [Test]
65         [Category("P1")]
66         [Description("WebView constructor.")]
67         [Property("SPEC", "Tizen.NUI.WebView.WebView C")]
68         [Property("SPEC_URL", "-")]
69         [Property("CRITERIA", "CONSTR")]
70         [Property("COVPARAM", "")]
71         [Property("AUTHOR", "guowei.wang@samsung.com")]
72         public void WebViewConstructor()
73         {
74             tlog.Debug(tag, $"WebViewConstructor START");
75
76             Assert.IsNotNull(webView, "null handle");
77             Assert.IsInstanceOf<Tizen.NUI.BaseComponents.WebView>(webView, "Should return WebView instance.");
78
79             tlog.Debug(tag, $"WebViewConstructor END (OK)");
80         }
81
82         [Test]
83         [Category("P1")]
84         [Description("WebView constructor.")]
85         [Property("SPEC", "Tizen.NUI.WebView.WebView C")]
86         [Property("SPEC_URL", "-")]
87         [Property("CRITERIA", "CONSTR")]
88         [Property("COVPARAM", "")]
89         [Property("AUTHOR", "guowei.wang@samsung.com")]
90         public void WebViewConstructorWithLocaleAndTimezone()
91         {
92             tlog.Debug(tag, $"WebViewConstructorWithLocaleAndTimezone START");
93
94             var testingTarget = new Tizen.NUI.BaseComponents.WebView("Shanghai", "Asia/Shanghai");
95             Assert.IsNotNull(testingTarget, "null handle");
96             Assert.IsInstanceOf<Tizen.NUI.BaseComponents.WebView>(testingTarget, "Should return WebView instance.");
97
98             testingTarget?.Dispose();
99             tlog.Debug(tag, $"WebViewConstructorWithLocaleAndTimezone END (OK)");
100         }
101
102         [Test]
103         [Category("P1")]
104         [Description("WebView constructor.")]
105         [Property("SPEC", "Tizen.NUI.WebView.WebView C")]
106         [Property("SPEC_URL", "-")]
107         [Property("CRITERIA", "CONSTR")]
108         [Property("COVPARAM", "")]
109         [Property("AUTHOR", "guowei.wang@samsung.com")]
110         public void WebViewConstructorWithWebView()
111         {
112             tlog.Debug(tag, $"WebViewConstructorWithWebView START");
113
114             var testingTarget = new Tizen.NUI.BaseComponents.WebView(webView);
115             Assert.IsNotNull(testingTarget, "null handle");
116             Assert.IsInstanceOf<Tizen.NUI.BaseComponents.WebView>(testingTarget, "Should return WebView instance.");
117
118             testingTarget.Dispose();
119             tlog.Debug(tag, $"WebViewConstructorWithWebView END (OK)");
120         }
121
122         [Test]
123         [Category("P1")]
124         [Description("WebView PageLoadStarted.")]
125         [Property("SPEC", "Tizen.NUI.WebView.PageLoadStarted E")]
126         [Property("SPEC_URL", "-")]
127         [Property("CRITERIA", "PRW")]
128         [Property("COVPARAM", "")]
129         [Property("AUTHOR", "guowei.wang@samsung.com")]
130         public async Task WebViewPageLoadStarted()
131         {
132             tlog.Debug(tag, $"WebViewPageLoadStarted START");
133
134             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
135             EventHandler<WebViewPageLoadEventArgs> onLoadStarted = (s, e) => { tcs.TrySetResult(true); };
136             webView.PageLoadStarted += onLoadStarted;
137
138             webView.LoadUrl(url);
139             var result = await tcs.Task;
140             Assert.IsTrue(result, "PageLoadStarted event should be invoked");
141
142             webView.PageLoadStarted -= onLoadStarted;
143
144             tlog.Debug(tag, $"WebViewPageLoadStarted END (OK)");
145         }
146
147         [Test]
148         [Category("P1")]
149         [Description("WebView PageLoading.")]
150         [Property("SPEC", "Tizen.NUI.WebView.PageLoading E")]
151         [Property("SPEC_URL", "-")]
152         [Property("CRITERIA", "PRW")]
153         [Property("COVPARAM", "")]
154         [Property("AUTHOR", "guowei.wang@samsung.com")]
155         public async Task WebViewPageLoading()
156         {
157             tlog.Debug(tag, $"WebViewPageLoading START");
158
159             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
160             EventHandler<WebViewPageLoadEventArgs> onLoading = (s, e) => { tcs.TrySetResult(true); };
161             webView.PageLoading += onLoading;
162
163             webView.LoadUrl(url);
164             var result = await tcs.Task;
165             Assert.IsTrue(result, "PageLoading event should be invoked");
166
167             webView.PageLoading -= onLoading;
168
169             tlog.Debug(tag, $"WebViewPageLoading END (OK)");
170         }
171
172         [Test]
173         [Category("P1")]
174         [Description("WebView PageLoadFinished.")]
175         [Property("SPEC", "Tizen.NUI.WebView.PageLoadFinished E")]
176         [Property("SPEC_URL", "-")]
177         [Property("CRITERIA", "PRW")]
178         [Property("COVPARAM", "")]
179         [Property("AUTHOR", "guowei.wang@samsung.com")]
180         public async Task WebViewPageLoadFinished()
181         {
182             tlog.Debug(tag, $"WebViewPageLoadFinished START");
183
184             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
185             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) => { tcs.TrySetResult(true); };
186             webView.PageLoadFinished += onLoadFinished;
187
188             webView.LoadUrl(url);
189             var result = await tcs.Task;
190             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
191
192             webView.PageLoadFinished -= onLoadFinished;
193
194             tlog.Debug(tag, $"WebViewPageLoadFinished END (OK)");
195         }
196
197         [Test]
198         [Category("P1")]
199         [Description("WebView UrlChanged.")]
200         [Property("SPEC", "Tizen.NUI.WebView.UrlChanged E")]
201         [Property("SPEC_URL", "-")]
202         [Property("CRITERIA", "PRW")]
203         [Property("COVPARAM", "")]
204         [Property("AUTHOR", "guowei.wang@samsung.com")]
205         public async Task WebViewUrlChanged()
206         {
207             tlog.Debug(tag, $"WebViewUrlChanged START");
208
209             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
210
211             EventHandler<WebViewUrlChangedEventArgs> onUrlChange = (s, e) =>
212             {
213                 tcs.TrySetResult(true);
214             };
215             webView.UrlChanged += onUrlChange;
216
217             webView.LoadUrl(url);
218             var result = await tcs.Task;
219             Assert.IsTrue(result, "UrlChanged event should be invoked");
220
221             webView.UrlChanged -= onUrlChange;
222
223             tlog.Debug(tag, $"WebViewUrlChanged END (OK)");
224         }
225
226         [Test]
227         [Category("P1")]
228         [Description("WebView FrameRendered.")]
229         [Property("SPEC", "Tizen.NUI.WebView.FrameRendered A")]
230         [Property("SPEC_URL", "-")]
231         [Property("CRITERIA", "PRW")]
232         [Property("COVPARAM", "")]
233         [Property("AUTHOR", "guowei.wang@samsung.com")]
234         public async Task WebViewFrameRendered()
235         {
236             tlog.Debug(tag, $"WebViewFrameRendered START");
237
238             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
239             EventHandler<EventArgs> onFrameRender = (s, e) => { tcs.TrySetResult(true); };
240             webView.FrameRendered += onFrameRender;
241
242             webView.LoadUrl(url);
243             var result = await tcs.Task;
244             Assert.IsTrue(result, "FrameRendered event should be invoked");
245
246             webView.FrameRendered -= onFrameRender;
247
248             tlog.Debug(tag, $"WebViewFrameRendered END (OK)");
249         }
250
251         [Test]
252         [Category("P1")]
253         [Description("WebView ResponsePolicyDecided.")]
254         [Property("SPEC", "Tizen.NUI.WebView.ResponsePolicyDecided A")]
255         [Property("SPEC_URL", "-")]
256         [Property("CRITERIA", "PRW")]
257         [Property("COVPARAM", "")]
258         [Property("AUTHOR", "guowei.wang@samsung.com")]
259         public async Task WebViewResponsePolicyDecided()
260         {
261             tlog.Debug(tag, $"WebViewResponsePolicyDecided START");
262
263             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
264             EventHandler<WebViewPolicyDecidedEventArgs> onResponsePolicyDecide = (s, e) => { tcs.TrySetResult(true); };
265             webView.ResponsePolicyDecided += onResponsePolicyDecide;
266
267             webView.LoadUrl(urlForResponsePolicyTest);
268             var result = await tcs.Task;
269             Assert.IsTrue(result, "ResponsePolicyDecided event should be invoked");
270
271             webView.ResponsePolicyDecided -= onResponsePolicyDecide;
272
273             tlog.Debug(tag, $"WebViewResponsePolicyDecided END (OK)");
274         }
275
276         [Test]
277         [Category("P1")]
278         [Description("WebView NavigationPolicyDecided.")]
279         [Property("SPEC", "Tizen.NUI.WebView.NavigationPolicyDecided A")]
280         [Property("SPEC_URL", "-")]
281         [Property("CRITERIA", "PRW")]
282         [Property("COVPARAM", "")]
283         [Property("AUTHOR", "guowei.wang@samsung.com")]
284         public async Task WebViewNavigationPolicyDecided()
285         {
286             tlog.Debug(tag, $"WebViewNavigationPolicyDecided START");
287
288             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
289
290             EventHandler<WebViewPolicyDecidedEventArgs> onNavigationPolicyDecided = (s, e) =>
291             {
292                 tlog.Info(tag, "onNavigationPolicyDecided is being called!");
293                 tcs.TrySetResult(true);
294             };
295             webView.NavigationPolicyDecided += onNavigationPolicyDecided;
296
297             webView.LoadUrl(urlForNavigationPolicyTest);
298             var result = await tcs.Task;
299             Assert.IsTrue(result, "NavigationPolicyDecided event should be invoked");
300
301             webView.NavigationPolicyDecided -= onNavigationPolicyDecided;
302
303             tlog.Debug(tag, $"WebViewNavigationPolicyDecided END (OK)");
304         }
305
306         [Test]
307         [Category("P1")]
308         [Description("WebView CertificateConfirmed.")]
309         [Property("SPEC", "Tizen.NUI.WebView.CertificateConfirmed A")]
310         [Property("SPEC_URL", "-")]
311         [Property("CRITERIA", "PRW")]
312         [Property("COVPARAM", "")]
313         [Property("AUTHOR", "guowei.wang@samsung.com")]
314         public async Task WebViewCertificateConfirmed()
315         {
316             tlog.Debug(tag, $"WebViewCertificateConfirmed START");
317
318             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
319
320             EventHandler<WebViewCertificateReceivedEventArgs> onCertificateConfirme = (s, e) =>
321             {
322                 tlog.Info(tag, "CertificateConfirmed is being called!");
323                 tcs.TrySetResult(true);
324             };
325             webView.CertificateConfirmed += onCertificateConfirme;
326
327             webView.LoadUrl(urlForCertificateConfirmTest);
328             var result = await tcs.Task;
329             Assert.IsTrue(result, "CertificateConfirmed event should be invoked");
330
331             webView.CertificateConfirmed -= onCertificateConfirme;
332
333             tlog.Debug(tag, $"WebViewCertificateConfirmed END (OK)");
334         }
335
336         [Test]
337         [Category("P1")]
338         [Description("WebView SslCertificateChanged.")]
339         [Property("SPEC", "Tizen.NUI.WebView.SslCertificateChanged A")]
340         [Property("SPEC_URL", "-")]
341         [Property("CRITERIA", "PRW")]
342         [Property("COVPARAM", "")]
343         [Property("AUTHOR", "guowei.wang@samsung.com")]
344         public async Task WebViewSslCertificateChanged()
345         {
346             tlog.Debug(tag, $"WebViewSslCertificateChanged START");
347
348             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
349             EventHandler<WebViewCertificateReceivedEventArgs> onSslCertificateChange = (s, e) => { tcs.TrySetResult(true); };
350             webView.SslCertificateChanged += onSslCertificateChange;
351
352             webView.LoadUrl(url);
353             var result = await tcs.Task;
354             Assert.IsTrue(result, "SslCertificateChanged event should be invoked");
355
356             webView.SslCertificateChanged -= onSslCertificateChange;
357
358             tlog.Debug(tag, $"WebViewSslCertificateChanged END (OK)");
359         }
360
361         //TODO... it seems that web engine does not implement it.
362         //[Test]
363         //[Category("P1")]
364         //[Description("WebView HttpAuthRequested.")]
365         //[Property("SPEC", "Tizen.NUI.WebView.HttpAuthRequested A")]
366         //[Property("SPEC_URL", "-")]
367         //[Property("CRITERIA", "PRW")]
368         //[Property("COVPARAM", "")]
369         //[Property("AUTHOR", "guowei.wang@samsung.com")]
370         //public async Task WebViewHttpAuthRequested()
371         //{
372         //    tlog.Debug(tag, $"WebViewHttpAuthRequested START");
373
374         //    TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
375         //    EventHandler<WebViewHttpAuthRequestedEventArgs> onHttpAuthRequeste = (s, e) => { tcs.TrySetResult(true); };
376         //    webView.HttpAuthRequested += onHttpAuthRequeste;
377
378         //    webView.LoadUrl(urlForHttpAuthRequestTest);
379         //    var result = await tcs.Task;
380         //    Assert.IsTrue(result, "ResponsePolicyDecided event should be invoked");
381
382         //    webView.HttpAuthRequested -= onHttpAuthRequeste;
383
384         //    tlog.Debug(tag, $"WebViewHttpAuthRequested END (OK)");
385         //}
386
387         [Test]
388         [Category("P1")]
389         [Description("WebView ConsoleMessageReceived.")]
390         [Property("SPEC", "Tizen.NUI.WebView.ConsoleMessageReceived A")]
391         [Property("SPEC_URL", "-")]
392         [Property("CRITERIA", "PRW")]
393         [Property("COVPARAM", "")]
394         [Property("AUTHOR", "guowei.wang@samsung.com")]
395         public async Task WebViewConsoleMessageReceived()
396         {
397             tlog.Debug(tag, $"WebViewConsoleMessageReceived START");
398
399             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
400             EventHandler<WebViewConsoleMessageReceivedEventArgs> onConsoleMessageReceive = (s, e) => { tcs.TrySetResult(true); };
401             webView.ConsoleMessageReceived += onConsoleMessageReceive;
402
403             webView.LoadUrl(urlForConsoleMessageTest);
404             var result = await tcs.Task;
405             Assert.IsTrue(result, "ConsoleMessageReceived event should be invoked");
406
407             webView.ConsoleMessageReceived -= onConsoleMessageReceive;
408
409             tlog.Debug(tag, $"WebViewConsoleMessageReceived END (OK)");
410         }
411
412         [Test]
413         [Category("P1")]
414         [Description("WebView BackForwardList.")]
415         [Property("SPEC", "Tizen.NUI.WebView.BackForwardList A")]
416         [Property("SPEC_URL", "-")]
417         [Property("CRITERIA", "PRO")]
418         [Property("COVPARAM", "")]
419         [Property("AUTHOR", "guowei.wang@samsung.com")]
420         public void WebViewBackForwardList()
421         {
422             tlog.Debug(tag, $"WebViewBackForwardList START");
423
424             var result = webView.BackForwardList;
425             tlog.Debug(tag, "ForwardList : " + result);
426
427             tlog.Debug(tag, $"WebViewBackForwardList END (OK)");
428         }
429
430         [Test]
431         [Category("P1")]
432         [Description("WebView Context.")]
433         [Property("SPEC", "Tizen.NUI.WebView.Context A")]
434         [Property("SPEC_URL", "-")]
435         [Property("CRITERIA", "PRO")]
436         [Property("COVPARAM", "")]
437         [Property("AUTHOR", "guowei.wang@samsung.com")]
438         public void WebViewContext()
439         {
440             tlog.Debug(tag, $"WebViewContext START");
441
442             var result = webView.Context;
443             tlog.Debug(tag, "Context : " + result);
444
445             tlog.Debug(tag, $"WebViewContext END (OK)");
446         }
447
448         [Test]
449         [Category("P1")]
450         [Description("WebView CookieManager.")]
451         [Property("SPEC", "Tizen.NUI.WebView.CookieManager A")]
452         [Property("SPEC_URL", "-")]
453         [Property("CRITERIA", "PRO")]
454         [Property("COVPARAM", "")]
455         [Property("AUTHOR", "guowei.wang@samsung.com")]
456         public void WebViewCookieManager()
457         {
458             tlog.Debug(tag, $"WebViewCookieManager START");
459
460             var result = webView.CookieManager;
461             tlog.Debug(tag, "CookieManager : " + result);
462
463             tlog.Debug(tag, $"WebViewCookieManager END (OK)");
464         }
465
466         [Test]
467         [Category("P1")]
468         [Description("WebView Settings.")]
469         [Property("SPEC", "Tizen.NUI.WebView.Settings A")]
470         [Property("SPEC_URL", "-")]
471         [Property("CRITERIA", "PRO")]
472         [Property("COVPARAM", "")]
473         [Property("AUTHOR", "guowei.wang@samsung.com")]
474         public void WebViewSettings()
475         {
476             tlog.Debug(tag, $"WebViewSettings START");
477
478             var result = webView.Settings;
479             tlog.Debug(tag, "Settings : " + result);
480
481             tlog.Debug(tag, $"WebViewSettings END (OK)");
482         }
483
484         [Test]
485         [Category("P1")]
486         [Description("WebView Url.")]
487         [Property("SPEC", "Tizen.NUI.WebView.Url A")]
488         [Property("SPEC_URL", "-")]
489         [Property("CRITERIA", "PRW")]
490         [Property("COVPARAM", "")]
491         [Property("AUTHOR", "guowei.wang@samsung.com")]
492         public async Task WebViewUrl()
493         {
494             tlog.Debug(tag, $"WebViewUrl START");
495             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
496             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
497             {
498                 tcs.TrySetResult(true);
499             };
500             webView.PageLoadFinished += onLoadFinished;
501
502             webView.Url = url;
503             var result = await tcs.Task;
504             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
505
506             webView.PageLoadFinished -= onLoadFinished;
507
508             tlog.Debug(tag, "Url : " + webView.Url);
509             tlog.Debug(tag, $"WebViewUrl END (OK)");
510         }
511
512         [Test]
513         [Category("P1")]
514         [Description("WebView CacheModel.")]
515         [Property("SPEC", "Tizen.NUI.WebView.CacheModel A")]
516         [Property("SPEC_URL", "-")]
517         [Property("CRITERIA", "PRW")]
518         [Property("COVPARAM", "")]
519         [Property("AUTHOR", "guowei.wang@samsung.com")]
520         public void WebViewCacheModel()
521         {
522             tlog.Debug(tag, $"WebViewCacheModel START");
523
524             webView.CacheModel = Tizen.NUI.CacheModel.DocumentViewer;
525             tlog.Debug(tag, "CacheModel : " + webView.CacheModel);
526
527             webView.CacheModel = Tizen.NUI.CacheModel.DocumentBrowser;
528             tlog.Debug(tag, "CacheModel : " + webView.CacheModel);
529
530             webView.CacheModel = Tizen.NUI.CacheModel.PrimaryWebBrowser;
531             tlog.Debug(tag, "CacheModel : " + webView.CacheModel);
532
533             tlog.Debug(tag, $"WebViewCacheModel END (OK)");
534         }
535
536         [Test]
537         [Category("P1")]
538         [Description("WebView CookieAcceptPolicy.")]
539         [Property("SPEC", "Tizen.NUI.WebView.CookieAcceptPolicy A")]
540         [Property("SPEC_URL", "-")]
541         [Property("CRITERIA", "PRW")]
542         [Property("COVPARAM", "")]
543         [Property("AUTHOR", "guowei.wang@samsung.com")]
544         public void WebViewCookieAcceptPolicy()
545         {
546             tlog.Debug(tag, $"WebViewCookieAcceptPolicy START");
547
548             webView.CookieAcceptPolicy = (CookieAcceptPolicy)Tizen.NUI.WebCookieManager.CookieAcceptPolicyType.NoThirdParty;
549             tlog.Debug(tag, "CookieAcceptPolicy : " + webView.CookieAcceptPolicy);
550
551             webView.CookieAcceptPolicy = (CookieAcceptPolicy)Tizen.NUI.WebCookieManager.CookieAcceptPolicyType.Always;
552             tlog.Debug(tag, "CookieAcceptPolicy : " + webView.CookieAcceptPolicy);
553
554             webView.CookieAcceptPolicy = (CookieAcceptPolicy)Tizen.NUI.WebCookieManager.CookieAcceptPolicyType.Never;
555             tlog.Debug(tag, "CookieAcceptPolicy : " + webView.CookieAcceptPolicy);
556
557             tlog.Debug(tag, $"WebViewCookieAcceptPolicy END (OK)");
558         }
559
560         [Test]
561         [Category("P1")]
562         [Description("WebView UserAgent.")]
563         [Property("SPEC", "Tizen.NUI.WebView.UserAgent A")]
564         [Property("SPEC_URL", "-")]
565         [Property("CRITERIA", "PRW")]
566         [Property("COVPARAM", "")]
567         [Property("AUTHOR", "guowei.wang@samsung.com")]
568         public async Task WebViewUserAgent()
569         {
570             tlog.Debug(tag, $"WebViewUserAgent START");
571
572             webView.UserAgent = USER_AGENT;
573             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
574             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
575             {
576                 tcs.TrySetResult(true);
577             };
578             webView.PageLoadFinished += onLoadFinished;
579             webView.LoadUrl(url);
580             var result = await tcs.Task;
581             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
582
583             webView.PageLoadFinished -= onLoadFinished;
584
585             tlog.Debug(tag, "UserAgent : " + webView.UserAgent);
586             tlog.Debug(tag, $"WebViewUserAgent END (OK)");
587         }
588
589         [Test]
590         [Category("P1")]
591         [Description("WebView EnableJavaScript.")]
592         [Property("SPEC", "Tizen.NUI.WebView.EnableJavaScript A")]
593         [Property("SPEC_URL", "-")]
594         [Property("CRITERIA", "PRW")]
595         [Property("COVPARAM", "")]
596         [Property("AUTHOR", "guowei.wang@samsung.com")]
597         public void WebViewEnableJavaScript()
598         {
599             tlog.Debug(tag, $"WebViewEnableJavaScript START");
600
601             webView.EnableJavaScript = true;
602             tlog.Debug(tag, "EnableJavaScript : " + webView.EnableJavaScript);
603
604             webView.EnableJavaScript = false;
605             tlog.Debug(tag, "EnableJavaScript : " + webView.EnableJavaScript);
606
607             tlog.Debug(tag, $"WebViewEnableJavaScript END (OK)");
608         }
609
610         [Test]
611         [Category("P1")]
612         [Description("WebView LoadImagesAutomatically.")]
613         [Property("SPEC", "Tizen.NUI.WebView.LoadImagesAutomatically A")]
614         [Property("SPEC_URL", "-")]
615         [Property("CRITERIA", "PRW")]
616         [Property("COVPARAM", "")]
617         [Property("AUTHOR", "guowei.wang@samsung.com")]
618         public void WebViewLoadImagesAutomatically()
619         {
620             tlog.Debug(tag, $"WebViewLoadImagesAutomatically START");
621
622             webView.LoadImagesAutomatically = true;
623             tlog.Debug(tag, "LoadImagesAutomatically : " + webView.LoadImagesAutomatically);
624
625             webView.LoadImagesAutomatically = false;
626             tlog.Debug(tag, "LoadImagesAutomatically : " + webView.LoadImagesAutomatically);
627
628             tlog.Debug(tag, $"WebViewLoadImagesAutomatically END (OK)");
629         }
630
631         [Test]
632         [Category("P1")]
633         [Description("WebView DefaultTextEncodingName.")]
634         [Property("SPEC", "Tizen.NUI.WebView.DefaultTextEncodingName A")]
635         [Property("SPEC_URL", "-")]
636         [Property("CRITERIA", "PRW")]
637         [Property("COVPARAM", "")]
638         [Property("AUTHOR", "guowei.wang@samsung.com")]
639         public void WebViewDefaultTextEncodingName()
640         {
641             tlog.Debug(tag, $"WebViewDefaultTextEncodingName START");
642
643             var result = webView.DefaultTextEncodingName;
644             tlog.Debug(tag, "DefaultTextEncodingName : " + result);
645
646             webView.DefaultTextEncodingName = "gbk";
647             tlog.Debug(tag, "DefaultTextEncodingName : " + result);
648
649             tlog.Debug(tag, $"WebViewDefaultTextEncodingName END (OK)");
650         }
651
652         [Test]
653         [Category("P1")]
654         [Description("WebView DefaultFontSize.")]
655         [Property("SPEC", "Tizen.NUI.WebView.DefaultFontSize A")]
656         [Property("SPEC_URL", "-")]
657         [Property("CRITERIA", "PRW")]
658         [Property("COVPARAM", "")]
659         [Property("AUTHOR", "guowei.wang@samsung.com")]
660         public void WebViewDefaultFontSize()
661         {
662             tlog.Debug(tag, $"WebViewDefaultFontSize START");
663
664             var result = webView.DefaultFontSize;
665             tlog.Debug(tag, "DefaultFontSize : " + result);
666
667             webView.DefaultFontSize = 32;
668             tlog.Debug(tag, "DefaultFontSize : " + result);
669
670             tlog.Debug(tag, $"WebViewDefaultFontSize END (OK)");
671         }
672
673         [Test]
674         [Category("P1")]
675         [Description("WebView ScrollSize.")]
676         [Property("SPEC", "Tizen.NUI.WebView.ScrollSize A")]
677         [Property("SPEC_URL", "-")]
678         [Property("CRITERIA", "PRO")]
679         [Property("COVPARAM", "")]
680         [Property("AUTHOR", "guowei.wang@samsung.com")]
681         public void WebViewScrollSize()
682         {
683             tlog.Debug(tag, $"WebViewScrollSize START");
684
685             tlog.Debug(tag, "Width : " + webView.ScrollSize.Width);
686             tlog.Debug(tag, "Height : " + webView.ScrollSize.Height);
687
688             tlog.Debug(tag, $"WebViewScrollSize END (OK)");
689         }
690
691         [Test]
692         [Category("P1")]
693         [Description("WebView ContentSize.")]
694         [Property("SPEC", "Tizen.NUI.WebView.ContentSize A")]
695         [Property("SPEC_URL", "-")]
696         [Property("CRITERIA", "PRO")]
697         [Property("COVPARAM", "")]
698         [Property("AUTHOR", "guowei.wang@samsung.com")]
699         public void WebViewContentSize()
700         {
701             tlog.Debug(tag, $"WebViewContentSize START");
702
703             tlog.Debug(tag, "Width : " + webView.ContentSize.Width);
704             tlog.Debug(tag, "Height : " + webView.ContentSize.Height);
705
706             tlog.Debug(tag, $"WebViewContentSize END (OK)");
707         }
708
709         [Test]
710         [Category("P1")]
711         [Description("WebView VideoHoleEnabled.")]
712         [Property("SPEC", "Tizen.NUI.WebView.VideoHoleEnabled A")]
713         [Property("SPEC_URL", "-")]
714         [Property("CRITERIA", "PRW")]
715         [Property("COVPARAM", "")]
716         [Property("AUTHOR", "guowei.wang@samsung.com")]
717         public void WebViewVideoHoleEnabled()
718         {
719             tlog.Debug(tag, $"WebViewVideoHoleEnabled START");
720
721             webView.VideoHoleEnabled = true;
722             tlog.Debug(tag, "VideoHoleEnabled : " + webView.VideoHoleEnabled);
723
724             webView.VideoHoleEnabled = false;
725             tlog.Debug(tag, "VideoHoleEnabled : " + webView.VideoHoleEnabled);
726
727             tlog.Debug(tag, $"WebViewVideoHoleEnabled END (OK)");
728         }
729
730         [Test]
731         [Category("P1")]
732         [Description("WebView MouseEventsEnabled.")]
733         [Property("SPEC", "Tizen.NUI.WebView.MouseEventsEnabled A")]
734         [Property("SPEC_URL", "-")]
735         [Property("CRITERIA", "PRW")]
736         [Property("COVPARAM", "")]
737         [Property("AUTHOR", "guowei.wang@samsung.com")]
738         public void WebViewMouseEventsEnabled()
739         {
740             tlog.Debug(tag, $"WebViewMouseEventsEnabled START");
741
742             webView.MouseEventsEnabled = true;
743             tlog.Debug(tag, "MouseEventsEnabled : " + webView.MouseEventsEnabled);
744
745             webView.MouseEventsEnabled = false;
746             tlog.Debug(tag, "MouseEventsEnabled : " + webView.MouseEventsEnabled);
747
748             tlog.Debug(tag, $"WebViewMouseEventsEnabled END (OK)");
749         }
750
751         [Test]
752         [Category("P1")]
753         [Description("WebView KeyEventsEnabled.")]
754         [Property("SPEC", "Tizen.NUI.WebView.KeyEventsEnabled A")]
755         [Property("SPEC_URL", "-")]
756         [Property("CRITERIA", "PRW")]
757         [Property("COVPARAM", "")]
758         [Property("AUTHOR", "guowei.wang@samsung.com")]
759         public void WebViewKeyEventsEnabled()
760         {
761             tlog.Debug(tag, $"WebViewKeyEventsEnabled START");
762
763             webView.KeyEventsEnabled = true;
764             tlog.Debug(tag, "KeyEventsEnabled : " + webView.KeyEventsEnabled);
765
766             webView.KeyEventsEnabled = false;
767             tlog.Debug(tag, "KeyEventsEnabled : " + webView.KeyEventsEnabled);
768
769             tlog.Debug(tag, $"WebViewKeyEventsEnabled END (OK)");
770         }
771
772         [Test]
773         [Category("P1")]
774         [Description("WebView ContentBackgroundColor.")]
775         [Property("SPEC", "Tizen.NUI.WebView.ContentBackgroundColor A")]
776         [Property("SPEC_URL", "-")]
777         [Property("CRITERIA", "PRW")]
778         [Property("COVPARAM", "")]
779         [Property("AUTHOR", "guowei.wang@samsung.com")]
780         public async Task WebViewContentBackgroundColor()
781         {
782             tlog.Debug(tag, $"WebViewContentBackgroundColor START");
783
784             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
785             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
786             {
787                 webView.ContentBackgroundColor = new Vector4(0.3f, 0.5f, 1.0f, 0.0f);
788                 tcs.TrySetResult(true);
789             };
790             webView.PageLoadFinished += onLoadFinished;
791             webView.LoadUrl(url);
792             var result = await tcs.Task;
793             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
794
795             webView.PageLoadFinished -= onLoadFinished;
796
797             tlog.Debug(tag, "ContentBackgroundColor : " + webView.ContentBackgroundColor);
798
799             tlog.Debug(tag, $"WebViewContentBackgroundColor END (OK)");
800         }
801
802         [Test]
803         [Category("P1")]
804         [Description("WebView TilesClearedWhenHidden.")]
805         [Property("SPEC", "Tizen.NUI.WebView.TilesClearedWhenHidden A")]
806         [Property("SPEC_URL", "-")]
807         [Property("CRITERIA", "PRW")]
808         [Property("COVPARAM", "")]
809         [Property("AUTHOR", "guowei.wang@samsung.com")]
810         public void WebViewTilesClearedWhenHidden()
811         {
812             tlog.Debug(tag, $"WebViewTilesClearedWhenHidden START");
813
814             webView.TilesClearedWhenHidden = true;
815             tlog.Debug(tag, "TilesClearedWhenHidden : " + webView.TilesClearedWhenHidden);
816
817             webView.TilesClearedWhenHidden = false;
818             tlog.Debug(tag, "TilesClearedWhenHidden : " + webView.TilesClearedWhenHidden);
819
820             tlog.Debug(tag, $"WebViewTilesClearedWhenHidden END (OK)");
821         }
822
823         [Test]
824         [Category("P1")]
825         [Description("WebView TileCoverAreaMultiplier.")]
826         [Property("SPEC", "Tizen.NUI.WebView.TileCoverAreaMultiplier A")]
827         [Property("SPEC_URL", "-")]
828         [Property("CRITERIA", "PRW")]
829         [Property("COVPARAM", "")]
830         [Property("AUTHOR", "guowei.wang@samsung.com")]
831         public void WebViewTileCoverAreaMultiplier()
832         {
833             tlog.Debug(tag, $"WebViewTileCoverAreaMultiplier START");
834
835             webView.TileCoverAreaMultiplier = 0.3f;
836             tlog.Debug(tag, "TileCoverAreaMultiplier : " + webView.TileCoverAreaMultiplier);
837
838             tlog.Debug(tag, $"WebViewTileCoverAreaMultiplier END (OK)");
839         }
840
841         [Test]
842         [Category("P1")]
843         [Description("WebView CursorEnabledByClient.")]
844         [Property("SPEC", "Tizen.NUI.WebView.CursorEnabledByClient A")]
845         [Property("SPEC_URL", "-")]
846         [Property("CRITERIA", "PRW")]
847         [Property("COVPARAM", "")]
848         [Property("AUTHOR", "guowei.wang@samsung.com")]
849         public void WebViewCursorEnabledByClient()
850         {
851             tlog.Debug(tag, $"WebViewCursorEnabledByClient START");
852
853             webView.CursorEnabledByClient = true;
854             tlog.Debug(tag, "CursorEnabledByClient : " + webView.CursorEnabledByClient);
855
856             webView.CursorEnabledByClient = false;
857             tlog.Debug(tag, "CursorEnabledByClient : " + webView.CursorEnabledByClient);
858
859             tlog.Debug(tag, $"WebViewCursorEnabledByClient END (OK)");
860         }
861
862         [Test]
863         [Category("P1")]
864         [Description("WebView SelectedText.")]
865         [Property("SPEC", "Tizen.NUI.WebView.SelectedText A")]
866         [Property("SPEC_URL", "-")]
867         [Property("CRITERIA", "PRO")]
868         [Property("COVPARAM", "")]
869         [Property("AUTHOR", "guowei.wang@samsung.com")]
870         public void WebViewSelectedText()
871         {
872             tlog.Debug(tag, $"WebViewSelectedText START");
873
874             var text = webView.SelectedText;
875             tlog.Debug(tag, "SelectedText : " + text);
876
877             tlog.Debug(tag, $"WebViewSelectedText END (OK)");
878         }
879
880         [Test]
881         [Category("P1")]
882         [Description("WebView Title.")]
883         [Property("SPEC", "Tizen.NUI.WebView.Title A")]
884         [Property("SPEC_URL", "-")]
885         [Property("CRITERIA", "PRO")]
886         [Property("COVPARAM", "")]
887         [Property("AUTHOR", "guowei.wang@samsung.com")]
888         public void WebViewTitle()
889         {
890             tlog.Debug(tag, $"WebViewTitle START");
891
892             var title = webView.Title;
893             tlog.Debug(tag, "Title : " + title);
894
895             tlog.Debug(tag, $"WebViewTitle END (OK)");
896         }
897
898         [Test]
899         [Category("P1")]
900         [Description("WebView Favicon.")]
901         [Property("SPEC", "Tizen.NUI.WebView.Favicon A")]
902         [Property("SPEC_URL", "-")]
903         [Property("CRITERIA", "PRO")]
904         [Property("COVPARAM", "")]
905         [Property("AUTHOR", "guowei.wang@samsung.com")]
906         public void WebViewFavicon()
907         {
908             tlog.Debug(tag, $"WebViewFavicon START");
909
910             var fav = webView.Favicon;
911             tlog.Debug(tag, "Favicon : " + fav);
912
913             tlog.Debug(tag, $"WebViewFavicon END (OK)");
914         }
915
916         [Test]
917         [Category("P1")]
918         [Description("WebView PageZoomFactor.")]
919         [Property("SPEC", "Tizen.NUI.WebView.PageZoomFactor A")]
920         [Property("SPEC_URL", "-")]
921         [Property("CRITERIA", "PRW")]
922         [Property("COVPARAM", "")]
923         [Property("AUTHOR", "guowei.wang@samsung.com")]
924         public void WebViewPageZoomFactor()
925         {
926             tlog.Debug(tag, $"WebViewPageZoomFactor START");
927
928             webView.PageZoomFactor = 0.3f;
929             tlog.Debug(tag, "PageZoomFactor : " + webView.PageZoomFactor);
930
931             tlog.Debug(tag, $"WebViewPageZoomFactor END (OK)");
932         }
933
934         [Test]
935         [Category("P1")]
936         [Description("WebView TextZoomFactor.")]
937         [Property("SPEC", "Tizen.NUI.WebView.TextZoomFactor A")]
938         [Property("SPEC_URL", "-")]
939         [Property("CRITERIA", "PRW")]
940         [Property("COVPARAM", "")]
941         [Property("AUTHOR", "guowei.wang@samsung.com")]
942         public void WebViewTextZoomFactor()
943         {
944             tlog.Debug(tag, $"WebViewTextZoomFactor START");
945
946             webView.TextZoomFactor = 0.2f;
947             tlog.Debug(tag, "TextZoomFactor : " + webView.TextZoomFactor);
948
949             tlog.Debug(tag, $"WebViewTextZoomFactor END (OK)");
950         }
951
952         [Test]
953         [Category("P1")]
954         [Description("WebView LoadProgressPercentage.")]
955         [Property("SPEC", "Tizen.NUI.WebView.LoadProgressPercentage A")]
956         [Property("SPEC_URL", "-")]
957         [Property("CRITERIA", "PRO")]
958         [Property("COVPARAM", "")]
959         [Property("AUTHOR", "guowei.wang@samsung.com")]
960         public void WebViewLoadProgressPercentage()
961         {
962             tlog.Debug(tag, $"WebViewLoadProgressPercentage START");
963
964             var result = webView.LoadProgressPercentage;
965             tlog.Debug(tag, "LoadProgressPercentage : " + result);
966
967             tlog.Debug(tag, $"WebViewLoadProgressPercentage END (OK)");
968         }
969
970         [Test]
971         [Category("P1")]
972         [Description("WebView LoadHtmlString.")]
973         [Property("SPEC", "Tizen.NUI.WebView.LoadHtmlString M")]
974         [Property("SPEC_URL", "-")]
975         [Property("CRITERIA", "MR")]
976         [Property("COVPARAM", "")]
977         [Property("AUTHOR", "guowei.wang@samsung.com")]
978         public async Task WebViewLoadHtmlString()
979         {
980             tlog.Debug(tag, $"WebViewLoadHtmlString START");
981
982             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
983             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
984             {
985                 tlog.Info(tag, "onLoadFinished is called!");
986                 tcs.TrySetResult(true);
987             };
988             webView.PageLoadFinished += onLoadFinished;
989
990             webView.LoadHtmlString("<html><head lang=\"en\"></head></html>");
991
992             var result = await tcs.Task;
993             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
994
995             webView.PageLoadFinished -= onLoadFinished;
996
997             tlog.Debug(tag, $"WebViewLoadHtmlString END (OK)");
998         }
999
1000         [Test]
1001         [Category("P1")]
1002         [Description("WebView LoadHTMLString.")]
1003         [Property("SPEC", "Tizen.NUI.WebView.LoadHTMLString M")]
1004         [Property("SPEC_URL", "-")]
1005         [Property("CRITERIA", "MR")]
1006         [Property("COVPARAM", "")]
1007         [Property("AUTHOR", "guowei.wang@samsung.com")]
1008         public async Task WebViewLoadHTMLString()
1009         {
1010             tlog.Debug(tag, $"WebViewLoadHTMLString START");
1011
1012             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1013             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1014             {
1015                 tlog.Info(tag, "onLoadFinished is called!");
1016                 tcs.TrySetResult(true);
1017             };
1018             webView.PageLoadFinished += onLoadFinished;
1019
1020             webView.LoadHTMLString("<html><head lang=\"en\"></head></html>");
1021
1022             var result = await tcs.Task;
1023             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1024
1025             webView.PageLoadFinished -= onLoadFinished;
1026
1027             tlog.Debug(tag, $"WebViewLoadHTMLString END (OK)");
1028         }
1029
1030         [Test]
1031         [Category("P1")]
1032         [Description("WebView LoadContents.")]
1033         [Property("SPEC", "Tizen.NUI.WebView.LoadContents M")]
1034         [Property("SPEC_URL", "-")]
1035         [Property("CRITERIA", "MR")]
1036         [Property("COVPARAM", "")]
1037         [Property("AUTHOR", "guowei.wang@samsung.com")]
1038         public async Task WebViewLoadContents()
1039         {
1040             tlog.Debug(tag, $"WebViewLoadContents START");
1041
1042             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1043             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1044             {
1045                 tlog.Info(tag, "onLoadFinished is called!");
1046                 tcs.TrySetResult(true);
1047             };
1048             webView.PageLoadFinished += onLoadFinished;
1049
1050             webView.LoadContents("body", 18, " ", "gbk", null);
1051
1052             var result = await tcs.Task;
1053             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1054
1055             webView.PageLoadFinished -= onLoadFinished;
1056
1057             tlog.Debug(tag, $"WebViewLoadContents END (OK)");
1058         }
1059
1060         [Test]
1061         [Category("P1")]
1062         [Description("WebView Reload.")]
1063         [Property("SPEC", "Tizen.NUI.WebView.Reload M")]
1064         [Property("SPEC_URL", "-")]
1065         [Property("CRITERIA", "MR")]
1066         [Property("COVPARAM", "")]
1067         [Property("AUTHOR", "guowei.wang@samsung.com")]
1068         public async Task WebViewReload()
1069         {
1070             tlog.Debug(tag, $"WebViewReload START");
1071
1072             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1073             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1074             {
1075                 tlog.Info(tag, "onLoadFinished is called!");
1076                 webView.Reload();
1077                 tcs.TrySetResult(true);
1078             };
1079             webView.PageLoadFinished += onLoadFinished;
1080
1081             webView.LoadUrl(url);
1082
1083             var result = await tcs.Task;
1084             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1085
1086             webView.PageLoadFinished -= onLoadFinished;
1087
1088             tlog.Debug(tag, $"WebViewReload END (OK)");
1089         }
1090
1091         [Test]
1092         [Category("P1")]
1093         [Description("WebView ReloadWithoutCache.")]
1094         [Property("SPEC", "Tizen.NUI.WebView.ReloadWithoutCache M")]
1095         [Property("SPEC_URL", "-")]
1096         [Property("CRITERIA", "MR")]
1097         [Property("COVPARAM", "")]
1098         [Property("AUTHOR", "guowei.wang@samsung.com")]
1099         public async Task WebViewReloadWithoutCache()
1100         {
1101             tlog.Debug(tag, $"WebViewReloadWithoutCache START");
1102
1103             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1104             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1105             {
1106                 tlog.Info(tag, "onLoadFinished is called!");
1107                 webView.ReloadWithoutCache();
1108                 tcs.TrySetResult(true);
1109             };
1110             webView.PageLoadFinished += onLoadFinished;
1111
1112             webView.LoadUrl(url);
1113
1114             var result = await tcs.Task;
1115             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1116
1117             webView.PageLoadFinished -= onLoadFinished;
1118
1119             tlog.Debug(tag, $"WebViewReloadWithoutCache END (OK)");
1120         }
1121
1122         [Test]
1123         [Category("P1")]
1124         [Description("WebView StopLoading.")]
1125         [Property("SPEC", "Tizen.NUI.WebView.StopLoading M")]
1126         [Property("SPEC_URL", "-")]
1127         [Property("CRITERIA", "MR")]
1128         [Property("COVPARAM", "")]
1129         [Property("AUTHOR", "guowei.wang@samsung.com")]
1130         public async Task WebViewStopLoading()
1131         {
1132             tlog.Debug(tag, $"WebViewStopLoading START");
1133
1134             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1135             EventHandler<WebViewPageLoadEventArgs> onLoadStarted = (s, e) =>
1136             {
1137                 tlog.Info(tag, "onLoadFinished is called!");
1138                 webView.StopLoading();
1139                 tcs.TrySetResult(true);
1140             };
1141             webView.PageLoadStarted += onLoadStarted;
1142
1143             webView.LoadUrl(url);
1144
1145             var result = await tcs.Task;
1146             Assert.IsTrue(result, "PageLoadStarted event should be invoked");
1147
1148             webView.PageLoadStarted -= onLoadStarted;
1149
1150             tlog.Debug(tag, $"WebViewStopLoading END (OK)");
1151         }
1152
1153         [Test]
1154         [Category("P1")]
1155         [Description("WebView Suspend.")]
1156         [Property("SPEC", "Tizen.NUI.WebView.Suspend M")]
1157         [Property("SPEC_URL", "-")]
1158         [Property("CRITERIA", "MR")]
1159         [Property("COVPARAM", "")]
1160         [Property("AUTHOR", "guowei.wang@samsung.com")]
1161         public async Task WebViewSuspend()
1162         {
1163             tlog.Debug(tag, $"WebViewSuspend START");
1164
1165             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1166             EventHandler<WebViewPageLoadEventArgs> onLoadStarted = (s, e) =>
1167             {
1168                 tlog.Info(tag, "onLoadStarted is called!");
1169                 webView.Suspend();
1170             };
1171             webView.PageLoadStarted += onLoadStarted;
1172
1173             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1174             {
1175                 tlog.Info(tag, "onLoadFinished is called!");
1176                 webView.Resume();
1177                 tcs.TrySetResult(true);
1178             };
1179             webView.PageLoadFinished += onLoadFinished;
1180
1181             webView.LoadUrl(url);
1182
1183             var result = await tcs.Task;
1184             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1185
1186             webView.PageLoadStarted -= onLoadStarted;
1187             webView.PageLoadFinished -= onLoadFinished;
1188
1189             tlog.Debug(tag, $"WebViewSuspend END (OK)");
1190         }
1191
1192         [Test]
1193         [Category("P1")]
1194         [Description("WebView SuspendNetworkLoading.")]
1195         [Property("SPEC", "Tizen.NUI.WebView.SuspendNetworkLoading M")]
1196         [Property("SPEC_URL", "-")]
1197         [Property("CRITERIA", "MR")]
1198         [Property("COVPARAM", "")]
1199         [Property("AUTHOR", "guowei.wang@samsung.com")]
1200         public async Task WebViewSuspendNetworkLoading()
1201         {
1202             tlog.Debug(tag, $"WebViewSuspendNetworkLoading START");
1203
1204             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1205             EventHandler<WebViewPageLoadEventArgs> onLoadStarted = (s, e) =>
1206             {
1207                 tlog.Info(tag, "onLoadStarted is called!");
1208                 webView.SuspendNetworkLoading();
1209             };
1210             webView.PageLoadStarted += onLoadStarted;
1211
1212             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1213             {
1214                 tlog.Info(tag, "onLoadFinished is called!");
1215                 webView.ResumeNetworkLoading();
1216                 tcs.TrySetResult(true);
1217             };
1218             webView.PageLoadFinished += onLoadFinished;
1219
1220             webView.LoadUrl(url);
1221
1222             var result = await tcs.Task;
1223             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1224
1225             webView.PageLoadStarted -= onLoadStarted;
1226             webView.PageLoadFinished -= onLoadFinished;
1227
1228             tlog.Debug(tag, $"WebViewSuspendNetworkLoading END (OK)");
1229         }
1230
1231         [Test]
1232         [Category("P1")]
1233         [Description("WebView AddCustomHeader.")]
1234         [Property("SPEC", "Tizen.NUI.WebView.AddCustomHeader M")]
1235         [Property("SPEC_URL", "-")]
1236         [Property("CRITERIA", "MR")]
1237         [Property("COVPARAM", "")]
1238         [Property("AUTHOR", "guowei.wang@samsung.com")]
1239         public void WebViewAddCustomHeader()
1240         {
1241             tlog.Debug(tag, $"WebViewAddCustomHeader START");
1242
1243             var result = webView.AddCustomHeader("customHeader_title", "font-size: 32rpx");
1244             tlog.Debug(tag, "AddCustomHeader : " + result);
1245
1246             result = webView.RemoveCustomHeader("customHeader_title");
1247             tlog.Debug(tag, "RemoveCustomHeader : " + result);
1248
1249             tlog.Debug(tag, $"WebViewAddCustomHeader END (OK)");
1250         }
1251
1252         [Test]
1253         [Category("P1")]
1254         [Description("WebView ScrollBy.")]
1255         [Property("SPEC", "Tizen.NUI.WebView.ScrollBy M")]
1256         [Property("SPEC_URL", "-")]
1257         [Property("CRITERIA", "MR")]
1258         [Property("COVPARAM", "")]
1259         [Property("AUTHOR", "guowei.wang@samsung.com")]
1260         public async Task WebViewScrollBy()
1261         {
1262             tlog.Debug(tag, $"WebViewScrollBy START");
1263
1264             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1265             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1266             {
1267                 tlog.Info(tag, "onLoadFinished is called!");
1268                 webView.ScrollBy(0, 60);
1269                 tcs.TrySetResult(true);
1270             };
1271             webView.PageLoadFinished += onLoadFinished;
1272
1273             webView.LoadUrl(url);
1274             var result = await tcs.Task;
1275             Assert.IsTrue(result, "ScrollEdgeReached event should be invoked");
1276
1277             webView.PageLoadFinished -= onLoadFinished;
1278
1279             tlog.Debug(tag, $"WebViewScrollBy END (OK)");
1280         }
1281
1282         [Test]
1283         [Category("P1")]
1284         [Description("WebView ScrollEdgeBy.")]
1285         [Property("SPEC", "Tizen.NUI.WebView.ScrollEdgeBy M")]
1286         [Property("SPEC_URL", "-")]
1287         [Property("CRITERIA", "MR")]
1288         [Property("COVPARAM", "")]
1289         [Property("AUTHOR", "guowei.wang@samsung.com")]
1290         public async Task WebViewScrollEdgeBy()
1291         {
1292             tlog.Debug(tag, $"WebViewScrollEdgeBy START");
1293
1294             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1295             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1296             {
1297                 tlog.Info(tag, "onLoadFinished is called!");
1298                 webView.ScrollEdgeBy(0, 60);
1299                 tcs.TrySetResult(true);
1300             };
1301             webView.PageLoadFinished += onLoadFinished;
1302
1303             webView.LoadUrl(url);
1304             var result = await tcs.Task;
1305             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1306
1307             webView.PageLoadFinished -= onLoadFinished;
1308
1309             tlog.Debug(tag, $"WebViewScrollEdgeBy END (OK)");
1310         }
1311
1312         [Test]
1313         [Category("P1")]
1314         [Description("WebView GoBack.")]
1315         [Property("SPEC", "Tizen.NUI.WebView.GoBack M")]
1316         [Property("SPEC_URL", "-")]
1317         [Property("CRITERIA", "MR")]
1318         [Property("COVPARAM", "")]
1319         [Property("AUTHOR", "guowei.wang@samsung.com")]
1320         public async Task WebViewGoBack()
1321         {
1322             tlog.Debug(tag, $"WebViewGoBack START");
1323
1324             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1325             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1326             {
1327                 if (webView.Url.Contains("index.html"))
1328                 {
1329                     tlog.Info(tag, "onLoadFinished is called!");
1330                     webView.LoadUrl(secondUrl);
1331                 }
1332                 else
1333                 {
1334                     tlog.Info(tag, "onLoadFinished is called!");
1335                     webView.GoBack();
1336                     tcs.TrySetResult(true);
1337                 }
1338             };
1339             webView.PageLoadFinished += onLoadFinished;
1340
1341             webView.LoadUrl(url);
1342             var result = await tcs.Task;
1343             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1344
1345             webView.PageLoadFinished -= onLoadFinished;
1346
1347             tlog.Debug(tag, $"WebViewGoBack END (OK)");
1348         }
1349
1350         [Test]
1351         [Category("P1")]
1352         [Description("WebView GoForward.")]
1353         [Property("SPEC", "Tizen.NUI.WebView.GoForward M")]
1354         [Property("SPEC_URL", "-")]
1355         [Property("CRITERIA", "MR")]
1356         [Property("COVPARAM", "")]
1357         [Property("AUTHOR", "guowei.wang@samsung.com")]
1358         public async Task WebViewGoForward()
1359         {
1360             tlog.Debug(tag, $"WebViewGoForward START");
1361
1362             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1363             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1364             {
1365                 if (webView.Url.Contains("index.html"))
1366                 {
1367                     tlog.Info(tag, "onLoadFinished is called!");
1368                     webView.LoadUrl(secondUrl);
1369                 }
1370                 else
1371                 {
1372                     tlog.Info(tag, "onLoadFinished is called!");
1373                     webView.GoBack();
1374                     webView.GoForward();
1375                     tcs.TrySetResult(true);
1376                 }
1377             };
1378             webView.PageLoadFinished += onLoadFinished;
1379
1380             webView.LoadUrl(url);
1381             var result = await tcs.Task;
1382             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1383
1384             webView.PageLoadFinished -= onLoadFinished;
1385
1386             tlog.Debug(tag, $"WebViewGoForward END (OK)");
1387         }
1388
1389         [Test]
1390         [Category("P1")]
1391         [Description("WebView CanGoBack.")]
1392         [Property("SPEC", "Tizen.NUI.WebView.CanGoBack M")]
1393         [Property("SPEC_URL", "-")]
1394         [Property("CRITERIA", "MR")]
1395         [Property("COVPARAM", "")]
1396         [Property("AUTHOR", "guowei.wang@samsung.com")]
1397         public async Task WebViewCanGoBack()
1398         {
1399             tlog.Debug(tag, $"WebViewCanGoBack START");
1400
1401             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1402             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1403             {
1404                 if (webView.Url.Contains("index.html"))
1405                 {
1406                     tlog.Info(tag, "onLoadFinished is called!");
1407                     webView.LoadUrl(secondUrl);
1408                 }
1409                 else
1410                 {
1411                     tlog.Info(tag, "onLoadFinished is called!");
1412                     var canGo = webView.CanGoBack();
1413                     tcs.TrySetResult(canGo);
1414                 }
1415             };
1416             webView.PageLoadFinished += onLoadFinished;
1417
1418             webView.LoadUrl(url);
1419             var result = await tcs.Task;
1420             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1421
1422             webView.PageLoadFinished -= onLoadFinished;
1423
1424             tlog.Debug(tag, $"WebViewCanGoBack END (OK)");
1425         }
1426
1427         [Test]
1428         [Category("P1")]
1429         [Description("WebView CanGoForward.")]
1430         [Property("SPEC", "Tizen.NUI.WebView.CanGoForward M")]
1431         [Property("SPEC_URL", "-")]
1432         [Property("CRITERIA", "MR")]
1433         [Property("COVPARAM", "")]
1434         [Property("AUTHOR", "guowei.wang@samsung.com")]
1435         public async Task WebViewCanGoForward()
1436         {
1437             tlog.Debug(tag, $"WebViewCanGoForward START");
1438
1439             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1440             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1441             {
1442                 if (webView.Url.Contains("index.html"))
1443                 {
1444                     tlog.Info(tag, "onLoadFinished is called!");
1445                     webView.LoadUrl(secondUrl);
1446                 }
1447                 else
1448                 {
1449                     tlog.Info(tag, "onLoadFinished is called!");
1450                     webView.GoBack();
1451                     var canGo = webView.CanGoForward();
1452                     tcs.TrySetResult(true);
1453                 }
1454             };
1455             webView.PageLoadFinished += onLoadFinished;
1456
1457             webView.LoadUrl(url);
1458             var result = await tcs.Task;
1459             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1460
1461             webView.PageLoadFinished -= onLoadFinished;
1462
1463             tlog.Debug(tag, $"WebViewCanGoForward END (OK)");
1464         }
1465
1466         [Test]
1467         [Category("P1")]
1468         [Description("WebView EvaluateJavaScript.")]
1469         [Property("SPEC", "Tizen.NUI.WebView.EvaluateJavaScript M")]
1470         [Property("SPEC_URL", "-")]
1471         [Property("CRITERIA", "MR")]
1472         [Property("COVPARAM", "")]
1473         [Property("AUTHOR", "guowei.wang@samsung.com")]
1474         public async Task WebViewEvaluateJavaScript()
1475         {
1476             tlog.Debug(tag, $"WebViewEvaluateJavaScript START");
1477
1478             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1479             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1480             {
1481                 tlog.Info(tag, "onLoadFinished is called!");
1482                 webView.EvaluateJavaScript("<script type=\"text / javascript\">document.write(\"page\");</script>");
1483                 tcs.TrySetResult(true);
1484             };
1485             webView.PageLoadFinished += onLoadFinished;
1486
1487             webView.LoadUrl(url);
1488             var result = await tcs.Task;
1489             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1490
1491             webView.PageLoadFinished -= onLoadFinished;
1492
1493             tlog.Debug(tag, $"WebViewEvaluateJavaScript END (OK)");
1494         }
1495
1496         [Test]
1497         [Category("P1")]
1498         [Description("WebView AddJavaScriptMessageHandler.")]
1499         [Property("SPEC", "Tizen.NUI.WebView.AddJavaScriptMessageHandler M")]
1500         [Property("SPEC_URL", "-")]
1501         [Property("CRITERIA", "MR")]
1502         [Property("COVPARAM", "")]
1503         [Property("AUTHOR", "guowei.wang@samsung.com")]
1504         public async Task WebViewAddJavaScriptMessageHandler()
1505         {
1506             tlog.Debug(tag, $"WebViewAddJavaScriptMessageHandler START");
1507
1508             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1509             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1510             {
1511                 tlog.Info(tag, "onLoadFinished is called!");
1512                 webView.AddJavaScriptMessageHandler("AllowOrigin", JsCallback);
1513                 tcs.TrySetResult(true);
1514             };
1515             webView.PageLoadFinished += onLoadFinished;
1516
1517             webView.LoadUrl(url);
1518             var result = await tcs.Task;
1519             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1520
1521             webView.PageLoadFinished -= onLoadFinished;
1522
1523             tlog.Debug(tag, $"WebViewAddJavaScriptMessageHandler END (OK)");
1524         }
1525
1526         [Test]
1527         [Category("P1")]
1528         [Description("WebView RegisterJavaScriptAlertCallback.")]
1529         [Property("SPEC", "Tizen.NUI.WebView.RegisterJavaScriptAlertCallback M")]
1530         [Property("SPEC_URL", "-")]
1531         [Property("CRITERIA", "MR")]
1532         [Property("COVPARAM", "")]
1533         [Property("AUTHOR", "guowei.wang@samsung.com")]
1534         public async Task WebViewRegisterJavaScriptAlertCallback()
1535         {
1536             tlog.Debug(tag, $"WebViewRegisterJavaScriptAlertCallback START");
1537
1538             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1539             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1540             {
1541                 tlog.Info(tag, "onLoadFinished is called!");
1542                 tcs.TrySetResult(true);
1543             };
1544             webView.PageLoadFinished += onLoadFinished;
1545
1546             webView.RegisterJavaScriptAlertCallback(JsCallback);
1547
1548             webView.LoadUrl(url);
1549             var result = await tcs.Task;
1550             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1551
1552             webView.PageLoadFinished -= onLoadFinished;
1553
1554             tlog.Debug(tag, $"WebViewRegisterJavaScriptAlertCallback END (OK)");
1555         }
1556
1557         [Test]
1558         [Category("P1")]
1559         [Description("WebView RegisterJavaScriptConfirmCallback.")]
1560         [Property("SPEC", "Tizen.NUI.WebView.RegisterJavaScriptConfirmCallback M")]
1561         [Property("SPEC_URL", "-")]
1562         [Property("CRITERIA", "MR")]
1563         [Property("COVPARAM", "")]
1564         [Property("AUTHOR", "guowei.wang@samsung.com")]
1565         public async Task WebViewRegisterJavaScriptConfirmCallback()
1566         {
1567             tlog.Debug(tag, $"WebViewRegisterJavaScriptConfirmCallback START");
1568
1569             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1570             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1571             {
1572                 tlog.Info(tag, "onLoadFinished is called!");
1573                 tcs.TrySetResult(true);
1574             };
1575             webView.PageLoadFinished += onLoadFinished;
1576
1577             webView.RegisterJavaScriptConfirmCallback(JsCallback);
1578
1579             webView.LoadUrl(url);
1580             var result = await tcs.Task;
1581             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1582
1583             webView.PageLoadFinished -= onLoadFinished;
1584
1585             tlog.Debug(tag, $"WebViewRegisterJavaScriptConfirmCallback END (OK)");
1586         }
1587
1588         [Test]
1589         [Category("P1")]
1590         [Description("WebView RegisterJavaScriptPromptCallback.")]
1591         [Property("SPEC", "Tizen.NUI.WebView.RegisterJavaScriptPromptCallback M")]
1592         [Property("SPEC_URL", "-")]
1593         [Property("CRITERIA", "MR")]
1594         [Property("COVPARAM", "")]
1595         [Property("AUTHOR", "guowei.wang@samsung.com")]
1596         public async Task WebViewRegisterJavaScriptPromptCallback()
1597         {
1598             tlog.Debug(tag, $"WebViewRegisterJavaScriptPromptCallback START");
1599
1600             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1601             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1602             {
1603                 tlog.Info(tag, "onLoadFinished is called!");
1604                 tcs.TrySetResult(true);
1605             };
1606             webView.PageLoadFinished += onLoadFinished;
1607
1608             webView.RegisterJavaScriptPromptCallback(PromptCallback);
1609
1610             webView.LoadUrl(url);
1611             var result = await tcs.Task;
1612             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1613
1614             webView.PageLoadFinished -= onLoadFinished;
1615
1616             tlog.Debug(tag, $"WebViewRegisterJavaScriptPromptCallback END (OK)");
1617         }
1618
1619         [Test]
1620         [Category("P1")]
1621         [Description("WebView ClearAllTilesResources.")]
1622         [Property("SPEC", "Tizen.NUI.WebView.ClearAllTilesResources M")]
1623         [Property("SPEC_URL", "-")]
1624         [Property("CRITERIA", "MR")]
1625         [Property("COVPARAM", "")]
1626         [Property("AUTHOR", "guowei.wang@samsung.com")]
1627         public async Task WebViewClearAllTilesResources()
1628         {
1629             tlog.Debug(tag, $"WebViewClearAllTilesResources START");
1630
1631             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1632             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1633             {
1634                 tlog.Info(tag, "onLoadFinished is called!");
1635                 webView.ClearAllTilesResources();
1636                 tcs.TrySetResult(true);
1637             };
1638             webView.PageLoadFinished += onLoadFinished;
1639
1640             webView.LoadUrl(url);
1641             var result = await tcs.Task;
1642             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1643
1644             webView.PageLoadFinished -= onLoadFinished;
1645
1646             tlog.Debug(tag, $"WebViewClearAllTilesResources END (OK)");
1647         }
1648
1649         [Test]
1650         [Category("P1")]
1651         [Description("WebView ClearHistory.")]
1652         [Property("SPEC", "Tizen.NUI.WebView.ClearHistory M")]
1653         [Property("SPEC_URL", "-")]
1654         [Property("CRITERIA", "MR")]
1655         [Property("COVPARAM", "")]
1656         [Property("AUTHOR", "guowei.wang@samsung.com")]
1657         public async Task WebViewClearHistory()
1658         {
1659             tlog.Debug(tag, $"WebViewClearHistory START");
1660
1661             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1662             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1663             {
1664                 tlog.Info(tag, "onLoadFinished is called!");
1665                 webView.ClearHistory();
1666                 tcs.TrySetResult(true);
1667             };
1668             webView.PageLoadFinished += onLoadFinished;
1669
1670             webView.LoadUrl(url);
1671             var result = await tcs.Task;
1672             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1673
1674             webView.PageLoadFinished -= onLoadFinished;
1675
1676             tlog.Debug(tag, $"WebViewClearHistory END (OK)");
1677         }
1678
1679         [Test]
1680         [Category("P1")]
1681         [Description("WebView SetScaleFactor.")]
1682         [Property("SPEC", "Tizen.NUI.WebView.SetScaleFactor M")]
1683         [Property("SPEC_URL", "-")]
1684         [Property("CRITERIA", "MR")]
1685         [Property("COVPARAM", "")]
1686         [Property("AUTHOR", "guowei.wang@samsung.com")]
1687         public async Task WebViewSetScaleFactor()
1688         {
1689             tlog.Debug(tag, $"WebViewSetScaleFactor START");
1690
1691             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1692             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1693             {
1694                 tlog.Info(tag, "onLoadFinished is called!");
1695                 using (Vector2 point = new Vector2(1.0f, 1.0f))
1696                 {
1697                     webView.SetScaleFactor(0.2f, point);
1698
1699                     var factor = webView.GetScaleFactor();
1700                     tlog.Debug(tag, "ScaleFactor : " + factor);
1701                 }
1702                 tcs.TrySetResult(true);
1703             };
1704             webView.PageLoadFinished += onLoadFinished;
1705
1706             webView.LoadUrl(url);
1707             var result = await tcs.Task;
1708             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1709
1710             webView.PageLoadFinished -= onLoadFinished;
1711
1712             tlog.Debug(tag, $"WebViewSetScaleFactor END (OK)");
1713         }
1714
1715         [Test]
1716         [Category("P1")]
1717         [Description("WebView ActivateAccessibility.")]
1718         [Property("SPEC", "Tizen.NUI.WebView.ActivateAccessibility M")]
1719         [Property("SPEC_URL", "-")]
1720         [Property("CRITERIA", "MR")]
1721         [Property("COVPARAM", "")]
1722         [Property("AUTHOR", "guowei.wang@samsung.com")]
1723         public async Task WebViewActivateAccessibility()
1724         {
1725             tlog.Debug(tag, $"WebViewActivateAccessibility START");
1726
1727             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1728             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1729             {
1730                 tlog.Info(tag, "onLoadFinished is called!");
1731                 webView.ActivateAccessibility(false);
1732                 tcs.TrySetResult(true);
1733             };
1734             webView.PageLoadFinished += onLoadFinished;
1735
1736             webView.LoadUrl(url);
1737             var result = await tcs.Task;
1738             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1739
1740             webView.PageLoadFinished -= onLoadFinished;
1741
1742             tlog.Debug(tag, $"WebViewActivateAccessibility END (OK)");
1743         }
1744
1745         [Test]
1746         [Category("P1")]
1747         [Description("WebView HighlightText.")]
1748         [Property("SPEC", "Tizen.NUI.WebView.HighlightText M")]
1749         [Property("SPEC_URL", "-")]
1750         [Property("CRITERIA", "MR")]
1751         [Property("COVPARAM", "")]
1752         [Property("AUTHOR", "guowei.wang@samsung.com")]
1753         public async Task WebViewHighlightText()
1754         {
1755             tlog.Debug(tag, $"WebViewHighlightText START");
1756
1757             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1758             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1759             {
1760                 tlog.Info(tag, "onLoadFinished is called!");
1761                 webView.HighlightText("web", BaseComponents.WebView.FindOption.AtWordStart, 3);
1762                 tcs.TrySetResult(true);
1763             };
1764             webView.PageLoadFinished += onLoadFinished;
1765
1766             webView.LoadUrl(url);
1767             var result = await tcs.Task;
1768             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1769
1770             webView.PageLoadFinished -= onLoadFinished;
1771
1772             tlog.Debug(tag, $"WebViewHighlightText END (OK)");
1773         }
1774
1775         [Test]
1776         [Category("P1")]
1777         [Description("WebView AddDynamicCertificatePath.")]
1778         [Property("SPEC", "Tizen.NUI.WebView.AddDynamicCertificatePath M")]
1779         [Property("SPEC_URL", "-")]
1780         [Property("CRITERIA", "MR")]
1781         [Property("COVPARAM", "")]
1782         [Property("AUTHOR", "guowei.wang@samsung.com")]
1783         public async Task WebViewAddDynamicCertificatePath()
1784         {
1785             tlog.Debug(tag, $"WebViewAddDynamicCertificatePath START");
1786
1787             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1788             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1789             {
1790                 tlog.Info(tag, "onLoadFinished is called!");
1791                 webView.AddDynamicCertificatePath("127.0.0.0", "/");
1792                 tcs.TrySetResult(true);
1793             };
1794             webView.PageLoadFinished += onLoadFinished;
1795
1796             webView.LoadUrl(url);
1797             var result = await tcs.Task;
1798             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1799
1800             webView.PageLoadFinished -= onLoadFinished;
1801
1802             tlog.Debug(tag, $"WebViewAddDynamicCertificatePath END (OK)");
1803         }
1804
1805         [Test]
1806         [Category("P1")]
1807         [Description("WebView CheckVideoPlayingAsynchronously.")]
1808         [Property("SPEC", "Tizen.NUI.WebView.CheckVideoPlayingAsynchronously M")]
1809         [Property("SPEC_URL", "-")]
1810         [Property("CRITERIA", "MR")]
1811         [Property("COVPARAM", "")]
1812         [Property("AUTHOR", "guowei.wang@samsung.com")]
1813         public async Task WebViewCheckVideoPlayingAsynchronously()
1814         {
1815             tlog.Debug(tag, $"WebViewCheckVideoPlayingAsynchronously START");
1816
1817             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1818             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1819             {
1820                 tlog.Info(tag, "onLoadFinished is called!");
1821                 webView.CheckVideoPlayingAsynchronously(VideoCallback);
1822                 tcs.TrySetResult(true);
1823             };
1824             webView.PageLoadFinished += onLoadFinished;
1825
1826             webView.LoadUrl(url);
1827             var result = await tcs.Task;
1828             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1829
1830             webView.PageLoadFinished -= onLoadFinished;
1831
1832             tlog.Debug(tag, $"WebViewCheckVideoPlayingAsynchronously END (OK)");
1833         }
1834
1835         [Test]
1836         [Category("P1")]
1837         [Description("WebView RegisterGeolocationPermissionCallback.")]
1838         [Property("SPEC", "Tizen.NUI.WebView.RegisterGeolocationPermissionCallback M")]
1839         [Property("SPEC_URL", "-")]
1840         [Property("CRITERIA", "MR")]
1841         [Property("COVPARAM", "")]
1842         [Property("AUTHOR", "guowei.wang@samsung.com")]
1843         public async Task WebViewRegisterGeolocationPermissionCallback()
1844         {
1845             tlog.Debug(tag, $"WebViewRegisterGeolocationPermissionCallback START");
1846
1847             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1848             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1849             {
1850                 tlog.Info(tag, "onLoadFinished is called!");
1851                 tcs.TrySetResult(true);
1852             };
1853             webView.PageLoadFinished += onLoadFinished;
1854
1855             webView.RegisterGeolocationPermissionCallback(GeolocationCallback);
1856
1857             webView.LoadUrl(url);
1858             var result = await tcs.Task;
1859             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1860
1861             webView.PageLoadFinished -= onLoadFinished;
1862
1863             tlog.Debug(tag, $"WebViewRegisterGeolocationPermissionCallback END (OK)");
1864         }
1865
1866         [Test]
1867         [Category("P1")]
1868         [Description("WebView GetPlainTextAsynchronously.")]
1869         [Property("SPEC", "Tizen.NUI.WebView.GetPlainTextAsynchronously M")]
1870         [Property("SPEC_URL", "-")]
1871         [Property("CRITERIA", "MR")]
1872         [Property("COVPARAM", "")]
1873         [Property("AUTHOR", "guowei.wang@samsung.com")]
1874         public async Task WebViewGetPlainTextAsynchronously()
1875         {
1876             tlog.Debug(tag, $"WebViewGetPlainTextAsynchronously START");
1877
1878             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1879             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1880             {
1881                 tlog.Info(tag, "onLoadFinished is called!");
1882                 webView.GetPlainTextAsynchronously(PlainReceivedCallback);
1883                 tcs.TrySetResult(true);
1884             };
1885             webView.PageLoadFinished += onLoadFinished;
1886
1887             webView.LoadUrl(url);
1888             var result = await tcs.Task;
1889             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1890
1891             webView.PageLoadFinished -= onLoadFinished;
1892
1893             tlog.Debug(tag, $"WebViewGetPlainTextAsynchronously END (OK)");
1894         }
1895
1896         [Test]
1897         [Category("P1")]
1898         [Description("WebView SetTtsFocus.")]
1899         [Property("SPEC", "Tizen.NUI.WebView.SetTtsFocus M")]
1900         [Property("SPEC_URL", "-")]
1901         [Property("CRITERIA", "MR")]
1902         [Property("COVPARAM", "")]
1903         [Property("AUTHOR", "guowei.wang@samsung.com")]
1904         public async Task WebViewSetTtsFocus()
1905         {
1906             tlog.Debug(tag, $"WebViewSetTtsFocus START");
1907
1908             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1909             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1910             {
1911                 tlog.Info(tag, "onLoadFinished is called!");
1912                 webView.SetTtsFocus(false);
1913                 tcs.TrySetResult(true);
1914             };
1915             webView.PageLoadFinished += onLoadFinished;
1916
1917             webView.LoadUrl(url);
1918             var result = await tcs.Task;
1919             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1920
1921             webView.PageLoadFinished -= onLoadFinished;
1922
1923             tlog.Debug(tag, $"WebViewSetTtsFocus END (OK)");
1924         }
1925
1926         [Test]
1927         [Category("P1")]
1928         [Description("WebView GetScreenshot.")]
1929         [Property("SPEC", "Tizen.NUI.WebView.GetScreenshot M")]
1930         [Property("SPEC_URL", "-")]
1931         [Property("CRITERIA", "MR")]
1932         [Property("COVPARAM", "")]
1933         [Property("AUTHOR", "guowei.wang@samsung.com")]
1934         public async Task WebViewGetScreenshot()
1935         {
1936             tlog.Debug(tag, $"WebViewGetScreenshot START");
1937
1938             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1939             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1940             {
1941                 tlog.Info(tag, "onLoadFinished is called!");
1942                 var factor = webView.GetScaleFactor();
1943                 webView.GetScreenshot(new Rectangle(5, 6, 100, 200), factor);
1944                 tcs.TrySetResult(true);
1945             };
1946             webView.PageLoadFinished += onLoadFinished;
1947
1948             webView.LoadUrl(url);
1949             var result = await tcs.Task;
1950             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1951
1952             webView.PageLoadFinished -= onLoadFinished;
1953
1954             tlog.Debug(tag, $"WebViewGetScreenshot END (OK)");
1955         }
1956
1957         [Test]
1958         [Category("P1")]
1959         [Description("WebView GetScreenshotAsynchronously.")]
1960         [Property("SPEC", "Tizen.NUI.WebView.GetScreenshotAsynchronously M")]
1961         [Property("SPEC_URL", "-")]
1962         [Property("CRITERIA", "MR")]
1963         [Property("COVPARAM", "")]
1964         [Property("AUTHOR", "guowei.wang@samsung.com")]
1965         public async Task WebViewGetScreenshotAsynchronously()
1966         {
1967             tlog.Debug(tag, $"WebViewGetScreenshotAsynchronously START");
1968
1969             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1970             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1971             {
1972                 tlog.Info(tag, "onLoadFinished is called!");
1973                 var factor = webView.GetScaleFactor();
1974                 webView.GetScreenshotAsynchronously(new Rectangle(5, 6, 50, 50), factor, ScreenshotAcquiredCallbackCase);
1975                 tcs.TrySetResult(true);
1976             };
1977             webView.PageLoadFinished += onLoadFinished;
1978
1979             webView.LoadUrl(url);
1980             var result = await tcs.Task;
1981             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1982
1983             webView.PageLoadFinished -= onLoadFinished;
1984
1985             tlog.Debug(tag, $"WebViewGetScreenshotAsynchronously END (OK)");
1986         }
1987
1988         [Test]
1989         [Category("P1")]
1990         [Description("WebView EvaluateJavaScript.")]
1991         [Property("SPEC", "Tizen.NUI.WebView.EvaluateJavaScript M")]
1992         [Property("SPEC_URL", "-")]
1993         [Property("CRITERIA", "MR")]
1994         [Property("COVPARAM", "")]
1995         [Property("AUTHOR", "guowei.wang@samsung.com")]
1996         public async Task WebViewEvaluateJavaScriptWithCallback()
1997         {
1998             tlog.Debug(tag, $"WebViewEvaluateJavaScriptWithCallback START");
1999
2000             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
2001             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
2002             {
2003                 tlog.Info(tag, "onLoadFinished is called!");
2004                 webView.EvaluateJavaScript("<script type=\"text / javascript\">document.write(\"page\");</script>", JsCallback);
2005                 tcs.TrySetResult(true);
2006             };
2007             webView.PageLoadFinished += onLoadFinished;
2008
2009             webView.LoadUrl(url);
2010             var result = await tcs.Task;
2011             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
2012
2013             webView.PageLoadFinished -= onLoadFinished;
2014
2015             tlog.Debug(tag, $"WebViewEvaluateJavaScriptWithCallback END (OK)");
2016         }
2017
2018         [Test]
2019         [Category("P1")]
2020         [Description("WebView ClearCache.")]
2021         [Property("SPEC", "Tizen.NUI.WebView.ClearCache M")]
2022         [Property("SPEC_URL", "-")]
2023         [Property("CRITERIA", "MR")]
2024         [Property("COVPARAM", "")]
2025         [Property("AUTHOR", "guowei.wang@samsung.com")]
2026         public async Task WebViewClearCache()
2027         {
2028             tlog.Debug(tag, $"WebViewClearCache START");
2029
2030             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
2031             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
2032             {
2033                 tlog.Info(tag, "onLoadFinished is called!");
2034                 webView.ClearCache();
2035                 tcs.TrySetResult(true);
2036             };
2037             webView.PageLoadFinished += onLoadFinished;
2038
2039             webView.LoadUrl(url);
2040             var result = await tcs.Task;
2041             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
2042
2043             webView.PageLoadFinished -= onLoadFinished;
2044
2045             tlog.Debug(tag, $"WebViewClearCache END (OK)");
2046         }
2047
2048         [Test]
2049         [Category("P1")]
2050         [Description("WebView ClearCookies.")]
2051         [Property("SPEC", "Tizen.NUI.WebView.ClearCookies M")]
2052         [Property("SPEC_URL", "-")]
2053         [Property("CRITERIA", "MR")]
2054         [Property("COVPARAM", "")]
2055         [Property("AUTHOR", "guowei.wang@samsung.com")]
2056         public async Task WebViewClearCookies()
2057         {
2058             tlog.Debug(tag, $"WebViewClearCookies START");
2059
2060             TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
2061             EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
2062             {
2063                 tlog.Info(tag, "onLoadFinished is called!");
2064                 webView.ClearCookies();
2065                 tcs.TrySetResult(true);
2066             };
2067             webView.PageLoadFinished += onLoadFinished;
2068
2069             webView.LoadUrl(url);
2070             var result = await tcs.Task;
2071             Assert.IsTrue(result, "PageLoadFinished event should be invoked");
2072
2073             webView.PageLoadFinished -= onLoadFinished;
2074
2075             tlog.Debug(tag, $"WebViewClearCookies END (OK)");
2076         }
2077
2078         [Test]
2079         [Category("P1")]
2080         [Description("WebView DownCast.")]
2081         [Property("SPEC", "Tizen.NUI.WebView.DownCast M")]
2082         [Property("SPEC_URL", "-")]
2083         [Property("CRITERIA", "MR")]
2084         [Property("COVPARAM", "")]
2085         [Property("AUTHOR", "guowei.wang@samsung.com")]
2086         public void WebViewDownCast()
2087         {
2088             tlog.Debug(tag, $"WebViewDownCast START");
2089
2090             try
2091             {
2092                 BaseComponents.WebView.DownCast(webView);
2093             }
2094             catch (Exception e)
2095             {
2096                 tlog.Debug(tag, e.Message.ToString());
2097                 Assert.Fail("Caught Exception : Failed!");
2098             }
2099
2100             tlog.Debug(tag, $"WebViewDownCast END (OK)");
2101         }
2102
2103         [Test]
2104         [Category("P1")]
2105         [Description("WebView Assign.")]
2106         [Property("SPEC", "Tizen.NUI.WebView.Assign M")]
2107         [Property("SPEC_URL", "-")]
2108         [Property("CRITERIA", "MR")]
2109         [Property("COVPARAM", "")]
2110         [Property("AUTHOR", "guowei.wang@samsung.com")]
2111         public void WebViewAssign()
2112         {
2113             tlog.Debug(tag, $"WebViewAssign START");
2114
2115             try
2116             {
2117                 webView.Assign(webView);
2118             }
2119             catch (Exception e)
2120             {
2121                 tlog.Debug(tag, e.Message.ToString());
2122                 Assert.Fail("Caught Exception : Failed!");
2123             }
2124
2125             tlog.Debug(tag, $"WebViewAssign END (OK)");
2126         }
2127
2128         [Test]
2129         [Category("P1")]
2130         [Description("WebView Dispose.")]
2131         [Property("SPEC", "Tizen.NUI.WebView.Dispose M")]
2132         [Property("SPEC_URL", "-")]
2133         [Property("CRITERIA", "MR")]
2134         [Property("COVPARAM", "")]
2135         [Property("AUTHOR", "guowei.wang@samsung.com")]
2136         public void WebViewDispose()
2137         {
2138             tlog.Debug(tag, $"WebViewDispose START");
2139
2140             var testingTarget = new MyWebView();
2141             Assert.IsNotNull(testingTarget, "null handle");
2142             Assert.IsInstanceOf<Tizen.NUI.BaseComponents.WebView>(testingTarget, "Should return WebView instance.");
2143
2144             testingTarget.OnDispose(DisposeTypes.Explicit);
2145             //disposed
2146             testingTarget.OnDispose(DisposeTypes.Explicit);
2147
2148             tlog.Debug(tag, $"WebViewDispose END (OK)");
2149         }
2150     }
2151 }