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