3 using NUnit.Framework.TUnit;
4 using Tizen.NUI.Components;
5 using Tizen.NUI.BaseComponents;
6 using System.Threading.Tasks;
8 namespace Tizen.NUI.Devel.Tests
10 using tlog = Tizen.Log;
13 [Description("public/WebView/WebView")]
14 public class PublicWebViewTest
16 private const string tag = "NUITEST";
17 private string url = Applications.Application.Current.DirectoryInfo.Resource + "webview/index.html"; // its size is 150x150.
18 private string secondUrl = 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 = Applications.Application.Current.DirectoryInfo.Resource + "webview/console_info.html";
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;
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) { }
35 internal class MyWebView : Tizen.NUI.BaseComponents.WebView
37 public MyWebView() : base()
40 public void OnDispose(DisposeTypes type)
49 webView = new BaseComponents.WebView(runtimeArgs)
51 Size = new Size(150, 100), //For scrolling to edge...
53 tlog.Info(tag, "Init() is called!");
59 tlog.Info(tag, "Destroy() is being called!");
61 tlog.Info(tag, "Destroy() is called!");
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()
74 tlog.Debug(tag, $"WebViewConstructor START");
76 Assert.IsNotNull(webView, "null handle");
77 Assert.IsInstanceOf<Tizen.NUI.BaseComponents.WebView>(webView, "Should return WebView instance.");
79 tlog.Debug(tag, $"WebViewConstructor END (OK)");
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()
92 tlog.Debug(tag, $"WebViewConstructorWithLocaleAndTimezone START");
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.");
98 testingTarget?.Dispose();
99 tlog.Debug(tag, $"WebViewConstructorWithLocaleAndTimezone END (OK)");
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()
112 tlog.Debug(tag, $"WebViewConstructorWithWebView START");
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.");
118 testingTarget.Dispose();
119 tlog.Debug(tag, $"WebViewConstructorWithWebView END (OK)");
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()
132 tlog.Debug(tag, $"WebViewPageLoadStarted START");
134 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
135 EventHandler<WebViewPageLoadEventArgs> onLoadStarted = (s, e) => { tcs.TrySetResult(true); };
136 webView.PageLoadStarted += onLoadStarted;
138 webView.LoadUrl(url);
139 var result = await tcs.Task;
140 Assert.IsTrue(result, "PageLoadStarted event should be invoked");
142 webView.PageLoadStarted -= onLoadStarted;
144 tlog.Debug(tag, $"WebViewPageLoadStarted END (OK)");
149 [Description("WebView PageLoading.")]
150 [Property("SPEC", "Tizen.NUI.WebView.PageLoading E")]
151 [Property("SPEC_URL", "-")]
152 [Property("CRITERIA", "PRW")]
153 [Property("COVPARAM", "")]
154 [Property("AUTHOR", "guowei.wang@samsung.com")]
155 public async Task WebViewPageLoading()
157 tlog.Debug(tag, $"WebViewPageLoading START");
159 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
160 EventHandler<WebViewPageLoadEventArgs> onLoading = (s, e) => { tcs.TrySetResult(true); };
161 webView.PageLoading += onLoading;
163 webView.LoadUrl(url);
164 var result = await tcs.Task;
165 Assert.IsTrue(result, "PageLoading event should be invoked");
167 webView.PageLoading -= onLoading;
169 tlog.Debug(tag, $"WebViewPageLoading END (OK)");
174 [Description("WebView PageLoadFinished.")]
175 [Property("SPEC", "Tizen.NUI.WebView.PageLoadFinished E")]
176 [Property("SPEC_URL", "-")]
177 [Property("CRITERIA", "PRW")]
178 [Property("COVPARAM", "")]
179 [Property("AUTHOR", "guowei.wang@samsung.com")]
180 public async Task WebViewPageLoadFinished()
182 tlog.Debug(tag, $"WebViewPageLoadFinished START");
184 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
185 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) => { tcs.TrySetResult(true); };
186 webView.PageLoadFinished += onLoadFinished;
188 webView.LoadUrl(url);
189 var result = await tcs.Task;
190 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
192 webView.PageLoadFinished -= onLoadFinished;
194 tlog.Debug(tag, $"WebViewPageLoadFinished END (OK)");
197 //TODO... it seems that web engine does not implement it.
200 //[Description("WebView ScrollEdgeReached.")]
201 //[Property("SPEC", "Tizen.NUI.WebView.ScrollEdgeReached E")]
202 //[Property("SPEC_URL", "-")]
203 //[Property("CRITERIA", "PRW")]
204 //[Property("COVPARAM", "")]
205 //[Property("AUTHOR", "guowei.wang@samsung.com")]
206 //public async Task WebViewScrollEdgeReached()
208 // tlog.Debug(tag, $"WebViewScrollEdgeReached START");
210 // TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
211 // EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
213 // webView.ScrollBy(0, 60);
215 // webView.PageLoadFinished += onLoadFinished;
217 // EventHandler<WebViewScrollEdgeReachedEventArgs> onEdgeReached = (s, e) =>
219 // tcs.TrySetResult(true);
221 // webView.ScrollEdgeReached += onEdgeReached;
223 // webView.LoadUrl(url);
224 // var result = await tcs.Task;
225 // Assert.IsTrue(result, "ScrollEdgeReached event should be invoked");
227 // webView.PageLoadFinished -= onLoadFinished;
228 // webView.ScrollEdgeReached -= onEdgeReached;
230 // tlog.Debug(tag, $"WebViewScrollEdgeReached END (OK)");
235 [Description("WebView UrlChanged.")]
236 [Property("SPEC", "Tizen.NUI.WebView.UrlChanged E")]
237 [Property("SPEC_URL", "-")]
238 [Property("CRITERIA", "PRW")]
239 [Property("COVPARAM", "")]
240 [Property("AUTHOR", "guowei.wang@samsung.com")]
241 public async Task WebViewUrlChanged()
243 tlog.Debug(tag, $"WebViewUrlChanged START");
245 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
247 EventHandler<WebViewUrlChangedEventArgs> onUrlChange = (s, e) =>
249 tcs.TrySetResult(true);
251 webView.UrlChanged += onUrlChange;
253 webView.LoadUrl(url);
254 var result = await tcs.Task;
255 Assert.IsTrue(result, "UrlChanged event should be invoked");
257 webView.UrlChanged -= onUrlChange;
259 tlog.Debug(tag, $"WebViewUrlChanged END (OK)");
264 //[Description("WebView FormRepostPolicyDecided.")]
265 //[Property("SPEC", "Tizen.NUI.WebView.FormRepostPolicyDecided A")]
266 //[Property("SPEC_URL", "-")]
267 //[Property("CRITERIA", "PRW")]
268 //[Property("COVPARAM", "")]
269 //[Property("AUTHOR", "guowei.wang@samsung.com")]
270 //public void WebViewFormRepostPolicyDecided()
272 // tlog.Debug(tag, $"WebViewFormRepostPolicyDecided START");
274 // webView.FormRepostPolicyDecided += OnFormRepostPolicyDecide;
275 // webView.FormRepostPolicyDecided -= OnFormRepostPolicyDecide;
277 // tlog.Debug(tag, $"WebViewFormRepostPolicyDecided END (OK)");
282 [Description("WebView FrameRendered.")]
283 [Property("SPEC", "Tizen.NUI.WebView.FrameRendered A")]
284 [Property("SPEC_URL", "-")]
285 [Property("CRITERIA", "PRW")]
286 [Property("COVPARAM", "")]
287 [Property("AUTHOR", "guowei.wang@samsung.com")]
288 public async Task WebViewFrameRendered()
290 tlog.Debug(tag, $"WebViewFrameRendered START");
292 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
293 EventHandler<EventArgs> onFrameRender = (s, e) => { tcs.TrySetResult(true); };
294 webView.FrameRendered += onFrameRender;
296 webView.LoadUrl(url);
297 var result = await tcs.Task;
298 Assert.IsTrue(result, "FrameRendered event should be invoked");
300 webView.FrameRendered -= onFrameRender;
302 tlog.Debug(tag, $"WebViewFrameRendered END (OK)");
307 [Description("WebView ResponsePolicyDecided.")]
308 [Property("SPEC", "Tizen.NUI.WebView.ResponsePolicyDecided A")]
309 [Property("SPEC_URL", "-")]
310 [Property("CRITERIA", "PRW")]
311 [Property("COVPARAM", "")]
312 [Property("AUTHOR", "guowei.wang@samsung.com")]
313 public async Task WebViewResponsePolicyDecided()
315 tlog.Debug(tag, $"WebViewResponsePolicyDecided START");
317 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
318 EventHandler<WebViewPolicyDecidedEventArgs> onResponsePolicyDecide = (s, e) => { tcs.TrySetResult(true); };
319 webView.ResponsePolicyDecided += onResponsePolicyDecide;
321 webView.LoadUrl(urlForResponsePolicyTest);
322 var result = await tcs.Task;
323 Assert.IsTrue(result, "ResponsePolicyDecided event should be invoked");
325 webView.ResponsePolicyDecided -= onResponsePolicyDecide;
327 tlog.Debug(tag, $"WebViewResponsePolicyDecided END (OK)");
332 [Description("WebView NavigationPolicyDecided.")]
333 [Property("SPEC", "Tizen.NUI.WebView.NavigationPolicyDecided A")]
334 [Property("SPEC_URL", "-")]
335 [Property("CRITERIA", "PRW")]
336 [Property("COVPARAM", "")]
337 [Property("AUTHOR", "guowei.wang@samsung.com")]
338 public async Task WebViewNavigationPolicyDecided()
340 tlog.Debug(tag, $"WebViewNavigationPolicyDecided START");
342 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
344 EventHandler<WebViewPolicyDecidedEventArgs> onNavigationPolicyDecided = (s, e) =>
346 tlog.Info(tag, "onNavigationPolicyDecided is being called!");
347 tcs.TrySetResult(true);
349 webView.NavigationPolicyDecided += onNavigationPolicyDecided;
351 webView.LoadUrl(urlForNavigationPolicyTest);
352 var result = await tcs.Task;
353 Assert.IsTrue(result, "NavigationPolicyDecided event should be invoked");
355 webView.NavigationPolicyDecided -= onNavigationPolicyDecided;
357 tlog.Debug(tag, $"WebViewNavigationPolicyDecided END (OK)");
362 [Description("WebView CertificateConfirmed.")]
363 [Property("SPEC", "Tizen.NUI.WebView.CertificateConfirmed A")]
364 [Property("SPEC_URL", "-")]
365 [Property("CRITERIA", "PRW")]
366 [Property("COVPARAM", "")]
367 [Property("AUTHOR", "guowei.wang@samsung.com")]
368 public async Task WebViewCertificateConfirmed()
370 tlog.Debug(tag, $"WebViewCertificateConfirmed START");
372 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
374 EventHandler<WebViewCertificateReceivedEventArgs> onCertificateConfirme = (s, e) =>
376 tlog.Info(tag, "CertificateConfirmed is being called!");
377 tcs.TrySetResult(true);
379 webView.CertificateConfirmed += onCertificateConfirme;
381 webView.LoadUrl(urlForCertificateConfirmTest);
382 var result = await tcs.Task;
383 Assert.IsTrue(result, "CertificateConfirmed event should be invoked");
385 webView.CertificateConfirmed -= onCertificateConfirme;
387 tlog.Debug(tag, $"WebViewCertificateConfirmed END (OK)");
392 [Description("WebView SslCertificateChanged.")]
393 [Property("SPEC", "Tizen.NUI.WebView.SslCertificateChanged A")]
394 [Property("SPEC_URL", "-")]
395 [Property("CRITERIA", "PRW")]
396 [Property("COVPARAM", "")]
397 [Property("AUTHOR", "guowei.wang@samsung.com")]
398 public async Task WebViewSslCertificateChanged()
400 tlog.Debug(tag, $"WebViewSslCertificateChanged START");
402 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
403 EventHandler<WebViewCertificateReceivedEventArgs> onSslCertificateChange = (s, e) => { tcs.TrySetResult(true); };
404 webView.SslCertificateChanged += onSslCertificateChange;
406 webView.LoadUrl(url);
407 var result = await tcs.Task;
408 Assert.IsTrue(result, "SslCertificateChanged event should be invoked");
410 webView.SslCertificateChanged -= onSslCertificateChange;
412 tlog.Debug(tag, $"WebViewSslCertificateChanged END (OK)");
415 //TODO... it seems that web engine does not implement it.
418 //[Description("WebView HttpAuthRequested.")]
419 //[Property("SPEC", "Tizen.NUI.WebView.HttpAuthRequested A")]
420 //[Property("SPEC_URL", "-")]
421 //[Property("CRITERIA", "PRW")]
422 //[Property("COVPARAM", "")]
423 //[Property("AUTHOR", "guowei.wang@samsung.com")]
424 //public async Task WebViewHttpAuthRequested()
426 // tlog.Debug(tag, $"WebViewHttpAuthRequested START");
428 // TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
429 // EventHandler<WebViewHttpAuthRequestedEventArgs> onHttpAuthRequeste = (s, e) => { tcs.TrySetResult(true); };
430 // webView.HttpAuthRequested += onHttpAuthRequeste;
432 // webView.LoadUrl(urlForHttpAuthRequestTest);
433 // var result = await tcs.Task;
434 // Assert.IsTrue(result, "ResponsePolicyDecided event should be invoked");
436 // webView.HttpAuthRequested -= onHttpAuthRequeste;
438 // tlog.Debug(tag, $"WebViewHttpAuthRequested END (OK)");
443 [Description("WebView ConsoleMessageReceived.")]
444 [Property("SPEC", "Tizen.NUI.WebView.ConsoleMessageReceived A")]
445 [Property("SPEC_URL", "-")]
446 [Property("CRITERIA", "PRW")]
447 [Property("COVPARAM", "")]
448 [Property("AUTHOR", "guowei.wang@samsung.com")]
449 public async Task WebViewConsoleMessageReceived()
451 tlog.Debug(tag, $"WebViewHttpAuthRequested START");
453 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
454 EventHandler<WebViewConsoleMessageReceivedEventArgs> onConsoleMessageReceive = (s, e) => { tcs.TrySetResult(true); };
455 webView.ConsoleMessageReceived += onConsoleMessageReceive;
457 webView.LoadUrl(urlForConsoleMessageTest);
458 var result = await tcs.Task;
459 Assert.IsTrue(result, "ConsoleMessageReceived event should be invoked");
461 webView.ConsoleMessageReceived -= onConsoleMessageReceive;
463 tlog.Debug(tag, $"WebViewConsoleMessageReceived END (OK)");
466 //TODO... move it to manual test...
469 //[Description("WebView ContextMenuShown.")]
470 //[Property("SPEC", "Tizen.NUI.WebView.ContextMenuShown A")]
471 //[Property("SPEC_URL", "-")]
472 //[Property("CRITERIA", "PRW")]
473 //[Property("COVPARAM", "")]
474 //[Property("AUTHOR", "guowei.wang@samsung.com")]
475 //public void WebViewContextMenuShown()
477 // tlog.Debug(tag, $"WebViewContextMenuShown START");
479 // webView.ContextMenuShown += OnContextMenuShown;
480 // webView.ContextMenuShown -= OnContextMenuShown;
482 // tlog.Debug(tag, $"WebViewContextMenuShown END (OK)");
485 //TODO... move it to manual test...
488 //[Description("WebView ContextMenuHidden.")]
489 //[Property("SPEC", "Tizen.NUI.WebView.ContextMenuHidden A")]
490 //[Property("SPEC_URL", "-")]
491 //[Property("CRITERIA", "PRW")]
492 //[Property("COVPARAM", "")]
493 //[Property("AUTHOR", "guowei.wang@samsung.com")]
494 //public void WebViewContextMenuHidden()
496 // tlog.Debug(tag, $"WebViewContextMenuHidden START");
498 // webView.ContextMenuHidden += OnContextMenuHidden;
499 // webView.ContextMenuHidden -= OnContextMenuHidden;
501 // tlog.Debug(tag, $"WebViewContextMenuHidden END (OK)");
506 [Description("WebView BackForwardList.")]
507 [Property("SPEC", "Tizen.NUI.WebView.BackForwardList A")]
508 [Property("SPEC_URL", "-")]
509 [Property("CRITERIA", "PRO")]
510 [Property("COVPARAM", "")]
511 [Property("AUTHOR", "guowei.wang@samsung.com")]
512 public void WebViewBackForwardList()
514 tlog.Debug(tag, $"WebViewBackForwardList START");
516 var result = webView.BackForwardList;
517 tlog.Debug(tag, "ForwardList : " + result);
519 tlog.Debug(tag, $"WebViewBackForwardList END (OK)");
524 [Description("WebView Context.")]
525 [Property("SPEC", "Tizen.NUI.WebView.Context A")]
526 [Property("SPEC_URL", "-")]
527 [Property("CRITERIA", "PRO")]
528 [Property("COVPARAM", "")]
529 [Property("AUTHOR", "guowei.wang@samsung.com")]
530 public void WebViewContext()
532 tlog.Debug(tag, $"WebViewContext START");
534 var result = webView.Context;
535 tlog.Debug(tag, "Context : " + result);
537 tlog.Debug(tag, $"WebViewContext END (OK)");
542 [Description("WebView CookieManager.")]
543 [Property("SPEC", "Tizen.NUI.WebView.CookieManager A")]
544 [Property("SPEC_URL", "-")]
545 [Property("CRITERIA", "PRO")]
546 [Property("COVPARAM", "")]
547 [Property("AUTHOR", "guowei.wang@samsung.com")]
548 public void WebViewCookieManager()
550 tlog.Debug(tag, $"WebViewCookieManager START");
552 var result = webView.CookieManager;
553 tlog.Debug(tag, "CookieManager : " + result);
555 tlog.Debug(tag, $"WebViewCookieManager END (OK)");
560 [Description("WebView Settings.")]
561 [Property("SPEC", "Tizen.NUI.WebView.Settings A")]
562 [Property("SPEC_URL", "-")]
563 [Property("CRITERIA", "PRO")]
564 [Property("COVPARAM", "")]
565 [Property("AUTHOR", "guowei.wang@samsung.com")]
566 public void WebViewSettings()
568 tlog.Debug(tag, $"WebViewSettings START");
570 var result = webView.Settings;
571 tlog.Debug(tag, "Settings : " + result);
573 tlog.Debug(tag, $"WebViewSettings END (OK)");
578 [Description("WebView Url.")]
579 [Property("SPEC", "Tizen.NUI.WebView.Url A")]
580 [Property("SPEC_URL", "-")]
581 [Property("CRITERIA", "PRW")]
582 [Property("COVPARAM", "")]
583 [Property("AUTHOR", "guowei.wang@samsung.com")]
584 public async Task WebViewUrl()
586 tlog.Debug(tag, $"WebViewUrl START");
587 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
588 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
590 tcs.TrySetResult(true);
592 webView.PageLoadFinished += onLoadFinished;
595 var result = await tcs.Task;
596 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
598 webView.PageLoadFinished -= onLoadFinished;
600 tlog.Debug(tag, "Url : " + webView.Url);
601 tlog.Debug(tag, $"WebViewUrl END (OK)");
606 [Description("WebView CacheModel.")]
607 [Property("SPEC", "Tizen.NUI.WebView.CacheModel A")]
608 [Property("SPEC_URL", "-")]
609 [Property("CRITERIA", "PRW")]
610 [Property("COVPARAM", "")]
611 [Property("AUTHOR", "guowei.wang@samsung.com")]
612 public void WebViewCacheModel()
614 tlog.Debug(tag, $"WebViewCacheModel START");
616 webView.CacheModel = Tizen.NUI.CacheModel.DocumentViewer;
617 tlog.Debug(tag, "CacheModel : " + webView.CacheModel);
619 webView.CacheModel = Tizen.NUI.CacheModel.DocumentBrowser;
620 tlog.Debug(tag, "CacheModel : " + webView.CacheModel);
622 webView.CacheModel = Tizen.NUI.CacheModel.PrimaryWebBrowser;
623 tlog.Debug(tag, "CacheModel : " + webView.CacheModel);
625 tlog.Debug(tag, $"WebViewCacheModel END (OK)");
630 [Description("WebView CookieAcceptPolicy.")]
631 [Property("SPEC", "Tizen.NUI.WebView.CookieAcceptPolicy A")]
632 [Property("SPEC_URL", "-")]
633 [Property("CRITERIA", "PRW")]
634 [Property("COVPARAM", "")]
635 [Property("AUTHOR", "guowei.wang@samsung.com")]
636 public void WebViewCookieAcceptPolicy()
638 tlog.Debug(tag, $"WebViewCookieAcceptPolicy START");
640 webView.CookieAcceptPolicy = (CookieAcceptPolicy)Tizen.NUI.WebCookieManager.CookieAcceptPolicyType.NoThirdParty;
641 tlog.Debug(tag, "CookieAcceptPolicy : " + webView.CookieAcceptPolicy);
643 webView.CookieAcceptPolicy = (CookieAcceptPolicy)Tizen.NUI.WebCookieManager.CookieAcceptPolicyType.Always;
644 tlog.Debug(tag, "CookieAcceptPolicy : " + webView.CookieAcceptPolicy);
646 webView.CookieAcceptPolicy = (CookieAcceptPolicy)Tizen.NUI.WebCookieManager.CookieAcceptPolicyType.Never;
647 tlog.Debug(tag, "CookieAcceptPolicy : " + webView.CookieAcceptPolicy);
649 tlog.Debug(tag, $"WebViewCookieAcceptPolicy END (OK)");
654 [Description("WebView UserAgent.")]
655 [Property("SPEC", "Tizen.NUI.WebView.UserAgent A")]
656 [Property("SPEC_URL", "-")]
657 [Property("CRITERIA", "PRW")]
658 [Property("COVPARAM", "")]
659 [Property("AUTHOR", "guowei.wang@samsung.com")]
660 public async Task WebViewUserAgent()
662 tlog.Debug(tag, $"WebViewUserAgent START");
664 webView.UserAgent = USER_AGENT;
665 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
666 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
668 tcs.TrySetResult(true);
670 webView.PageLoadFinished += onLoadFinished;
671 webView.LoadUrl(url);
672 var result = await tcs.Task;
673 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
675 webView.PageLoadFinished -= onLoadFinished;
677 tlog.Debug(tag, "UserAgent : " + webView.UserAgent);
678 tlog.Debug(tag, $"WebViewUserAgent END (OK)");
683 [Description("WebView EnableJavaScript.")]
684 [Property("SPEC", "Tizen.NUI.WebView.EnableJavaScript A")]
685 [Property("SPEC_URL", "-")]
686 [Property("CRITERIA", "PRW")]
687 [Property("COVPARAM", "")]
688 [Property("AUTHOR", "guowei.wang@samsung.com")]
689 public void WebViewEnableJavaScript()
691 tlog.Debug(tag, $"WebViewEnableJavaScript START");
693 webView.EnableJavaScript = true;
694 tlog.Debug(tag, "EnableJavaScript : " + webView.EnableJavaScript);
696 webView.EnableJavaScript = false;
697 tlog.Debug(tag, "EnableJavaScript : " + webView.EnableJavaScript);
699 tlog.Debug(tag, $"WebViewEnableJavaScript END (OK)");
704 [Description("WebView LoadImagesAutomatically.")]
705 [Property("SPEC", "Tizen.NUI.WebView.LoadImagesAutomatically A")]
706 [Property("SPEC_URL", "-")]
707 [Property("CRITERIA", "PRW")]
708 [Property("COVPARAM", "")]
709 [Property("AUTHOR", "guowei.wang@samsung.com")]
710 public void WebViewLoadImagesAutomatically()
712 tlog.Debug(tag, $"WebViewLoadImagesAutomatically START");
714 webView.LoadImagesAutomatically = true;
715 tlog.Debug(tag, "LoadImagesAutomatically : " + webView.LoadImagesAutomatically);
717 webView.LoadImagesAutomatically = false;
718 tlog.Debug(tag, "LoadImagesAutomatically : " + webView.LoadImagesAutomatically);
720 tlog.Debug(tag, $"WebViewLoadImagesAutomatically END (OK)");
725 [Description("WebView DefaultTextEncodingName.")]
726 [Property("SPEC", "Tizen.NUI.WebView.DefaultTextEncodingName A")]
727 [Property("SPEC_URL", "-")]
728 [Property("CRITERIA", "PRW")]
729 [Property("COVPARAM", "")]
730 [Property("AUTHOR", "guowei.wang@samsung.com")]
731 public void WebViewDefaultTextEncodingName()
733 tlog.Debug(tag, $"WebViewDefaultTextEncodingName START");
735 var result = webView.DefaultTextEncodingName;
736 tlog.Debug(tag, "DefaultTextEncodingName : " + result);
738 webView.DefaultTextEncodingName = "gbk";
739 tlog.Debug(tag, "DefaultTextEncodingName : " + result);
741 tlog.Debug(tag, $"WebViewDefaultTextEncodingName END (OK)");
746 [Description("WebView DefaultFontSize.")]
747 [Property("SPEC", "Tizen.NUI.WebView.DefaultFontSize A")]
748 [Property("SPEC_URL", "-")]
749 [Property("CRITERIA", "PRW")]
750 [Property("COVPARAM", "")]
751 [Property("AUTHOR", "guowei.wang@samsung.com")]
752 public void WebViewDefaultFontSize()
754 tlog.Debug(tag, $"WebViewDefaultFontSize START");
756 var result = webView.DefaultFontSize;
757 tlog.Debug(tag, "DefaultFontSize : " + result);
759 webView.DefaultFontSize = 32;
760 tlog.Debug(tag, "DefaultFontSize : " + result);
762 tlog.Debug(tag, $"WebViewDefaultFontSize END (OK)");
767 [Description("WebView ScrollSize.")]
768 [Property("SPEC", "Tizen.NUI.WebView.ScrollSize A")]
769 [Property("SPEC_URL", "-")]
770 [Property("CRITERIA", "PRO")]
771 [Property("COVPARAM", "")]
772 [Property("AUTHOR", "guowei.wang@samsung.com")]
773 public void WebViewScrollSize()
775 tlog.Debug(tag, $"WebViewScrollSize START");
777 tlog.Debug(tag, "Width : " + webView.ScrollSize.Width);
778 tlog.Debug(tag, "Height : " + webView.ScrollSize.Height);
780 tlog.Debug(tag, $"WebViewScrollSize END (OK)");
785 [Description("WebView ContentSize.")]
786 [Property("SPEC", "Tizen.NUI.WebView.ContentSize A")]
787 [Property("SPEC_URL", "-")]
788 [Property("CRITERIA", "PRO")]
789 [Property("COVPARAM", "")]
790 [Property("AUTHOR", "guowei.wang@samsung.com")]
791 public void WebViewContentSize()
793 tlog.Debug(tag, $"WebViewContentSize START");
795 tlog.Debug(tag, "Width : " + webView.ContentSize.Width);
796 tlog.Debug(tag, "Height : " + webView.ContentSize.Height);
798 tlog.Debug(tag, $"WebViewContentSize END (OK)");
803 [Description("WebView VideoHoleEnabled.")]
804 [Property("SPEC", "Tizen.NUI.WebView.VideoHoleEnabled A")]
805 [Property("SPEC_URL", "-")]
806 [Property("CRITERIA", "PRW")]
807 [Property("COVPARAM", "")]
808 [Property("AUTHOR", "guowei.wang@samsung.com")]
809 public void WebViewVideoHoleEnabled()
811 tlog.Debug(tag, $"WebViewVideoHoleEnabled START");
813 webView.VideoHoleEnabled = true;
814 tlog.Debug(tag, "VideoHoleEnabled : " + webView.VideoHoleEnabled);
816 webView.VideoHoleEnabled = false;
817 tlog.Debug(tag, "VideoHoleEnabled : " + webView.VideoHoleEnabled);
819 tlog.Debug(tag, $"WebViewVideoHoleEnabled END (OK)");
824 [Description("WebView MouseEventsEnabled.")]
825 [Property("SPEC", "Tizen.NUI.WebView.MouseEventsEnabled A")]
826 [Property("SPEC_URL", "-")]
827 [Property("CRITERIA", "PRW")]
828 [Property("COVPARAM", "")]
829 [Property("AUTHOR", "guowei.wang@samsung.com")]
830 public void WebViewMouseEventsEnabled()
832 tlog.Debug(tag, $"WebViewMouseEventsEnabled START");
834 webView.MouseEventsEnabled = true;
835 tlog.Debug(tag, "MouseEventsEnabled : " + webView.MouseEventsEnabled);
837 webView.MouseEventsEnabled = false;
838 tlog.Debug(tag, "MouseEventsEnabled : " + webView.MouseEventsEnabled);
840 tlog.Debug(tag, $"WebViewMouseEventsEnabled END (OK)");
845 [Description("WebView KeyEventsEnabled.")]
846 [Property("SPEC", "Tizen.NUI.WebView.KeyEventsEnabled A")]
847 [Property("SPEC_URL", "-")]
848 [Property("CRITERIA", "PRW")]
849 [Property("COVPARAM", "")]
850 [Property("AUTHOR", "guowei.wang@samsung.com")]
851 public void WebViewKeyEventsEnabled()
853 tlog.Debug(tag, $"WebViewKeyEventsEnabled START");
855 webView.KeyEventsEnabled = true;
856 tlog.Debug(tag, "KeyEventsEnabled : " + webView.KeyEventsEnabled);
858 webView.KeyEventsEnabled = false;
859 tlog.Debug(tag, "KeyEventsEnabled : " + webView.KeyEventsEnabled);
861 tlog.Debug(tag, $"WebViewKeyEventsEnabled END (OK)");
866 [Description("WebView ContentBackgroundColor.")]
867 [Property("SPEC", "Tizen.NUI.WebView.ContentBackgroundColor A")]
868 [Property("SPEC_URL", "-")]
869 [Property("CRITERIA", "PRW")]
870 [Property("COVPARAM", "")]
871 [Property("AUTHOR", "guowei.wang@samsung.com")]
872 public async Task WebViewContentBackgroundColor()
874 tlog.Debug(tag, $"WebViewContentBackgroundColor START");
876 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
877 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
879 webView.ContentBackgroundColor = new Vector4(0.3f, 0.5f, 1.0f, 0.0f);
880 tcs.TrySetResult(true);
882 webView.PageLoadFinished += onLoadFinished;
883 webView.LoadUrl(url);
884 var result = await tcs.Task;
885 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
887 webView.PageLoadFinished -= onLoadFinished;
889 tlog.Debug(tag, "ContentBackgroundColor : " + webView.ContentBackgroundColor);
891 tlog.Debug(tag, $"WebViewContentBackgroundColor END (OK)");
896 [Description("WebView TilesClearedWhenHidden.")]
897 [Property("SPEC", "Tizen.NUI.WebView.TilesClearedWhenHidden A")]
898 [Property("SPEC_URL", "-")]
899 [Property("CRITERIA", "PRW")]
900 [Property("COVPARAM", "")]
901 [Property("AUTHOR", "guowei.wang@samsung.com")]
902 public void WebViewTilesClearedWhenHidden()
904 tlog.Debug(tag, $"WebViewTilesClearedWhenHidden START");
906 webView.TilesClearedWhenHidden = true;
907 tlog.Debug(tag, "TilesClearedWhenHidden : " + webView.TilesClearedWhenHidden);
909 webView.TilesClearedWhenHidden = false;
910 tlog.Debug(tag, "TilesClearedWhenHidden : " + webView.TilesClearedWhenHidden);
912 tlog.Debug(tag, $"WebViewTilesClearedWhenHidden END (OK)");
917 [Description("WebView TileCoverAreaMultiplier.")]
918 [Property("SPEC", "Tizen.NUI.WebView.TileCoverAreaMultiplier A")]
919 [Property("SPEC_URL", "-")]
920 [Property("CRITERIA", "PRW")]
921 [Property("COVPARAM", "")]
922 [Property("AUTHOR", "guowei.wang@samsung.com")]
923 public void WebViewTileCoverAreaMultiplier()
925 tlog.Debug(tag, $"WebViewTileCoverAreaMultiplier START");
927 webView.TileCoverAreaMultiplier = 0.3f;
928 tlog.Debug(tag, "TileCoverAreaMultiplier : " + webView.TileCoverAreaMultiplier);
930 tlog.Debug(tag, $"WebViewTileCoverAreaMultiplier END (OK)");
935 [Description("WebView CursorEnabledByClient.")]
936 [Property("SPEC", "Tizen.NUI.WebView.CursorEnabledByClient A")]
937 [Property("SPEC_URL", "-")]
938 [Property("CRITERIA", "PRW")]
939 [Property("COVPARAM", "")]
940 [Property("AUTHOR", "guowei.wang@samsung.com")]
941 public void WebViewCursorEnabledByClient()
943 tlog.Debug(tag, $"WebViewCursorEnabledByClient START");
945 webView.CursorEnabledByClient = true;
946 tlog.Debug(tag, "CursorEnabledByClient : " + webView.CursorEnabledByClient);
948 webView.CursorEnabledByClient = false;
949 tlog.Debug(tag, "CursorEnabledByClient : " + webView.CursorEnabledByClient);
951 tlog.Debug(tag, $"WebViewCursorEnabledByClient END (OK)");
956 [Description("WebView SelectedText.")]
957 [Property("SPEC", "Tizen.NUI.WebView.SelectedText A")]
958 [Property("SPEC_URL", "-")]
959 [Property("CRITERIA", "PRO")]
960 [Property("COVPARAM", "")]
961 [Property("AUTHOR", "guowei.wang@samsung.com")]
962 public void WebViewSelectedText()
964 tlog.Debug(tag, $"WebViewSelectedText START");
966 var text = webView.SelectedText;
967 tlog.Debug(tag, "SelectedText : " + text);
969 tlog.Debug(tag, $"WebViewSelectedText END (OK)");
974 [Description("WebView Title.")]
975 [Property("SPEC", "Tizen.NUI.WebView.Title A")]
976 [Property("SPEC_URL", "-")]
977 [Property("CRITERIA", "PRO")]
978 [Property("COVPARAM", "")]
979 [Property("AUTHOR", "guowei.wang@samsung.com")]
980 public void WebViewTitle()
982 tlog.Debug(tag, $"WebViewTitle START");
984 var title = webView.Title;
985 tlog.Debug(tag, "Title : " + title);
987 tlog.Debug(tag, $"WebViewTitle END (OK)");
992 [Description("WebView Favicon.")]
993 [Property("SPEC", "Tizen.NUI.WebView.Favicon A")]
994 [Property("SPEC_URL", "-")]
995 [Property("CRITERIA", "PRO")]
996 [Property("COVPARAM", "")]
997 [Property("AUTHOR", "guowei.wang@samsung.com")]
998 public void WebViewFavicon()
1000 tlog.Debug(tag, $"WebViewFavicon START");
1002 var fav = webView.Favicon;
1003 tlog.Debug(tag, "Favicon : " + fav);
1005 tlog.Debug(tag, $"WebViewFavicon END (OK)");
1010 [Description("WebView PageZoomFactor.")]
1011 [Property("SPEC", "Tizen.NUI.WebView.PageZoomFactor A")]
1012 [Property("SPEC_URL", "-")]
1013 [Property("CRITERIA", "PRW")]
1014 [Property("COVPARAM", "")]
1015 [Property("AUTHOR", "guowei.wang@samsung.com")]
1016 public void WebViewPageZoomFactor()
1018 tlog.Debug(tag, $"WebViewPageZoomFactor START");
1020 webView.PageZoomFactor = 0.3f;
1021 tlog.Debug(tag, "PageZoomFactor : " + webView.PageZoomFactor);
1023 tlog.Debug(tag, $"WebViewPageZoomFactor END (OK)");
1028 [Description("WebView TextZoomFactor.")]
1029 [Property("SPEC", "Tizen.NUI.WebView.TextZoomFactor A")]
1030 [Property("SPEC_URL", "-")]
1031 [Property("CRITERIA", "PRW")]
1032 [Property("COVPARAM", "")]
1033 [Property("AUTHOR", "guowei.wang@samsung.com")]
1034 public void WebViewTextZoomFactor()
1036 tlog.Debug(tag, $"WebViewTextZoomFactor START");
1038 webView.TextZoomFactor = 0.2f;
1039 tlog.Debug(tag, "TextZoomFactor : " + webView.TextZoomFactor);
1041 tlog.Debug(tag, $"WebViewTextZoomFactor END (OK)");
1046 [Description("WebView LoadProgressPercentage.")]
1047 [Property("SPEC", "Tizen.NUI.WebView.LoadProgressPercentage A")]
1048 [Property("SPEC_URL", "-")]
1049 [Property("CRITERIA", "PRO")]
1050 [Property("COVPARAM", "")]
1051 [Property("AUTHOR", "guowei.wang@samsung.com")]
1052 public void WebViewLoadProgressPercentage()
1054 tlog.Debug(tag, $"WebViewLoadProgressPercentage START");
1056 var result = webView.LoadProgressPercentage;
1057 tlog.Debug(tag, "LoadProgressPercentage : " + result);
1059 tlog.Debug(tag, $"WebViewLoadProgressPercentage END (OK)");
1064 [Description("WebView LoadHtmlString.")]
1065 [Property("SPEC", "Tizen.NUI.WebView.LoadHtmlString M")]
1066 [Property("SPEC_URL", "-")]
1067 [Property("CRITERIA", "MR")]
1068 [Property("COVPARAM", "")]
1069 [Property("AUTHOR", "guowei.wang@samsung.com")]
1070 public async Task WebViewLoadHtmlString()
1072 tlog.Debug(tag, $"WebViewLoadHtmlString START");
1074 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1075 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1077 tlog.Info(tag, "onLoadFinished is called!");
1078 tcs.TrySetResult(true);
1080 webView.PageLoadFinished += onLoadFinished;
1082 webView.LoadHtmlString("<html><head lang=\"en\"></head></html>");
1084 var result = await tcs.Task;
1085 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1087 webView.PageLoadFinished -= onLoadFinished;
1089 tlog.Debug(tag, $"WebViewLoadHtmlString END (OK)");
1094 [Description("WebView LoadHTMLString.")]
1095 [Property("SPEC", "Tizen.NUI.WebView.LoadHTMLString M")]
1096 [Property("SPEC_URL", "-")]
1097 [Property("CRITERIA", "MR")]
1098 [Property("COVPARAM", "")]
1099 [Property("AUTHOR", "guowei.wang@samsung.com")]
1100 public async Task WebViewLoadHTMLString()
1102 tlog.Debug(tag, $"WebViewLoadHTMLString START");
1104 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1105 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1107 tlog.Info(tag, "onLoadFinished is called!");
1108 tcs.TrySetResult(true);
1110 webView.PageLoadFinished += onLoadFinished;
1112 webView.LoadHTMLString("<html><head lang=\"en\"></head></html>");
1114 var result = await tcs.Task;
1115 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1117 webView.PageLoadFinished -= onLoadFinished;
1119 tlog.Debug(tag, $"WebViewLoadHTMLString END (OK)");
1124 [Description("WebView LoadContents.")]
1125 [Property("SPEC", "Tizen.NUI.WebView.LoadContents M")]
1126 [Property("SPEC_URL", "-")]
1127 [Property("CRITERIA", "MR")]
1128 [Property("COVPARAM", "")]
1129 [Property("AUTHOR", "guowei.wang@samsung.com")]
1130 public async Task WebViewLoadContents()
1132 tlog.Debug(tag, $"WebViewLoadContents START");
1134 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1135 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1137 tlog.Info(tag, "onLoadFinished is called!");
1138 tcs.TrySetResult(true);
1140 webView.PageLoadFinished += onLoadFinished;
1142 webView.LoadContents("body", 18, " ", "gbk", null);
1144 var result = await tcs.Task;
1145 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1147 webView.PageLoadFinished -= onLoadFinished;
1149 tlog.Debug(tag, $"WebViewLoadContents END (OK)");
1154 [Description("WebView Reload.")]
1155 [Property("SPEC", "Tizen.NUI.WebView.Reload M")]
1156 [Property("SPEC_URL", "-")]
1157 [Property("CRITERIA", "MR")]
1158 [Property("COVPARAM", "")]
1159 [Property("AUTHOR", "guowei.wang@samsung.com")]
1160 public async Task WebViewReload()
1162 tlog.Debug(tag, $"WebViewReload START");
1164 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1165 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1167 tlog.Info(tag, "onLoadFinished is called!");
1169 tcs.TrySetResult(true);
1171 webView.PageLoadFinished += onLoadFinished;
1173 webView.LoadUrl(url);
1175 var result = await tcs.Task;
1176 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1178 webView.PageLoadFinished -= onLoadFinished;
1180 tlog.Debug(tag, $"WebViewReload END (OK)");
1185 [Description("WebView ReloadWithoutCache.")]
1186 [Property("SPEC", "Tizen.NUI.WebView.ReloadWithoutCache M")]
1187 [Property("SPEC_URL", "-")]
1188 [Property("CRITERIA", "MR")]
1189 [Property("COVPARAM", "")]
1190 [Property("AUTHOR", "guowei.wang@samsung.com")]
1191 public async Task WebViewReloadWithoutCache()
1193 tlog.Debug(tag, $"WebViewReloadWithoutCache START");
1195 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1196 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1198 tlog.Info(tag, "onLoadFinished is called!");
1199 webView.ReloadWithoutCache();
1200 tcs.TrySetResult(true);
1202 webView.PageLoadFinished += onLoadFinished;
1204 webView.LoadUrl(url);
1206 var result = await tcs.Task;
1207 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1209 webView.PageLoadFinished -= onLoadFinished;
1211 tlog.Debug(tag, $"WebViewReloadWithoutCache END (OK)");
1216 [Description("WebView StopLoading.")]
1217 [Property("SPEC", "Tizen.NUI.WebView.StopLoading M")]
1218 [Property("SPEC_URL", "-")]
1219 [Property("CRITERIA", "MR")]
1220 [Property("COVPARAM", "")]
1221 [Property("AUTHOR", "guowei.wang@samsung.com")]
1222 public async Task WebViewStopLoading()
1224 tlog.Debug(tag, $"WebViewStopLoading START");
1226 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1227 EventHandler<WebViewPageLoadEventArgs> onLoadStarted = (s, e) =>
1229 tlog.Info(tag, "onLoadFinished is called!");
1230 webView.StopLoading();
1231 tcs.TrySetResult(true);
1233 webView.PageLoadStarted += onLoadStarted;
1235 webView.LoadUrl(url);
1237 var result = await tcs.Task;
1238 Assert.IsTrue(result, "PageLoadStarted event should be invoked");
1240 webView.PageLoadStarted -= onLoadStarted;
1242 tlog.Debug(tag, $"WebViewStopLoading END (OK)");
1247 [Description("WebView Suspend.")]
1248 [Property("SPEC", "Tizen.NUI.WebView.Suspend M")]
1249 [Property("SPEC_URL", "-")]
1250 [Property("CRITERIA", "MR")]
1251 [Property("COVPARAM", "")]
1252 [Property("AUTHOR", "guowei.wang@samsung.com")]
1253 public async Task WebViewSuspend()
1255 tlog.Debug(tag, $"WebViewSuspend START");
1257 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1258 EventHandler<WebViewPageLoadEventArgs> onLoadStarted = (s, e) =>
1260 tlog.Info(tag, "onLoadStarted is called!");
1263 webView.PageLoadStarted += onLoadStarted;
1265 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1267 tlog.Info(tag, "onLoadFinished is called!");
1269 tcs.TrySetResult(true);
1271 webView.PageLoadFinished += onLoadFinished;
1273 webView.LoadUrl(url);
1275 var result = await tcs.Task;
1276 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1278 webView.PageLoadStarted -= onLoadStarted;
1279 webView.PageLoadFinished -= onLoadFinished;
1281 tlog.Debug(tag, $"WebViewSuspend END (OK)");
1286 [Description("WebView SuspendNetworkLoading.")]
1287 [Property("SPEC", "Tizen.NUI.WebView.SuspendNetworkLoading M")]
1288 [Property("SPEC_URL", "-")]
1289 [Property("CRITERIA", "MR")]
1290 [Property("COVPARAM", "")]
1291 [Property("AUTHOR", "guowei.wang@samsung.com")]
1292 public async Task WebViewSuspendNetworkLoading()
1294 tlog.Debug(tag, $"WebViewSuspendNetworkLoading START");
1296 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1297 EventHandler<WebViewPageLoadEventArgs> onLoadStarted = (s, e) =>
1299 tlog.Info(tag, "onLoadStarted is called!");
1300 webView.SuspendNetworkLoading();
1302 webView.PageLoadStarted += onLoadStarted;
1304 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1306 tlog.Info(tag, "onLoadFinished is called!");
1307 webView.ResumeNetworkLoading();
1308 tcs.TrySetResult(true);
1310 webView.PageLoadFinished += onLoadFinished;
1312 webView.LoadUrl(url);
1314 var result = await tcs.Task;
1315 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1317 webView.PageLoadStarted -= onLoadStarted;
1318 webView.PageLoadFinished -= onLoadFinished;
1320 tlog.Debug(tag, $"WebViewSuspendNetworkLoading END (OK)");
1325 [Description("WebView AddCustomHeader.")]
1326 [Property("SPEC", "Tizen.NUI.WebView.AddCustomHeader M")]
1327 [Property("SPEC_URL", "-")]
1328 [Property("CRITERIA", "MR")]
1329 [Property("COVPARAM", "")]
1330 [Property("AUTHOR", "guowei.wang@samsung.com")]
1331 public void WebViewAddCustomHeader()
1333 tlog.Debug(tag, $"WebViewAddCustomHeader START");
1335 var result = webView.AddCustomHeader("customHeader_title", "font-size: 32rpx");
1336 tlog.Debug(tag, "AddCustomHeader : " + result);
1338 result = webView.RemoveCustomHeader("customHeader_title");
1339 tlog.Debug(tag, "RemoveCustomHeader : " + result);
1341 tlog.Debug(tag, $"WebViewAddCustomHeader END (OK)");
1346 [Description("WebView ScrollBy.")]
1347 [Property("SPEC", "Tizen.NUI.WebView.ScrollBy M")]
1348 [Property("SPEC_URL", "-")]
1349 [Property("CRITERIA", "MR")]
1350 [Property("COVPARAM", "")]
1351 [Property("AUTHOR", "guowei.wang@samsung.com")]
1352 public async Task WebViewScrollBy()
1354 tlog.Debug(tag, $"WebViewScrollBy START");
1356 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1357 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1359 tlog.Info(tag, "onLoadFinished is called!");
1360 webView.ScrollBy(0, 60);
1361 tcs.TrySetResult(true);
1363 webView.PageLoadFinished += onLoadFinished;
1365 webView.LoadUrl(url);
1366 var result = await tcs.Task;
1367 Assert.IsTrue(result, "ScrollEdgeReached event should be invoked");
1369 webView.PageLoadFinished -= onLoadFinished;
1371 tlog.Debug(tag, $"WebViewScrollBy END (OK)");
1376 [Description("WebView ScrollEdgeBy.")]
1377 [Property("SPEC", "Tizen.NUI.WebView.ScrollEdgeBy M")]
1378 [Property("SPEC_URL", "-")]
1379 [Property("CRITERIA", "MR")]
1380 [Property("COVPARAM", "")]
1381 [Property("AUTHOR", "guowei.wang@samsung.com")]
1382 public async Task WebViewScrollEdgeBy()
1384 tlog.Debug(tag, $"WebViewScrollEdgeBy START");
1386 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1387 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1389 tlog.Info(tag, "onLoadFinished is called!");
1390 webView.ScrollEdgeBy(0, 60);
1391 tcs.TrySetResult(true);
1393 webView.PageLoadFinished += onLoadFinished;
1395 webView.LoadUrl(url);
1396 var result = await tcs.Task;
1397 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1399 webView.PageLoadFinished -= onLoadFinished;
1401 tlog.Debug(tag, $"WebViewScrollEdgeBy END (OK)");
1406 [Description("WebView GoBack.")]
1407 [Property("SPEC", "Tizen.NUI.WebView.GoBack M")]
1408 [Property("SPEC_URL", "-")]
1409 [Property("CRITERIA", "MR")]
1410 [Property("COVPARAM", "")]
1411 [Property("AUTHOR", "guowei.wang@samsung.com")]
1412 public async Task WebViewGoBack()
1414 tlog.Debug(tag, $"WebViewGoBack START");
1416 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1417 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1419 if (webView.Url.Contains("index.html"))
1421 tlog.Info(tag, "onLoadFinished is called!");
1422 webView.LoadUrl(secondUrl);
1426 tlog.Info(tag, "onLoadFinished is called!");
1428 tcs.TrySetResult(true);
1431 webView.PageLoadFinished += onLoadFinished;
1433 webView.LoadUrl(url);
1434 var result = await tcs.Task;
1435 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1437 webView.PageLoadFinished -= onLoadFinished;
1439 tlog.Debug(tag, $"WebViewGoBack END (OK)");
1444 [Description("WebView GoForward.")]
1445 [Property("SPEC", "Tizen.NUI.WebView.GoForward M")]
1446 [Property("SPEC_URL", "-")]
1447 [Property("CRITERIA", "MR")]
1448 [Property("COVPARAM", "")]
1449 [Property("AUTHOR", "guowei.wang@samsung.com")]
1450 public async Task WebViewGoForward()
1452 tlog.Debug(tag, $"WebViewGoForward START");
1454 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1455 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1457 if (webView.Url.Contains("index.html"))
1459 tlog.Info(tag, "onLoadFinished is called!");
1460 webView.LoadUrl(secondUrl);
1464 tlog.Info(tag, "onLoadFinished is called!");
1466 webView.GoForward();
1467 tcs.TrySetResult(true);
1470 webView.PageLoadFinished += onLoadFinished;
1472 webView.LoadUrl(url);
1473 var result = await tcs.Task;
1474 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1476 webView.PageLoadFinished -= onLoadFinished;
1478 tlog.Debug(tag, $"WebViewGoForward END (OK)");
1483 [Description("WebView CanGoBack.")]
1484 [Property("SPEC", "Tizen.NUI.WebView.CanGoBack M")]
1485 [Property("SPEC_URL", "-")]
1486 [Property("CRITERIA", "MR")]
1487 [Property("COVPARAM", "")]
1488 [Property("AUTHOR", "guowei.wang@samsung.com")]
1489 public async Task WebViewCanGoBack()
1491 tlog.Debug(tag, $"WebViewCanGoBack START");
1493 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1494 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1496 if (webView.Url.Contains("index.html"))
1498 tlog.Info(tag, "onLoadFinished is called!");
1499 webView.LoadUrl(secondUrl);
1503 tlog.Info(tag, "onLoadFinished is called!");
1504 var canGo = webView.CanGoBack();
1505 tcs.TrySetResult(canGo);
1508 webView.PageLoadFinished += onLoadFinished;
1510 webView.LoadUrl(url);
1511 var result = await tcs.Task;
1512 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1514 webView.PageLoadFinished -= onLoadFinished;
1516 tlog.Debug(tag, $"WebViewCanGoBack END (OK)");
1521 [Description("WebView CanGoForward.")]
1522 [Property("SPEC", "Tizen.NUI.WebView.CanGoForward M")]
1523 [Property("SPEC_URL", "-")]
1524 [Property("CRITERIA", "MR")]
1525 [Property("COVPARAM", "")]
1526 [Property("AUTHOR", "guowei.wang@samsung.com")]
1527 public async Task WebViewCanGoForward()
1529 tlog.Debug(tag, $"WebViewCanGoForward START");
1531 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1532 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1534 if (webView.Url.Contains("index.html"))
1536 tlog.Info(tag, "onLoadFinished is called!");
1537 webView.LoadUrl(secondUrl);
1541 tlog.Info(tag, "onLoadFinished is called!");
1543 var canGo = webView.CanGoForward();
1544 tcs.TrySetResult(true);
1547 webView.PageLoadFinished += onLoadFinished;
1549 webView.LoadUrl(url);
1550 var result = await tcs.Task;
1551 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1553 webView.PageLoadFinished -= onLoadFinished;
1555 tlog.Debug(tag, $"WebViewCanGoForward END (OK)");
1560 [Description("WebView EvaluateJavaScript.")]
1561 [Property("SPEC", "Tizen.NUI.WebView.EvaluateJavaScript M")]
1562 [Property("SPEC_URL", "-")]
1563 [Property("CRITERIA", "MR")]
1564 [Property("COVPARAM", "")]
1565 [Property("AUTHOR", "guowei.wang@samsung.com")]
1566 public async Task WebViewEvaluateJavaScript()
1568 tlog.Debug(tag, $"WebViewEvaluateJavaScript START");
1570 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1571 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1573 tlog.Info(tag, "onLoadFinished is called!");
1574 webView.EvaluateJavaScript("<script type=\"text / javascript\">document.write(\"page\");</script>");
1575 tcs.TrySetResult(true);
1577 webView.PageLoadFinished += onLoadFinished;
1579 webView.LoadUrl(url);
1580 var result = await tcs.Task;
1581 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1583 webView.PageLoadFinished -= onLoadFinished;
1585 tlog.Debug(tag, $"WebViewEvaluateJavaScript END (OK)");
1590 [Description("WebView AddJavaScriptMessageHandler.")]
1591 [Property("SPEC", "Tizen.NUI.WebView.AddJavaScriptMessageHandler M")]
1592 [Property("SPEC_URL", "-")]
1593 [Property("CRITERIA", "MR")]
1594 [Property("COVPARAM", "")]
1595 [Property("AUTHOR", "guowei.wang@samsung.com")]
1596 public async Task WebViewAddJavaScriptMessageHandler()
1598 tlog.Debug(tag, $"WebViewAddJavaScriptMessageHandler START");
1600 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1601 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1603 tlog.Info(tag, "onLoadFinished is called!");
1604 webView.AddJavaScriptMessageHandler("AllowOrigin", JsCallback);
1605 tcs.TrySetResult(true);
1607 webView.PageLoadFinished += onLoadFinished;
1609 webView.LoadUrl(url);
1610 var result = await tcs.Task;
1611 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1613 webView.PageLoadFinished -= onLoadFinished;
1615 tlog.Debug(tag, $"WebViewAddJavaScriptMessageHandler END (OK)");
1620 [Description("WebView RegisterJavaScriptAlertCallback.")]
1621 [Property("SPEC", "Tizen.NUI.WebView.RegisterJavaScriptAlertCallback M")]
1622 [Property("SPEC_URL", "-")]
1623 [Property("CRITERIA", "MR")]
1624 [Property("COVPARAM", "")]
1625 [Property("AUTHOR", "guowei.wang@samsung.com")]
1626 public async Task WebViewRegisterJavaScriptAlertCallback()
1628 tlog.Debug(tag, $"WebViewRegisterJavaScriptAlertCallback START");
1630 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1631 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1633 tlog.Info(tag, "onLoadFinished is called!");
1634 tcs.TrySetResult(true);
1636 webView.PageLoadFinished += onLoadFinished;
1638 webView.RegisterJavaScriptAlertCallback(JsCallback);
1640 webView.LoadUrl(url);
1641 var result = await tcs.Task;
1642 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1644 webView.PageLoadFinished -= onLoadFinished;
1646 tlog.Debug(tag, $"WebViewRegisterJavaScriptAlertCallback END (OK)");
1651 [Description("WebView RegisterJavaScriptConfirmCallback.")]
1652 [Property("SPEC", "Tizen.NUI.WebView.RegisterJavaScriptConfirmCallback M")]
1653 [Property("SPEC_URL", "-")]
1654 [Property("CRITERIA", "MR")]
1655 [Property("COVPARAM", "")]
1656 [Property("AUTHOR", "guowei.wang@samsung.com")]
1657 public async Task WebViewRegisterJavaScriptConfirmCallback()
1659 tlog.Debug(tag, $"WebViewRegisterJavaScriptConfirmCallback START");
1661 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1662 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1664 tlog.Info(tag, "onLoadFinished is called!");
1665 tcs.TrySetResult(true);
1667 webView.PageLoadFinished += onLoadFinished;
1669 webView.RegisterJavaScriptConfirmCallback(JsCallback);
1671 webView.LoadUrl(url);
1672 var result = await tcs.Task;
1673 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1675 webView.PageLoadFinished -= onLoadFinished;
1677 tlog.Debug(tag, $"WebViewRegisterJavaScriptConfirmCallback END (OK)");
1682 [Description("WebView RegisterJavaScriptPromptCallback.")]
1683 [Property("SPEC", "Tizen.NUI.WebView.RegisterJavaScriptPromptCallback M")]
1684 [Property("SPEC_URL", "-")]
1685 [Property("CRITERIA", "MR")]
1686 [Property("COVPARAM", "")]
1687 [Property("AUTHOR", "guowei.wang@samsung.com")]
1688 public async Task WebViewRegisterJavaScriptPromptCallback()
1690 tlog.Debug(tag, $"WebViewRegisterJavaScriptPromptCallback START");
1692 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1693 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1695 tlog.Info(tag, "onLoadFinished is called!");
1696 tcs.TrySetResult(true);
1698 webView.PageLoadFinished += onLoadFinished;
1700 webView.RegisterJavaScriptPromptCallback(PromptCallback);
1702 webView.LoadUrl(url);
1703 var result = await tcs.Task;
1704 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1706 webView.PageLoadFinished -= onLoadFinished;
1708 tlog.Debug(tag, $"WebViewRegisterJavaScriptPromptCallback END (OK)");
1713 [Description("WebView ClearAllTilesResources.")]
1714 [Property("SPEC", "Tizen.NUI.WebView.ClearAllTilesResources M")]
1715 [Property("SPEC_URL", "-")]
1716 [Property("CRITERIA", "MR")]
1717 [Property("COVPARAM", "")]
1718 [Property("AUTHOR", "guowei.wang@samsung.com")]
1719 public async Task WebViewClearAllTilesResources()
1721 tlog.Debug(tag, $"WebViewClearAllTilesResources START");
1723 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1724 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1726 tlog.Info(tag, "onLoadFinished is called!");
1727 webView.ClearAllTilesResources();
1728 tcs.TrySetResult(true);
1730 webView.PageLoadFinished += onLoadFinished;
1732 webView.LoadUrl(url);
1733 var result = await tcs.Task;
1734 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1736 webView.PageLoadFinished -= onLoadFinished;
1738 tlog.Debug(tag, $"WebViewClearAllTilesResources END (OK)");
1743 [Description("WebView ClearHistory.")]
1744 [Property("SPEC", "Tizen.NUI.WebView.ClearHistory M")]
1745 [Property("SPEC_URL", "-")]
1746 [Property("CRITERIA", "MR")]
1747 [Property("COVPARAM", "")]
1748 [Property("AUTHOR", "guowei.wang@samsung.com")]
1749 public async Task WebViewClearHistory()
1751 tlog.Debug(tag, $"WebViewClearHistory START");
1753 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1754 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1756 tlog.Info(tag, "onLoadFinished is called!");
1757 webView.ClearHistory();
1758 tcs.TrySetResult(true);
1760 webView.PageLoadFinished += onLoadFinished;
1762 webView.LoadUrl(url);
1763 var result = await tcs.Task;
1764 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1766 webView.PageLoadFinished -= onLoadFinished;
1768 tlog.Debug(tag, $"WebViewClearHistory END (OK)");
1773 [Description("WebView SetScaleFactor.")]
1774 [Property("SPEC", "Tizen.NUI.WebView.SetScaleFactor M")]
1775 [Property("SPEC_URL", "-")]
1776 [Property("CRITERIA", "MR")]
1777 [Property("COVPARAM", "")]
1778 [Property("AUTHOR", "guowei.wang@samsung.com")]
1779 public async Task WebViewSetScaleFactor()
1781 tlog.Debug(tag, $"WebViewSetScaleFactor START");
1783 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1784 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1786 tlog.Info(tag, "onLoadFinished is called!");
1787 using (Vector2 point = new Vector2(1.0f, 1.0f))
1789 webView.SetScaleFactor(0.2f, point);
1791 var factor = webView.GetScaleFactor();
1792 tlog.Debug(tag, "ScaleFactor : " + factor);
1794 tcs.TrySetResult(true);
1796 webView.PageLoadFinished += onLoadFinished;
1798 webView.LoadUrl(url);
1799 var result = await tcs.Task;
1800 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1802 webView.PageLoadFinished -= onLoadFinished;
1804 tlog.Debug(tag, $"WebViewSetScaleFactor END (OK)");
1809 [Description("WebView ActivateAccessibility.")]
1810 [Property("SPEC", "Tizen.NUI.WebView.ActivateAccessibility M")]
1811 [Property("SPEC_URL", "-")]
1812 [Property("CRITERIA", "MR")]
1813 [Property("COVPARAM", "")]
1814 [Property("AUTHOR", "guowei.wang@samsung.com")]
1815 public async Task WebViewActivateAccessibility()
1817 tlog.Debug(tag, $"WebViewActivateAccessibility START");
1819 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1820 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1822 tlog.Info(tag, "onLoadFinished is called!");
1823 webView.ActivateAccessibility(false);
1824 tcs.TrySetResult(true);
1826 webView.PageLoadFinished += onLoadFinished;
1828 webView.LoadUrl(url);
1829 var result = await tcs.Task;
1830 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1832 webView.PageLoadFinished -= onLoadFinished;
1834 tlog.Debug(tag, $"WebViewActivateAccessibility END (OK)");
1839 [Description("WebView HighlightText.")]
1840 [Property("SPEC", "Tizen.NUI.WebView.HighlightText M")]
1841 [Property("SPEC_URL", "-")]
1842 [Property("CRITERIA", "MR")]
1843 [Property("COVPARAM", "")]
1844 [Property("AUTHOR", "guowei.wang@samsung.com")]
1845 public async Task WebViewHighlightText()
1847 tlog.Debug(tag, $"WebViewHighlightText START");
1849 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1850 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1852 tlog.Info(tag, "onLoadFinished is called!");
1853 webView.HighlightText("web", BaseComponents.WebView.FindOption.AtWordStart, 3);
1854 tcs.TrySetResult(true);
1856 webView.PageLoadFinished += onLoadFinished;
1858 webView.LoadUrl(url);
1859 var result = await tcs.Task;
1860 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1862 webView.PageLoadFinished -= onLoadFinished;
1864 tlog.Debug(tag, $"WebViewHighlightText END (OK)");
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()
1877 tlog.Debug(tag, $"WebViewAddDynamicCertificatePath START");
1879 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1880 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1882 tlog.Info(tag, "onLoadFinished is called!");
1883 webView.AddDynamicCertificatePath("127.0.0.0", "/");
1884 tcs.TrySetResult(true);
1886 webView.PageLoadFinished += onLoadFinished;
1888 webView.LoadUrl(url);
1889 var result = await tcs.Task;
1890 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1892 webView.PageLoadFinished -= onLoadFinished;
1894 tlog.Debug(tag, $"WebViewAddDynamicCertificatePath END (OK)");
1899 [Description("WebView CheckVideoPlayingAsynchronously.")]
1900 [Property("SPEC", "Tizen.NUI.WebView.CheckVideoPlayingAsynchronously M")]
1901 [Property("SPEC_URL", "-")]
1902 [Property("CRITERIA", "MR")]
1903 [Property("COVPARAM", "")]
1904 [Property("AUTHOR", "guowei.wang@samsung.com")]
1905 public async Task WebViewCheckVideoPlayingAsynchronously()
1907 tlog.Debug(tag, $"WebViewCheckVideoPlayingAsynchronously START");
1909 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1910 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1912 tlog.Info(tag, "onLoadFinished is called!");
1913 webView.CheckVideoPlayingAsynchronously(VideoCallback);
1914 tcs.TrySetResult(true);
1916 webView.PageLoadFinished += onLoadFinished;
1918 webView.LoadUrl(url);
1919 var result = await tcs.Task;
1920 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1922 webView.PageLoadFinished -= onLoadFinished;
1924 tlog.Debug(tag, $"WebViewCheckVideoPlayingAsynchronously END (OK)");
1929 [Description("WebView RegisterGeolocationPermissionCallback.")]
1930 [Property("SPEC", "Tizen.NUI.WebView.RegisterGeolocationPermissionCallback M")]
1931 [Property("SPEC_URL", "-")]
1932 [Property("CRITERIA", "MR")]
1933 [Property("COVPARAM", "")]
1934 [Property("AUTHOR", "guowei.wang@samsung.com")]
1935 public async Task WebViewRegisterGeolocationPermissionCallback()
1937 tlog.Debug(tag, $"WebViewRegisterGeolocationPermissionCallback START");
1939 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1940 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1942 tlog.Info(tag, "onLoadFinished is called!");
1943 tcs.TrySetResult(true);
1945 webView.PageLoadFinished += onLoadFinished;
1947 webView.RegisterGeolocationPermissionCallback(GeolocationCallback);
1949 webView.LoadUrl(url);
1950 var result = await tcs.Task;
1951 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1953 webView.PageLoadFinished -= onLoadFinished;
1955 tlog.Debug(tag, $"WebViewRegisterGeolocationPermissionCallback END (OK)");
1960 [Description("WebView GetPlainTextAsynchronously.")]
1961 [Property("SPEC", "Tizen.NUI.WebView.GetPlainTextAsynchronously M")]
1962 [Property("SPEC_URL", "-")]
1963 [Property("CRITERIA", "MR")]
1964 [Property("COVPARAM", "")]
1965 [Property("AUTHOR", "guowei.wang@samsung.com")]
1966 public async Task WebViewGetPlainTextAsynchronously()
1968 tlog.Debug(tag, $"WebViewGetPlainTextAsynchronously START");
1970 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1971 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1973 tlog.Info(tag, "onLoadFinished is called!");
1974 webView.GetPlainTextAsynchronously(PlainReceivedCallback);
1975 tcs.TrySetResult(true);
1977 webView.PageLoadFinished += onLoadFinished;
1979 webView.LoadUrl(url);
1980 var result = await tcs.Task;
1981 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1983 webView.PageLoadFinished -= onLoadFinished;
1985 tlog.Debug(tag, $"WebViewGetPlainTextAsynchronously END (OK)");
1990 [Description("WebView SetTtsFocus.")]
1991 [Property("SPEC", "Tizen.NUI.WebView.SetTtsFocus M")]
1992 [Property("SPEC_URL", "-")]
1993 [Property("CRITERIA", "MR")]
1994 [Property("COVPARAM", "")]
1995 [Property("AUTHOR", "guowei.wang@samsung.com")]
1996 public async Task WebViewSetTtsFocus()
1998 tlog.Debug(tag, $"WebViewSetTtsFocus START");
2000 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
2001 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
2003 tlog.Info(tag, "onLoadFinished is called!");
2004 webView.SetTtsFocus(false);
2005 tcs.TrySetResult(true);
2007 webView.PageLoadFinished += onLoadFinished;
2009 webView.LoadUrl(url);
2010 var result = await tcs.Task;
2011 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
2013 webView.PageLoadFinished -= onLoadFinished;
2015 tlog.Debug(tag, $"WebViewSetTtsFocus END (OK)");
2020 [Description("WebView GetScreenshot.")]
2021 [Property("SPEC", "Tizen.NUI.WebView.GetScreenshot M")]
2022 [Property("SPEC_URL", "-")]
2023 [Property("CRITERIA", "MR")]
2024 [Property("COVPARAM", "")]
2025 [Property("AUTHOR", "guowei.wang@samsung.com")]
2026 public async Task WebViewGetScreenshot()
2028 tlog.Debug(tag, $"WebViewGetScreenshot START");
2030 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
2031 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
2033 tlog.Info(tag, "onLoadFinished is called!");
2034 var factor = webView.GetScaleFactor();
2035 webView.GetScreenshot(new Rectangle(5, 6, 100, 200), factor);
2036 tcs.TrySetResult(true);
2038 webView.PageLoadFinished += onLoadFinished;
2040 webView.LoadUrl(url);
2041 var result = await tcs.Task;
2042 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
2044 webView.PageLoadFinished -= onLoadFinished;
2046 tlog.Debug(tag, $"WebViewGetScreenshot END (OK)");
2051 [Description("WebView GetScreenshotAsynchronously.")]
2052 [Property("SPEC", "Tizen.NUI.WebView.GetScreenshotAsynchronously M")]
2053 [Property("SPEC_URL", "-")]
2054 [Property("CRITERIA", "MR")]
2055 [Property("COVPARAM", "")]
2056 [Property("AUTHOR", "guowei.wang@samsung.com")]
2057 public async Task WebViewGetScreenshotAsynchronously()
2059 tlog.Debug(tag, $"WebViewGetScreenshotAsynchronously START");
2061 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
2062 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
2064 tlog.Info(tag, "onLoadFinished is called!");
2065 var factor = webView.GetScaleFactor();
2066 webView.GetScreenshotAsynchronously(new Rectangle(5, 6, 50, 50), factor, ScreenshotAcquiredCallbackCase);
2067 tcs.TrySetResult(true);
2069 webView.PageLoadFinished += onLoadFinished;
2071 webView.LoadUrl(url);
2072 var result = await tcs.Task;
2073 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
2075 webView.PageLoadFinished -= onLoadFinished;
2077 tlog.Debug(tag, $"WebViewGetScreenshotAsynchronously END (OK)");
2082 [Description("WebView EvaluateJavaScript.")]
2083 [Property("SPEC", "Tizen.NUI.WebView.EvaluateJavaScript M")]
2084 [Property("SPEC_URL", "-")]
2085 [Property("CRITERIA", "MR")]
2086 [Property("COVPARAM", "")]
2087 [Property("AUTHOR", "guowei.wang@samsung.com")]
2088 public async Task WebViewEvaluateJavaScriptWithCallback()
2090 tlog.Debug(tag, $"WebViewEvaluateJavaScriptWithCallback START");
2092 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
2093 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
2095 tlog.Info(tag, "onLoadFinished is called!");
2096 webView.EvaluateJavaScript("<script type=\"text / javascript\">document.write(\"page\");</script>", JsCallback);
2097 tcs.TrySetResult(true);
2099 webView.PageLoadFinished += onLoadFinished;
2101 webView.LoadUrl(url);
2102 var result = await tcs.Task;
2103 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
2105 webView.PageLoadFinished -= onLoadFinished;
2107 tlog.Debug(tag, $"WebViewEvaluateJavaScriptWithCallback END (OK)");
2112 [Description("WebView ClearCache.")]
2113 [Property("SPEC", "Tizen.NUI.WebView.ClearCache M")]
2114 [Property("SPEC_URL", "-")]
2115 [Property("CRITERIA", "MR")]
2116 [Property("COVPARAM", "")]
2117 [Property("AUTHOR", "guowei.wang@samsung.com")]
2118 public async Task WebViewClearCache()
2120 tlog.Debug(tag, $"WebViewClearCache START");
2122 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
2123 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
2125 tlog.Info(tag, "onLoadFinished is called!");
2126 webView.ClearCache();
2127 tcs.TrySetResult(true);
2129 webView.PageLoadFinished += onLoadFinished;
2131 webView.LoadUrl(url);
2132 var result = await tcs.Task;
2133 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
2135 webView.PageLoadFinished -= onLoadFinished;
2137 tlog.Debug(tag, $"WebViewClearCache END (OK)");
2142 [Description("WebView ClearCookies.")]
2143 [Property("SPEC", "Tizen.NUI.WebView.ClearCookies M")]
2144 [Property("SPEC_URL", "-")]
2145 [Property("CRITERIA", "MR")]
2146 [Property("COVPARAM", "")]
2147 [Property("AUTHOR", "guowei.wang@samsung.com")]
2148 public async Task WebViewClearCookies()
2150 tlog.Debug(tag, $"WebViewClearCookies START");
2152 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
2153 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
2155 tlog.Info(tag, "onLoadFinished is called!");
2156 webView.ClearCookies();
2157 tcs.TrySetResult(true);
2159 webView.PageLoadFinished += onLoadFinished;
2161 webView.LoadUrl(url);
2162 var result = await tcs.Task;
2163 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
2165 webView.PageLoadFinished -= onLoadFinished;
2167 tlog.Debug(tag, $"WebViewClearCookies END (OK)");
2172 [Description("WebView DownCast.")]
2173 [Property("SPEC", "Tizen.NUI.WebView.DownCast M")]
2174 [Property("SPEC_URL", "-")]
2175 [Property("CRITERIA", "MR")]
2176 [Property("COVPARAM", "")]
2177 [Property("AUTHOR", "guowei.wang@samsung.com")]
2178 public void WebViewDownCast()
2180 tlog.Debug(tag, $"WebViewDownCast START");
2184 BaseComponents.WebView.DownCast(webView);
2188 tlog.Debug(tag, e.Message.ToString());
2189 Assert.Fail("Caught Exception : Failed!");
2192 tlog.Debug(tag, $"WebViewDownCast END (OK)");
2197 [Description("WebView Assign.")]
2198 [Property("SPEC", "Tizen.NUI.WebView.Assign M")]
2199 [Property("SPEC_URL", "-")]
2200 [Property("CRITERIA", "MR")]
2201 [Property("COVPARAM", "")]
2202 [Property("AUTHOR", "guowei.wang@samsung.com")]
2203 public void WebViewAssign()
2205 tlog.Debug(tag, $"WebViewAssign START");
2209 webView.Assign(webView);
2213 tlog.Debug(tag, e.Message.ToString());
2214 Assert.Fail("Caught Exception : Failed!");
2217 tlog.Debug(tag, $"WebViewAssign END (OK)");
2222 [Description("WebView Dispose.")]
2223 [Property("SPEC", "Tizen.NUI.WebView.Dispose M")]
2224 [Property("SPEC_URL", "-")]
2225 [Property("CRITERIA", "MR")]
2226 [Property("COVPARAM", "")]
2227 [Property("AUTHOR", "guowei.wang@samsung.com")]
2228 public void WebViewDispose()
2230 tlog.Debug(tag, $"WebViewDispose START");
2232 var testingTarget = new MyWebView();
2233 Assert.IsNotNull(testingTarget, "null handle");
2234 Assert.IsInstanceOf<Tizen.NUI.BaseComponents.WebView>(testingTarget, "Should return WebView instance.");
2236 testingTarget.OnDispose(DisposeTypes.Explicit);
2238 testingTarget.OnDispose(DisposeTypes.Explicit);
2240 tlog.Debug(tag, $"WebViewDispose END (OK)");