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 = $"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";
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 : BaseComponents.WebView
37 public MyWebView() : base()
40 public void OnDispose(DisposeTypes type)
49 webView = new BaseComponents.WebView(runtimeArgs)
51 Size = new Size(150, 100),
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)");
199 [Description("WebView UrlChanged.")]
200 [Property("SPEC", "Tizen.NUI.WebView.UrlChanged E")]
201 [Property("SPEC_URL", "-")]
202 [Property("CRITERIA", "PRW")]
203 [Property("COVPARAM", "")]
204 [Property("AUTHOR", "guowei.wang@samsung.com")]
205 public async Task WebViewUrlChanged()
207 tlog.Debug(tag, $"WebViewUrlChanged START");
209 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
211 EventHandler<WebViewUrlChangedEventArgs> onUrlChange = (s, e) =>
213 tcs.TrySetResult(true);
215 webView.UrlChanged += onUrlChange;
217 webView.LoadUrl(url);
218 var result = await tcs.Task;
219 Assert.IsTrue(result, "UrlChanged event should be invoked");
221 webView.UrlChanged -= onUrlChange;
223 tlog.Debug(tag, $"WebViewUrlChanged END (OK)");
228 [Description("WebView FrameRendered.")]
229 [Property("SPEC", "Tizen.NUI.WebView.FrameRendered A")]
230 [Property("SPEC_URL", "-")]
231 [Property("CRITERIA", "PRW")]
232 [Property("COVPARAM", "")]
233 [Property("AUTHOR", "guowei.wang@samsung.com")]
234 public async Task WebViewFrameRendered()
236 tlog.Debug(tag, $"WebViewFrameRendered START");
238 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
239 EventHandler<EventArgs> onFrameRender = (s, e) => { tcs.TrySetResult(true); };
240 webView.FrameRendered += onFrameRender;
242 webView.LoadUrl(url);
243 var result = await tcs.Task;
244 Assert.IsTrue(result, "FrameRendered event should be invoked");
246 webView.FrameRendered -= onFrameRender;
248 tlog.Debug(tag, $"WebViewFrameRendered END (OK)");
253 [Description("WebView ResponsePolicyDecided.")]
254 [Property("SPEC", "Tizen.NUI.WebView.ResponsePolicyDecided A")]
255 [Property("SPEC_URL", "-")]
256 [Property("CRITERIA", "PRW")]
257 [Property("COVPARAM", "")]
258 [Property("AUTHOR", "guowei.wang@samsung.com")]
259 public async Task WebViewResponsePolicyDecided()
261 tlog.Debug(tag, $"WebViewResponsePolicyDecided START");
263 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
264 EventHandler<WebViewPolicyDecidedEventArgs> onResponsePolicyDecide = (s, e) => { tcs.TrySetResult(true); };
265 webView.ResponsePolicyDecided += onResponsePolicyDecide;
267 webView.LoadUrl(urlForResponsePolicyTest);
268 var result = await tcs.Task;
269 Assert.IsTrue(result, "ResponsePolicyDecided event should be invoked");
271 webView.ResponsePolicyDecided -= onResponsePolicyDecide;
273 tlog.Debug(tag, $"WebViewResponsePolicyDecided END (OK)");
278 [Description("WebView NavigationPolicyDecided.")]
279 [Property("SPEC", "Tizen.NUI.WebView.NavigationPolicyDecided A")]
280 [Property("SPEC_URL", "-")]
281 [Property("CRITERIA", "PRW")]
282 [Property("COVPARAM", "")]
283 [Property("AUTHOR", "guowei.wang@samsung.com")]
284 public async Task WebViewNavigationPolicyDecided()
286 tlog.Debug(tag, $"WebViewNavigationPolicyDecided START");
288 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
290 EventHandler<WebViewPolicyDecidedEventArgs> onNavigationPolicyDecided = (s, e) =>
292 tlog.Info(tag, "onNavigationPolicyDecided is being called!");
293 tcs.TrySetResult(true);
295 webView.NavigationPolicyDecided += onNavigationPolicyDecided;
297 webView.LoadUrl(urlForNavigationPolicyTest);
298 var result = await tcs.Task;
299 Assert.IsTrue(result, "NavigationPolicyDecided event should be invoked");
301 webView.NavigationPolicyDecided -= onNavigationPolicyDecided;
303 tlog.Debug(tag, $"WebViewNavigationPolicyDecided END (OK)");
308 [Description("WebView CertificateConfirmed.")]
309 [Property("SPEC", "Tizen.NUI.WebView.CertificateConfirmed A")]
310 [Property("SPEC_URL", "-")]
311 [Property("CRITERIA", "PRW")]
312 [Property("COVPARAM", "")]
313 [Property("AUTHOR", "guowei.wang@samsung.com")]
314 public async Task WebViewCertificateConfirmed()
316 tlog.Debug(tag, $"WebViewCertificateConfirmed START");
318 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
320 EventHandler<WebViewCertificateReceivedEventArgs> onCertificateConfirme = (s, e) =>
322 tlog.Info(tag, "CertificateConfirmed is being called!");
323 tcs.TrySetResult(true);
325 webView.CertificateConfirmed += onCertificateConfirme;
327 webView.LoadUrl(urlForCertificateConfirmTest);
328 var result = await tcs.Task;
329 Assert.IsTrue(result, "CertificateConfirmed event should be invoked");
331 webView.CertificateConfirmed -= onCertificateConfirme;
333 tlog.Debug(tag, $"WebViewCertificateConfirmed END (OK)");
338 [Description("WebView SslCertificateChanged.")]
339 [Property("SPEC", "Tizen.NUI.WebView.SslCertificateChanged A")]
340 [Property("SPEC_URL", "-")]
341 [Property("CRITERIA", "PRW")]
342 [Property("COVPARAM", "")]
343 [Property("AUTHOR", "guowei.wang@samsung.com")]
344 public async Task WebViewSslCertificateChanged()
346 tlog.Debug(tag, $"WebViewSslCertificateChanged START");
348 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
349 EventHandler<WebViewCertificateReceivedEventArgs> onSslCertificateChange = (s, e) => { tcs.TrySetResult(true); };
350 webView.SslCertificateChanged += onSslCertificateChange;
352 webView.LoadUrl(url);
353 var result = await tcs.Task;
354 Assert.IsTrue(result, "SslCertificateChanged event should be invoked");
356 webView.SslCertificateChanged -= onSslCertificateChange;
358 tlog.Debug(tag, $"WebViewSslCertificateChanged END (OK)");
361 //TODO... it seems that web engine does not implement it.
364 //[Description("WebView HttpAuthRequested.")]
365 //[Property("SPEC", "Tizen.NUI.WebView.HttpAuthRequested A")]
366 //[Property("SPEC_URL", "-")]
367 //[Property("CRITERIA", "PRW")]
368 //[Property("COVPARAM", "")]
369 //[Property("AUTHOR", "guowei.wang@samsung.com")]
370 //public async Task WebViewHttpAuthRequested()
372 // tlog.Debug(tag, $"WebViewHttpAuthRequested START");
374 // TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
375 // EventHandler<WebViewHttpAuthRequestedEventArgs> onHttpAuthRequeste = (s, e) => { tcs.TrySetResult(true); };
376 // webView.HttpAuthRequested += onHttpAuthRequeste;
378 // webView.LoadUrl(urlForHttpAuthRequestTest);
379 // var result = await tcs.Task;
380 // Assert.IsTrue(result, "ResponsePolicyDecided event should be invoked");
382 // webView.HttpAuthRequested -= onHttpAuthRequeste;
384 // tlog.Debug(tag, $"WebViewHttpAuthRequested END (OK)");
389 [Description("WebView ConsoleMessageReceived.")]
390 [Property("SPEC", "Tizen.NUI.WebView.ConsoleMessageReceived A")]
391 [Property("SPEC_URL", "-")]
392 [Property("CRITERIA", "PRW")]
393 [Property("COVPARAM", "")]
394 [Property("AUTHOR", "guowei.wang@samsung.com")]
395 public async Task WebViewConsoleMessageReceived()
397 tlog.Debug(tag, $"WebViewConsoleMessageReceived START");
399 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
400 EventHandler<WebViewConsoleMessageReceivedEventArgs> onConsoleMessageReceive = (s, e) => { tcs.TrySetResult(true); };
401 webView.ConsoleMessageReceived += onConsoleMessageReceive;
403 webView.LoadUrl(urlForConsoleMessageTest);
404 var result = await tcs.Task;
405 Assert.IsTrue(result, "ConsoleMessageReceived event should be invoked");
407 webView.ConsoleMessageReceived -= onConsoleMessageReceive;
409 tlog.Debug(tag, $"WebViewConsoleMessageReceived END (OK)");
414 [Description("WebView BackForwardList.")]
415 [Property("SPEC", "Tizen.NUI.WebView.BackForwardList A")]
416 [Property("SPEC_URL", "-")]
417 [Property("CRITERIA", "PRO")]
418 [Property("COVPARAM", "")]
419 [Property("AUTHOR", "guowei.wang@samsung.com")]
420 public void WebViewBackForwardList()
422 tlog.Debug(tag, $"WebViewBackForwardList START");
424 var result = webView.BackForwardList;
425 tlog.Debug(tag, "ForwardList : " + result);
427 tlog.Debug(tag, $"WebViewBackForwardList END (OK)");
432 [Description("WebView Context.")]
433 [Property("SPEC", "Tizen.NUI.WebView.Context A")]
434 [Property("SPEC_URL", "-")]
435 [Property("CRITERIA", "PRO")]
436 [Property("COVPARAM", "")]
437 [Property("AUTHOR", "guowei.wang@samsung.com")]
438 public void WebViewContext()
440 tlog.Debug(tag, $"WebViewContext START");
442 var result = webView.Context;
443 tlog.Debug(tag, "Context : " + result);
445 tlog.Debug(tag, $"WebViewContext END (OK)");
450 [Description("WebView CookieManager.")]
451 [Property("SPEC", "Tizen.NUI.WebView.CookieManager A")]
452 [Property("SPEC_URL", "-")]
453 [Property("CRITERIA", "PRO")]
454 [Property("COVPARAM", "")]
455 [Property("AUTHOR", "guowei.wang@samsung.com")]
456 public void WebViewCookieManager()
458 tlog.Debug(tag, $"WebViewCookieManager START");
460 var result = webView.CookieManager;
461 tlog.Debug(tag, "CookieManager : " + result);
463 tlog.Debug(tag, $"WebViewCookieManager END (OK)");
468 [Description("WebView Settings.")]
469 [Property("SPEC", "Tizen.NUI.WebView.Settings A")]
470 [Property("SPEC_URL", "-")]
471 [Property("CRITERIA", "PRO")]
472 [Property("COVPARAM", "")]
473 [Property("AUTHOR", "guowei.wang@samsung.com")]
474 public void WebViewSettings()
476 tlog.Debug(tag, $"WebViewSettings START");
478 var result = webView.Settings;
479 tlog.Debug(tag, "Settings : " + result);
481 tlog.Debug(tag, $"WebViewSettings END (OK)");
486 [Description("WebView Url.")]
487 [Property("SPEC", "Tizen.NUI.WebView.Url A")]
488 [Property("SPEC_URL", "-")]
489 [Property("CRITERIA", "PRW")]
490 [Property("COVPARAM", "")]
491 [Property("AUTHOR", "guowei.wang@samsung.com")]
492 public async Task WebViewUrl()
494 tlog.Debug(tag, $"WebViewUrl START");
495 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
496 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
498 tcs.TrySetResult(true);
500 webView.PageLoadFinished += onLoadFinished;
503 var result = await tcs.Task;
504 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
506 webView.PageLoadFinished -= onLoadFinished;
508 tlog.Debug(tag, "Url : " + webView.Url);
509 tlog.Debug(tag, $"WebViewUrl END (OK)");
514 [Description("WebView CacheModel.")]
515 [Property("SPEC", "Tizen.NUI.WebView.CacheModel A")]
516 [Property("SPEC_URL", "-")]
517 [Property("CRITERIA", "PRW")]
518 [Property("COVPARAM", "")]
519 [Property("AUTHOR", "guowei.wang@samsung.com")]
520 public void WebViewCacheModel()
522 tlog.Debug(tag, $"WebViewCacheModel START");
524 webView.CacheModel = Tizen.NUI.CacheModel.DocumentViewer;
525 tlog.Debug(tag, "CacheModel : " + webView.CacheModel);
527 webView.CacheModel = Tizen.NUI.CacheModel.DocumentBrowser;
528 tlog.Debug(tag, "CacheModel : " + webView.CacheModel);
530 webView.CacheModel = Tizen.NUI.CacheModel.PrimaryWebBrowser;
531 tlog.Debug(tag, "CacheModel : " + webView.CacheModel);
533 tlog.Debug(tag, $"WebViewCacheModel END (OK)");
538 [Description("WebView CookieAcceptPolicy.")]
539 [Property("SPEC", "Tizen.NUI.WebView.CookieAcceptPolicy A")]
540 [Property("SPEC_URL", "-")]
541 [Property("CRITERIA", "PRW")]
542 [Property("COVPARAM", "")]
543 [Property("AUTHOR", "guowei.wang@samsung.com")]
544 public void WebViewCookieAcceptPolicy()
546 tlog.Debug(tag, $"WebViewCookieAcceptPolicy START");
548 webView.CookieAcceptPolicy = (CookieAcceptPolicy)Tizen.NUI.WebCookieManager.CookieAcceptPolicyType.NoThirdParty;
549 tlog.Debug(tag, "CookieAcceptPolicy : " + webView.CookieAcceptPolicy);
551 webView.CookieAcceptPolicy = (CookieAcceptPolicy)Tizen.NUI.WebCookieManager.CookieAcceptPolicyType.Always;
552 tlog.Debug(tag, "CookieAcceptPolicy : " + webView.CookieAcceptPolicy);
554 webView.CookieAcceptPolicy = (CookieAcceptPolicy)Tizen.NUI.WebCookieManager.CookieAcceptPolicyType.Never;
555 tlog.Debug(tag, "CookieAcceptPolicy : " + webView.CookieAcceptPolicy);
557 tlog.Debug(tag, $"WebViewCookieAcceptPolicy END (OK)");
562 [Description("WebView UserAgent.")]
563 [Property("SPEC", "Tizen.NUI.WebView.UserAgent A")]
564 [Property("SPEC_URL", "-")]
565 [Property("CRITERIA", "PRW")]
566 [Property("COVPARAM", "")]
567 [Property("AUTHOR", "guowei.wang@samsung.com")]
568 public async Task WebViewUserAgent()
570 tlog.Debug(tag, $"WebViewUserAgent START");
572 webView.UserAgent = USER_AGENT;
573 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
574 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
576 tcs.TrySetResult(true);
578 webView.PageLoadFinished += onLoadFinished;
579 webView.LoadUrl(url);
580 var result = await tcs.Task;
581 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
583 webView.PageLoadFinished -= onLoadFinished;
585 tlog.Debug(tag, "UserAgent : " + webView.UserAgent);
586 tlog.Debug(tag, $"WebViewUserAgent END (OK)");
591 [Description("WebView EnableJavaScript.")]
592 [Property("SPEC", "Tizen.NUI.WebView.EnableJavaScript A")]
593 [Property("SPEC_URL", "-")]
594 [Property("CRITERIA", "PRW")]
595 [Property("COVPARAM", "")]
596 [Property("AUTHOR", "guowei.wang@samsung.com")]
597 public void WebViewEnableJavaScript()
599 tlog.Debug(tag, $"WebViewEnableJavaScript START");
601 webView.EnableJavaScript = true;
602 tlog.Debug(tag, "EnableJavaScript : " + webView.EnableJavaScript);
604 webView.EnableJavaScript = false;
605 tlog.Debug(tag, "EnableJavaScript : " + webView.EnableJavaScript);
607 tlog.Debug(tag, $"WebViewEnableJavaScript END (OK)");
612 [Description("WebView LoadImagesAutomatically.")]
613 [Property("SPEC", "Tizen.NUI.WebView.LoadImagesAutomatically A")]
614 [Property("SPEC_URL", "-")]
615 [Property("CRITERIA", "PRW")]
616 [Property("COVPARAM", "")]
617 [Property("AUTHOR", "guowei.wang@samsung.com")]
618 public void WebViewLoadImagesAutomatically()
620 tlog.Debug(tag, $"WebViewLoadImagesAutomatically START");
622 webView.LoadImagesAutomatically = true;
623 tlog.Debug(tag, "LoadImagesAutomatically : " + webView.LoadImagesAutomatically);
625 webView.LoadImagesAutomatically = false;
626 tlog.Debug(tag, "LoadImagesAutomatically : " + webView.LoadImagesAutomatically);
628 tlog.Debug(tag, $"WebViewLoadImagesAutomatically END (OK)");
633 [Description("WebView DefaultTextEncodingName.")]
634 [Property("SPEC", "Tizen.NUI.WebView.DefaultTextEncodingName A")]
635 [Property("SPEC_URL", "-")]
636 [Property("CRITERIA", "PRW")]
637 [Property("COVPARAM", "")]
638 [Property("AUTHOR", "guowei.wang@samsung.com")]
639 public void WebViewDefaultTextEncodingName()
641 tlog.Debug(tag, $"WebViewDefaultTextEncodingName START");
643 var result = webView.DefaultTextEncodingName;
644 tlog.Debug(tag, "DefaultTextEncodingName : " + result);
646 webView.DefaultTextEncodingName = "gbk";
647 tlog.Debug(tag, "DefaultTextEncodingName : " + result);
649 tlog.Debug(tag, $"WebViewDefaultTextEncodingName END (OK)");
654 [Description("WebView DefaultFontSize.")]
655 [Property("SPEC", "Tizen.NUI.WebView.DefaultFontSize A")]
656 [Property("SPEC_URL", "-")]
657 [Property("CRITERIA", "PRW")]
658 [Property("COVPARAM", "")]
659 [Property("AUTHOR", "guowei.wang@samsung.com")]
660 public void WebViewDefaultFontSize()
662 tlog.Debug(tag, $"WebViewDefaultFontSize START");
664 var result = webView.DefaultFontSize;
665 tlog.Debug(tag, "DefaultFontSize : " + result);
667 webView.DefaultFontSize = 32;
668 tlog.Debug(tag, "DefaultFontSize : " + result);
670 tlog.Debug(tag, $"WebViewDefaultFontSize END (OK)");
675 [Description("WebView ScrollSize.")]
676 [Property("SPEC", "Tizen.NUI.WebView.ScrollSize A")]
677 [Property("SPEC_URL", "-")]
678 [Property("CRITERIA", "PRO")]
679 [Property("COVPARAM", "")]
680 [Property("AUTHOR", "guowei.wang@samsung.com")]
681 public void WebViewScrollSize()
683 tlog.Debug(tag, $"WebViewScrollSize START");
685 tlog.Debug(tag, "Width : " + webView.ScrollSize.Width);
686 tlog.Debug(tag, "Height : " + webView.ScrollSize.Height);
688 tlog.Debug(tag, $"WebViewScrollSize END (OK)");
693 [Description("WebView ContentSize.")]
694 [Property("SPEC", "Tizen.NUI.WebView.ContentSize A")]
695 [Property("SPEC_URL", "-")]
696 [Property("CRITERIA", "PRO")]
697 [Property("COVPARAM", "")]
698 [Property("AUTHOR", "guowei.wang@samsung.com")]
699 public void WebViewContentSize()
701 tlog.Debug(tag, $"WebViewContentSize START");
703 tlog.Debug(tag, "Width : " + webView.ContentSize.Width);
704 tlog.Debug(tag, "Height : " + webView.ContentSize.Height);
706 tlog.Debug(tag, $"WebViewContentSize END (OK)");
711 [Description("WebView VideoHoleEnabled.")]
712 [Property("SPEC", "Tizen.NUI.WebView.VideoHoleEnabled A")]
713 [Property("SPEC_URL", "-")]
714 [Property("CRITERIA", "PRW")]
715 [Property("COVPARAM", "")]
716 [Property("AUTHOR", "guowei.wang@samsung.com")]
717 public void WebViewVideoHoleEnabled()
719 tlog.Debug(tag, $"WebViewVideoHoleEnabled START");
721 webView.VideoHoleEnabled = true;
722 tlog.Debug(tag, "VideoHoleEnabled : " + webView.VideoHoleEnabled);
724 webView.VideoHoleEnabled = false;
725 tlog.Debug(tag, "VideoHoleEnabled : " + webView.VideoHoleEnabled);
727 tlog.Debug(tag, $"WebViewVideoHoleEnabled END (OK)");
732 [Description("WebView MouseEventsEnabled.")]
733 [Property("SPEC", "Tizen.NUI.WebView.MouseEventsEnabled A")]
734 [Property("SPEC_URL", "-")]
735 [Property("CRITERIA", "PRW")]
736 [Property("COVPARAM", "")]
737 [Property("AUTHOR", "guowei.wang@samsung.com")]
738 public void WebViewMouseEventsEnabled()
740 tlog.Debug(tag, $"WebViewMouseEventsEnabled START");
742 webView.MouseEventsEnabled = true;
743 tlog.Debug(tag, "MouseEventsEnabled : " + webView.MouseEventsEnabled);
745 webView.MouseEventsEnabled = false;
746 tlog.Debug(tag, "MouseEventsEnabled : " + webView.MouseEventsEnabled);
748 tlog.Debug(tag, $"WebViewMouseEventsEnabled END (OK)");
753 [Description("WebView KeyEventsEnabled.")]
754 [Property("SPEC", "Tizen.NUI.WebView.KeyEventsEnabled A")]
755 [Property("SPEC_URL", "-")]
756 [Property("CRITERIA", "PRW")]
757 [Property("COVPARAM", "")]
758 [Property("AUTHOR", "guowei.wang@samsung.com")]
759 public void WebViewKeyEventsEnabled()
761 tlog.Debug(tag, $"WebViewKeyEventsEnabled START");
763 webView.KeyEventsEnabled = true;
764 tlog.Debug(tag, "KeyEventsEnabled : " + webView.KeyEventsEnabled);
766 webView.KeyEventsEnabled = false;
767 tlog.Debug(tag, "KeyEventsEnabled : " + webView.KeyEventsEnabled);
769 tlog.Debug(tag, $"WebViewKeyEventsEnabled END (OK)");
774 [Description("WebView ContentBackgroundColor.")]
775 [Property("SPEC", "Tizen.NUI.WebView.ContentBackgroundColor A")]
776 [Property("SPEC_URL", "-")]
777 [Property("CRITERIA", "PRW")]
778 [Property("COVPARAM", "")]
779 [Property("AUTHOR", "guowei.wang@samsung.com")]
780 public async Task WebViewContentBackgroundColor()
782 tlog.Debug(tag, $"WebViewContentBackgroundColor START");
784 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
785 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
787 webView.ContentBackgroundColor = new Vector4(0.3f, 0.5f, 1.0f, 0.0f);
788 tcs.TrySetResult(true);
790 webView.PageLoadFinished += onLoadFinished;
791 webView.LoadUrl(url);
792 var result = await tcs.Task;
793 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
795 webView.PageLoadFinished -= onLoadFinished;
797 tlog.Debug(tag, "ContentBackgroundColor : " + webView.ContentBackgroundColor);
799 tlog.Debug(tag, $"WebViewContentBackgroundColor END (OK)");
804 [Description("WebView TilesClearedWhenHidden.")]
805 [Property("SPEC", "Tizen.NUI.WebView.TilesClearedWhenHidden A")]
806 [Property("SPEC_URL", "-")]
807 [Property("CRITERIA", "PRW")]
808 [Property("COVPARAM", "")]
809 [Property("AUTHOR", "guowei.wang@samsung.com")]
810 public void WebViewTilesClearedWhenHidden()
812 tlog.Debug(tag, $"WebViewTilesClearedWhenHidden START");
814 webView.TilesClearedWhenHidden = true;
815 tlog.Debug(tag, "TilesClearedWhenHidden : " + webView.TilesClearedWhenHidden);
817 webView.TilesClearedWhenHidden = false;
818 tlog.Debug(tag, "TilesClearedWhenHidden : " + webView.TilesClearedWhenHidden);
820 tlog.Debug(tag, $"WebViewTilesClearedWhenHidden END (OK)");
825 [Description("WebView TileCoverAreaMultiplier.")]
826 [Property("SPEC", "Tizen.NUI.WebView.TileCoverAreaMultiplier A")]
827 [Property("SPEC_URL", "-")]
828 [Property("CRITERIA", "PRW")]
829 [Property("COVPARAM", "")]
830 [Property("AUTHOR", "guowei.wang@samsung.com")]
831 public void WebViewTileCoverAreaMultiplier()
833 tlog.Debug(tag, $"WebViewTileCoverAreaMultiplier START");
835 webView.TileCoverAreaMultiplier = 0.3f;
836 tlog.Debug(tag, "TileCoverAreaMultiplier : " + webView.TileCoverAreaMultiplier);
838 tlog.Debug(tag, $"WebViewTileCoverAreaMultiplier END (OK)");
843 [Description("WebView CursorEnabledByClient.")]
844 [Property("SPEC", "Tizen.NUI.WebView.CursorEnabledByClient A")]
845 [Property("SPEC_URL", "-")]
846 [Property("CRITERIA", "PRW")]
847 [Property("COVPARAM", "")]
848 [Property("AUTHOR", "guowei.wang@samsung.com")]
849 public void WebViewCursorEnabledByClient()
851 tlog.Debug(tag, $"WebViewCursorEnabledByClient START");
853 webView.CursorEnabledByClient = true;
854 tlog.Debug(tag, "CursorEnabledByClient : " + webView.CursorEnabledByClient);
856 webView.CursorEnabledByClient = false;
857 tlog.Debug(tag, "CursorEnabledByClient : " + webView.CursorEnabledByClient);
859 tlog.Debug(tag, $"WebViewCursorEnabledByClient END (OK)");
864 [Description("WebView SelectedText.")]
865 [Property("SPEC", "Tizen.NUI.WebView.SelectedText A")]
866 [Property("SPEC_URL", "-")]
867 [Property("CRITERIA", "PRO")]
868 [Property("COVPARAM", "")]
869 [Property("AUTHOR", "guowei.wang@samsung.com")]
870 public void WebViewSelectedText()
872 tlog.Debug(tag, $"WebViewSelectedText START");
874 var text = webView.SelectedText;
875 tlog.Debug(tag, "SelectedText : " + text);
877 tlog.Debug(tag, $"WebViewSelectedText END (OK)");
882 [Description("WebView Title.")]
883 [Property("SPEC", "Tizen.NUI.WebView.Title A")]
884 [Property("SPEC_URL", "-")]
885 [Property("CRITERIA", "PRO")]
886 [Property("COVPARAM", "")]
887 [Property("AUTHOR", "guowei.wang@samsung.com")]
888 public void WebViewTitle()
890 tlog.Debug(tag, $"WebViewTitle START");
892 var title = webView.Title;
893 tlog.Debug(tag, "Title : " + title);
895 tlog.Debug(tag, $"WebViewTitle END (OK)");
900 [Description("WebView Favicon.")]
901 [Property("SPEC", "Tizen.NUI.WebView.Favicon A")]
902 [Property("SPEC_URL", "-")]
903 [Property("CRITERIA", "PRO")]
904 [Property("COVPARAM", "")]
905 [Property("AUTHOR", "guowei.wang@samsung.com")]
906 public void WebViewFavicon()
908 tlog.Debug(tag, $"WebViewFavicon START");
910 var fav = webView.Favicon;
911 tlog.Debug(tag, "Favicon : " + fav);
913 tlog.Debug(tag, $"WebViewFavicon END (OK)");
918 [Description("WebView PageZoomFactor.")]
919 [Property("SPEC", "Tizen.NUI.WebView.PageZoomFactor A")]
920 [Property("SPEC_URL", "-")]
921 [Property("CRITERIA", "PRW")]
922 [Property("COVPARAM", "")]
923 [Property("AUTHOR", "guowei.wang@samsung.com")]
924 public void WebViewPageZoomFactor()
926 tlog.Debug(tag, $"WebViewPageZoomFactor START");
928 webView.PageZoomFactor = 0.3f;
929 tlog.Debug(tag, "PageZoomFactor : " + webView.PageZoomFactor);
931 tlog.Debug(tag, $"WebViewPageZoomFactor END (OK)");
936 [Description("WebView TextZoomFactor.")]
937 [Property("SPEC", "Tizen.NUI.WebView.TextZoomFactor A")]
938 [Property("SPEC_URL", "-")]
939 [Property("CRITERIA", "PRW")]
940 [Property("COVPARAM", "")]
941 [Property("AUTHOR", "guowei.wang@samsung.com")]
942 public void WebViewTextZoomFactor()
944 tlog.Debug(tag, $"WebViewTextZoomFactor START");
946 webView.TextZoomFactor = 0.2f;
947 tlog.Debug(tag, "TextZoomFactor : " + webView.TextZoomFactor);
949 tlog.Debug(tag, $"WebViewTextZoomFactor END (OK)");
954 [Description("WebView LoadProgressPercentage.")]
955 [Property("SPEC", "Tizen.NUI.WebView.LoadProgressPercentage A")]
956 [Property("SPEC_URL", "-")]
957 [Property("CRITERIA", "PRO")]
958 [Property("COVPARAM", "")]
959 [Property("AUTHOR", "guowei.wang@samsung.com")]
960 public void WebViewLoadProgressPercentage()
962 tlog.Debug(tag, $"WebViewLoadProgressPercentage START");
964 var result = webView.LoadProgressPercentage;
965 tlog.Debug(tag, "LoadProgressPercentage : " + result);
967 tlog.Debug(tag, $"WebViewLoadProgressPercentage END (OK)");
972 [Description("WebView LoadHtmlString.")]
973 [Property("SPEC", "Tizen.NUI.WebView.LoadHtmlString M")]
974 [Property("SPEC_URL", "-")]
975 [Property("CRITERIA", "MR")]
976 [Property("COVPARAM", "")]
977 [Property("AUTHOR", "guowei.wang@samsung.com")]
978 public async Task WebViewLoadHtmlString()
980 tlog.Debug(tag, $"WebViewLoadHtmlString START");
982 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
983 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
985 tlog.Info(tag, "onLoadFinished is called!");
986 tcs.TrySetResult(true);
988 webView.PageLoadFinished += onLoadFinished;
990 webView.LoadHtmlString("<html><head lang=\"en\"></head></html>");
992 var result = await tcs.Task;
993 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
995 webView.PageLoadFinished -= onLoadFinished;
997 tlog.Debug(tag, $"WebViewLoadHtmlString END (OK)");
1002 [Description("WebView LoadHTMLString.")]
1003 [Property("SPEC", "Tizen.NUI.WebView.LoadHTMLString M")]
1004 [Property("SPEC_URL", "-")]
1005 [Property("CRITERIA", "MR")]
1006 [Property("COVPARAM", "")]
1007 [Property("AUTHOR", "guowei.wang@samsung.com")]
1008 public async Task WebViewLoadHTMLString()
1010 tlog.Debug(tag, $"WebViewLoadHTMLString START");
1012 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1013 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1015 tlog.Info(tag, "onLoadFinished is called!");
1016 tcs.TrySetResult(true);
1018 webView.PageLoadFinished += onLoadFinished;
1020 webView.LoadHTMLString("<html><head lang=\"en\"></head></html>");
1022 var result = await tcs.Task;
1023 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1025 webView.PageLoadFinished -= onLoadFinished;
1027 tlog.Debug(tag, $"WebViewLoadHTMLString END (OK)");
1032 [Description("WebView LoadContents.")]
1033 [Property("SPEC", "Tizen.NUI.WebView.LoadContents M")]
1034 [Property("SPEC_URL", "-")]
1035 [Property("CRITERIA", "MR")]
1036 [Property("COVPARAM", "")]
1037 [Property("AUTHOR", "guowei.wang@samsung.com")]
1038 public async Task WebViewLoadContents()
1040 tlog.Debug(tag, $"WebViewLoadContents START");
1042 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1043 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1045 tlog.Info(tag, "onLoadFinished is called!");
1046 tcs.TrySetResult(true);
1048 webView.PageLoadFinished += onLoadFinished;
1050 webView.LoadContents("body", 18, " ", "gbk", null);
1052 var result = await tcs.Task;
1053 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1055 webView.PageLoadFinished -= onLoadFinished;
1057 tlog.Debug(tag, $"WebViewLoadContents END (OK)");
1062 [Description("WebView Reload.")]
1063 [Property("SPEC", "Tizen.NUI.WebView.Reload M")]
1064 [Property("SPEC_URL", "-")]
1065 [Property("CRITERIA", "MR")]
1066 [Property("COVPARAM", "")]
1067 [Property("AUTHOR", "guowei.wang@samsung.com")]
1068 public async Task WebViewReload()
1070 tlog.Debug(tag, $"WebViewReload START");
1072 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1073 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1075 tlog.Info(tag, "onLoadFinished is called!");
1077 tcs.TrySetResult(true);
1079 webView.PageLoadFinished += onLoadFinished;
1081 webView.LoadUrl(url);
1083 var result = await tcs.Task;
1084 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1086 webView.PageLoadFinished -= onLoadFinished;
1088 tlog.Debug(tag, $"WebViewReload END (OK)");
1093 [Description("WebView ReloadWithoutCache.")]
1094 [Property("SPEC", "Tizen.NUI.WebView.ReloadWithoutCache M")]
1095 [Property("SPEC_URL", "-")]
1096 [Property("CRITERIA", "MR")]
1097 [Property("COVPARAM", "")]
1098 [Property("AUTHOR", "guowei.wang@samsung.com")]
1099 public async Task WebViewReloadWithoutCache()
1101 tlog.Debug(tag, $"WebViewReloadWithoutCache START");
1103 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1104 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1106 tlog.Info(tag, "onLoadFinished is called!");
1107 webView.ReloadWithoutCache();
1108 tcs.TrySetResult(true);
1110 webView.PageLoadFinished += onLoadFinished;
1112 webView.LoadUrl(url);
1114 var result = await tcs.Task;
1115 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1117 webView.PageLoadFinished -= onLoadFinished;
1119 tlog.Debug(tag, $"WebViewReloadWithoutCache END (OK)");
1124 [Description("WebView StopLoading.")]
1125 [Property("SPEC", "Tizen.NUI.WebView.StopLoading M")]
1126 [Property("SPEC_URL", "-")]
1127 [Property("CRITERIA", "MR")]
1128 [Property("COVPARAM", "")]
1129 [Property("AUTHOR", "guowei.wang@samsung.com")]
1130 public async Task WebViewStopLoading()
1132 tlog.Debug(tag, $"WebViewStopLoading START");
1134 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1135 EventHandler<WebViewPageLoadEventArgs> onLoadStarted = (s, e) =>
1137 tlog.Info(tag, "onLoadFinished is called!");
1138 webView.StopLoading();
1139 tcs.TrySetResult(true);
1141 webView.PageLoadStarted += onLoadStarted;
1143 webView.LoadUrl(url);
1145 var result = await tcs.Task;
1146 Assert.IsTrue(result, "PageLoadStarted event should be invoked");
1148 webView.PageLoadStarted -= onLoadStarted;
1150 tlog.Debug(tag, $"WebViewStopLoading END (OK)");
1155 [Description("WebView Suspend.")]
1156 [Property("SPEC", "Tizen.NUI.WebView.Suspend M")]
1157 [Property("SPEC_URL", "-")]
1158 [Property("CRITERIA", "MR")]
1159 [Property("COVPARAM", "")]
1160 [Property("AUTHOR", "guowei.wang@samsung.com")]
1161 public async Task WebViewSuspend()
1163 tlog.Debug(tag, $"WebViewSuspend START");
1165 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1166 EventHandler<WebViewPageLoadEventArgs> onLoadStarted = (s, e) =>
1168 tlog.Info(tag, "onLoadStarted is called!");
1171 webView.PageLoadStarted += onLoadStarted;
1173 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1175 tlog.Info(tag, "onLoadFinished is called!");
1177 tcs.TrySetResult(true);
1179 webView.PageLoadFinished += onLoadFinished;
1181 webView.LoadUrl(url);
1183 var result = await tcs.Task;
1184 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1186 webView.PageLoadStarted -= onLoadStarted;
1187 webView.PageLoadFinished -= onLoadFinished;
1189 tlog.Debug(tag, $"WebViewSuspend END (OK)");
1194 [Description("WebView SuspendNetworkLoading.")]
1195 [Property("SPEC", "Tizen.NUI.WebView.SuspendNetworkLoading M")]
1196 [Property("SPEC_URL", "-")]
1197 [Property("CRITERIA", "MR")]
1198 [Property("COVPARAM", "")]
1199 [Property("AUTHOR", "guowei.wang@samsung.com")]
1200 public async Task WebViewSuspendNetworkLoading()
1202 tlog.Debug(tag, $"WebViewSuspendNetworkLoading START");
1204 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1205 EventHandler<WebViewPageLoadEventArgs> onLoadStarted = (s, e) =>
1207 tlog.Info(tag, "onLoadStarted is called!");
1208 webView.SuspendNetworkLoading();
1210 webView.PageLoadStarted += onLoadStarted;
1212 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1214 tlog.Info(tag, "onLoadFinished is called!");
1215 webView.ResumeNetworkLoading();
1216 tcs.TrySetResult(true);
1218 webView.PageLoadFinished += onLoadFinished;
1220 webView.LoadUrl(url);
1222 var result = await tcs.Task;
1223 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1225 webView.PageLoadStarted -= onLoadStarted;
1226 webView.PageLoadFinished -= onLoadFinished;
1228 tlog.Debug(tag, $"WebViewSuspendNetworkLoading END (OK)");
1233 [Description("WebView AddCustomHeader.")]
1234 [Property("SPEC", "Tizen.NUI.WebView.AddCustomHeader M")]
1235 [Property("SPEC_URL", "-")]
1236 [Property("CRITERIA", "MR")]
1237 [Property("COVPARAM", "")]
1238 [Property("AUTHOR", "guowei.wang@samsung.com")]
1239 public void WebViewAddCustomHeader()
1241 tlog.Debug(tag, $"WebViewAddCustomHeader START");
1243 var result = webView.AddCustomHeader("customHeader_title", "font-size: 32rpx");
1244 tlog.Debug(tag, "AddCustomHeader : " + result);
1246 result = webView.RemoveCustomHeader("customHeader_title");
1247 tlog.Debug(tag, "RemoveCustomHeader : " + result);
1249 tlog.Debug(tag, $"WebViewAddCustomHeader END (OK)");
1254 [Description("WebView ScrollBy.")]
1255 [Property("SPEC", "Tizen.NUI.WebView.ScrollBy M")]
1256 [Property("SPEC_URL", "-")]
1257 [Property("CRITERIA", "MR")]
1258 [Property("COVPARAM", "")]
1259 [Property("AUTHOR", "guowei.wang@samsung.com")]
1260 public async Task WebViewScrollBy()
1262 tlog.Debug(tag, $"WebViewScrollBy START");
1264 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1265 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1267 tlog.Info(tag, "onLoadFinished is called!");
1268 webView.ScrollBy(0, 60);
1269 tcs.TrySetResult(true);
1271 webView.PageLoadFinished += onLoadFinished;
1273 webView.LoadUrl(url);
1274 var result = await tcs.Task;
1275 Assert.IsTrue(result, "ScrollEdgeReached event should be invoked");
1277 webView.PageLoadFinished -= onLoadFinished;
1279 tlog.Debug(tag, $"WebViewScrollBy END (OK)");
1284 [Description("WebView ScrollEdgeBy.")]
1285 [Property("SPEC", "Tizen.NUI.WebView.ScrollEdgeBy M")]
1286 [Property("SPEC_URL", "-")]
1287 [Property("CRITERIA", "MR")]
1288 [Property("COVPARAM", "")]
1289 [Property("AUTHOR", "guowei.wang@samsung.com")]
1290 public async Task WebViewScrollEdgeBy()
1292 tlog.Debug(tag, $"WebViewScrollEdgeBy START");
1294 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1295 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1297 tlog.Info(tag, "onLoadFinished is called!");
1298 webView.ScrollEdgeBy(0, 60);
1299 tcs.TrySetResult(true);
1301 webView.PageLoadFinished += onLoadFinished;
1303 webView.LoadUrl(url);
1304 var result = await tcs.Task;
1305 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1307 webView.PageLoadFinished -= onLoadFinished;
1309 tlog.Debug(tag, $"WebViewScrollEdgeBy END (OK)");
1314 [Description("WebView GoBack.")]
1315 [Property("SPEC", "Tizen.NUI.WebView.GoBack M")]
1316 [Property("SPEC_URL", "-")]
1317 [Property("CRITERIA", "MR")]
1318 [Property("COVPARAM", "")]
1319 [Property("AUTHOR", "guowei.wang@samsung.com")]
1320 public async Task WebViewGoBack()
1322 tlog.Debug(tag, $"WebViewGoBack START");
1324 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1325 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1327 if (webView.Url.Contains("index.html"))
1329 tlog.Info(tag, "onLoadFinished is called!");
1330 webView.LoadUrl(secondUrl);
1334 tlog.Info(tag, "onLoadFinished is called!");
1336 tcs.TrySetResult(true);
1339 webView.PageLoadFinished += onLoadFinished;
1341 webView.LoadUrl(url);
1342 var result = await tcs.Task;
1343 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1345 webView.PageLoadFinished -= onLoadFinished;
1347 tlog.Debug(tag, $"WebViewGoBack END (OK)");
1352 [Description("WebView GoForward.")]
1353 [Property("SPEC", "Tizen.NUI.WebView.GoForward M")]
1354 [Property("SPEC_URL", "-")]
1355 [Property("CRITERIA", "MR")]
1356 [Property("COVPARAM", "")]
1357 [Property("AUTHOR", "guowei.wang@samsung.com")]
1358 public async Task WebViewGoForward()
1360 tlog.Debug(tag, $"WebViewGoForward START");
1362 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1363 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1365 if (webView.Url.Contains("index.html"))
1367 tlog.Info(tag, "onLoadFinished is called!");
1368 webView.LoadUrl(secondUrl);
1372 tlog.Info(tag, "onLoadFinished is called!");
1374 webView.GoForward();
1375 tcs.TrySetResult(true);
1378 webView.PageLoadFinished += onLoadFinished;
1380 webView.LoadUrl(url);
1381 var result = await tcs.Task;
1382 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1384 webView.PageLoadFinished -= onLoadFinished;
1386 tlog.Debug(tag, $"WebViewGoForward END (OK)");
1391 [Description("WebView CanGoBack.")]
1392 [Property("SPEC", "Tizen.NUI.WebView.CanGoBack M")]
1393 [Property("SPEC_URL", "-")]
1394 [Property("CRITERIA", "MR")]
1395 [Property("COVPARAM", "")]
1396 [Property("AUTHOR", "guowei.wang@samsung.com")]
1397 public async Task WebViewCanGoBack()
1399 tlog.Debug(tag, $"WebViewCanGoBack START");
1401 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1402 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1404 if (webView.Url.Contains("index.html"))
1406 tlog.Info(tag, "onLoadFinished is called!");
1407 webView.LoadUrl(secondUrl);
1411 tlog.Info(tag, "onLoadFinished is called!");
1412 var canGo = webView.CanGoBack();
1413 tcs.TrySetResult(canGo);
1416 webView.PageLoadFinished += onLoadFinished;
1418 webView.LoadUrl(url);
1419 var result = await tcs.Task;
1420 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1422 webView.PageLoadFinished -= onLoadFinished;
1424 tlog.Debug(tag, $"WebViewCanGoBack END (OK)");
1429 [Description("WebView CanGoForward.")]
1430 [Property("SPEC", "Tizen.NUI.WebView.CanGoForward M")]
1431 [Property("SPEC_URL", "-")]
1432 [Property("CRITERIA", "MR")]
1433 [Property("COVPARAM", "")]
1434 [Property("AUTHOR", "guowei.wang@samsung.com")]
1435 public async Task WebViewCanGoForward()
1437 tlog.Debug(tag, $"WebViewCanGoForward START");
1439 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1440 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1442 if (webView.Url.Contains("index.html"))
1444 tlog.Info(tag, "onLoadFinished is called!");
1445 webView.LoadUrl(secondUrl);
1449 tlog.Info(tag, "onLoadFinished is called!");
1451 var canGo = webView.CanGoForward();
1452 tcs.TrySetResult(true);
1455 webView.PageLoadFinished += onLoadFinished;
1457 webView.LoadUrl(url);
1458 var result = await tcs.Task;
1459 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1461 webView.PageLoadFinished -= onLoadFinished;
1463 tlog.Debug(tag, $"WebViewCanGoForward END (OK)");
1468 [Description("WebView EvaluateJavaScript.")]
1469 [Property("SPEC", "Tizen.NUI.WebView.EvaluateJavaScript M")]
1470 [Property("SPEC_URL", "-")]
1471 [Property("CRITERIA", "MR")]
1472 [Property("COVPARAM", "")]
1473 [Property("AUTHOR", "guowei.wang@samsung.com")]
1474 public async Task WebViewEvaluateJavaScript()
1476 tlog.Debug(tag, $"WebViewEvaluateJavaScript START");
1478 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1479 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1481 tlog.Info(tag, "onLoadFinished is called!");
1482 webView.EvaluateJavaScript("<script type=\"text / javascript\">document.write(\"page\");</script>");
1483 tcs.TrySetResult(true);
1485 webView.PageLoadFinished += onLoadFinished;
1487 webView.LoadUrl(url);
1488 var result = await tcs.Task;
1489 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1491 webView.PageLoadFinished -= onLoadFinished;
1493 tlog.Debug(tag, $"WebViewEvaluateJavaScript END (OK)");
1498 [Description("WebView AddJavaScriptMessageHandler.")]
1499 [Property("SPEC", "Tizen.NUI.WebView.AddJavaScriptMessageHandler M")]
1500 [Property("SPEC_URL", "-")]
1501 [Property("CRITERIA", "MR")]
1502 [Property("COVPARAM", "")]
1503 [Property("AUTHOR", "guowei.wang@samsung.com")]
1504 public async Task WebViewAddJavaScriptMessageHandler()
1506 tlog.Debug(tag, $"WebViewAddJavaScriptMessageHandler START");
1508 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1509 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1511 tlog.Info(tag, "onLoadFinished is called!");
1512 webView.AddJavaScriptMessageHandler("AllowOrigin", JsCallback);
1513 tcs.TrySetResult(true);
1515 webView.PageLoadFinished += onLoadFinished;
1517 webView.LoadUrl(url);
1518 var result = await tcs.Task;
1519 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1521 webView.PageLoadFinished -= onLoadFinished;
1523 tlog.Debug(tag, $"WebViewAddJavaScriptMessageHandler END (OK)");
1528 [Description("WebView RegisterJavaScriptAlertCallback.")]
1529 [Property("SPEC", "Tizen.NUI.WebView.RegisterJavaScriptAlertCallback M")]
1530 [Property("SPEC_URL", "-")]
1531 [Property("CRITERIA", "MR")]
1532 [Property("COVPARAM", "")]
1533 [Property("AUTHOR", "guowei.wang@samsung.com")]
1534 public async Task WebViewRegisterJavaScriptAlertCallback()
1536 tlog.Debug(tag, $"WebViewRegisterJavaScriptAlertCallback START");
1538 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1539 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1541 tlog.Info(tag, "onLoadFinished is called!");
1542 tcs.TrySetResult(true);
1544 webView.PageLoadFinished += onLoadFinished;
1546 webView.RegisterJavaScriptAlertCallback(JsCallback);
1548 webView.LoadUrl(url);
1549 var result = await tcs.Task;
1550 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1552 webView.PageLoadFinished -= onLoadFinished;
1554 tlog.Debug(tag, $"WebViewRegisterJavaScriptAlertCallback END (OK)");
1559 [Description("WebView RegisterJavaScriptConfirmCallback.")]
1560 [Property("SPEC", "Tizen.NUI.WebView.RegisterJavaScriptConfirmCallback M")]
1561 [Property("SPEC_URL", "-")]
1562 [Property("CRITERIA", "MR")]
1563 [Property("COVPARAM", "")]
1564 [Property("AUTHOR", "guowei.wang@samsung.com")]
1565 public async Task WebViewRegisterJavaScriptConfirmCallback()
1567 tlog.Debug(tag, $"WebViewRegisterJavaScriptConfirmCallback START");
1569 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1570 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1572 tlog.Info(tag, "onLoadFinished is called!");
1573 tcs.TrySetResult(true);
1575 webView.PageLoadFinished += onLoadFinished;
1577 webView.RegisterJavaScriptConfirmCallback(JsCallback);
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, $"WebViewRegisterJavaScriptConfirmCallback END (OK)");
1590 [Description("WebView RegisterJavaScriptPromptCallback.")]
1591 [Property("SPEC", "Tizen.NUI.WebView.RegisterJavaScriptPromptCallback M")]
1592 [Property("SPEC_URL", "-")]
1593 [Property("CRITERIA", "MR")]
1594 [Property("COVPARAM", "")]
1595 [Property("AUTHOR", "guowei.wang@samsung.com")]
1596 public async Task WebViewRegisterJavaScriptPromptCallback()
1598 tlog.Debug(tag, $"WebViewRegisterJavaScriptPromptCallback START");
1600 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1601 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1603 tlog.Info(tag, "onLoadFinished is called!");
1604 tcs.TrySetResult(true);
1606 webView.PageLoadFinished += onLoadFinished;
1608 webView.RegisterJavaScriptPromptCallback(PromptCallback);
1610 webView.LoadUrl(url);
1611 var result = await tcs.Task;
1612 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1614 webView.PageLoadFinished -= onLoadFinished;
1616 tlog.Debug(tag, $"WebViewRegisterJavaScriptPromptCallback END (OK)");
1621 [Description("WebView ClearAllTilesResources.")]
1622 [Property("SPEC", "Tizen.NUI.WebView.ClearAllTilesResources M")]
1623 [Property("SPEC_URL", "-")]
1624 [Property("CRITERIA", "MR")]
1625 [Property("COVPARAM", "")]
1626 [Property("AUTHOR", "guowei.wang@samsung.com")]
1627 public async Task WebViewClearAllTilesResources()
1629 tlog.Debug(tag, $"WebViewClearAllTilesResources START");
1631 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1632 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1634 tlog.Info(tag, "onLoadFinished is called!");
1635 webView.ClearAllTilesResources();
1636 tcs.TrySetResult(true);
1638 webView.PageLoadFinished += onLoadFinished;
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, $"WebViewClearAllTilesResources END (OK)");
1651 [Description("WebView ClearHistory.")]
1652 [Property("SPEC", "Tizen.NUI.WebView.ClearHistory M")]
1653 [Property("SPEC_URL", "-")]
1654 [Property("CRITERIA", "MR")]
1655 [Property("COVPARAM", "")]
1656 [Property("AUTHOR", "guowei.wang@samsung.com")]
1657 public async Task WebViewClearHistory()
1659 tlog.Debug(tag, $"WebViewClearHistory START");
1661 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1662 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1664 tlog.Info(tag, "onLoadFinished is called!");
1665 webView.ClearHistory();
1666 tcs.TrySetResult(true);
1668 webView.PageLoadFinished += onLoadFinished;
1670 webView.LoadUrl(url);
1671 var result = await tcs.Task;
1672 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1674 webView.PageLoadFinished -= onLoadFinished;
1676 tlog.Debug(tag, $"WebViewClearHistory END (OK)");
1681 [Description("WebView SetScaleFactor.")]
1682 [Property("SPEC", "Tizen.NUI.WebView.SetScaleFactor M")]
1683 [Property("SPEC_URL", "-")]
1684 [Property("CRITERIA", "MR")]
1685 [Property("COVPARAM", "")]
1686 [Property("AUTHOR", "guowei.wang@samsung.com")]
1687 public async Task WebViewSetScaleFactor()
1689 tlog.Debug(tag, $"WebViewSetScaleFactor START");
1691 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1692 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1694 tlog.Info(tag, "onLoadFinished is called!");
1695 using (Vector2 point = new Vector2(1.0f, 1.0f))
1697 webView.SetScaleFactor(0.2f, point);
1699 var factor = webView.GetScaleFactor();
1700 tlog.Debug(tag, "ScaleFactor : " + factor);
1702 tcs.TrySetResult(true);
1704 webView.PageLoadFinished += onLoadFinished;
1706 webView.LoadUrl(url);
1707 var result = await tcs.Task;
1708 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1710 webView.PageLoadFinished -= onLoadFinished;
1712 tlog.Debug(tag, $"WebViewSetScaleFactor END (OK)");
1717 [Description("WebView ActivateAccessibility.")]
1718 [Property("SPEC", "Tizen.NUI.WebView.ActivateAccessibility M")]
1719 [Property("SPEC_URL", "-")]
1720 [Property("CRITERIA", "MR")]
1721 [Property("COVPARAM", "")]
1722 [Property("AUTHOR", "guowei.wang@samsung.com")]
1723 public async Task WebViewActivateAccessibility()
1725 tlog.Debug(tag, $"WebViewActivateAccessibility START");
1727 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1728 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1730 tlog.Info(tag, "onLoadFinished is called!");
1731 webView.ActivateAccessibility(false);
1732 tcs.TrySetResult(true);
1734 webView.PageLoadFinished += onLoadFinished;
1736 webView.LoadUrl(url);
1737 var result = await tcs.Task;
1738 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1740 webView.PageLoadFinished -= onLoadFinished;
1742 tlog.Debug(tag, $"WebViewActivateAccessibility END (OK)");
1747 [Description("WebView HighlightText.")]
1748 [Property("SPEC", "Tizen.NUI.WebView.HighlightText M")]
1749 [Property("SPEC_URL", "-")]
1750 [Property("CRITERIA", "MR")]
1751 [Property("COVPARAM", "")]
1752 [Property("AUTHOR", "guowei.wang@samsung.com")]
1753 public async Task WebViewHighlightText()
1755 tlog.Debug(tag, $"WebViewHighlightText START");
1757 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1758 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1760 tlog.Info(tag, "onLoadFinished is called!");
1761 webView.HighlightText("web", BaseComponents.WebView.FindOption.AtWordStart, 3);
1762 tcs.TrySetResult(true);
1764 webView.PageLoadFinished += onLoadFinished;
1766 webView.LoadUrl(url);
1767 var result = await tcs.Task;
1768 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1770 webView.PageLoadFinished -= onLoadFinished;
1772 tlog.Debug(tag, $"WebViewHighlightText END (OK)");
1777 [Description("WebView AddDynamicCertificatePath.")]
1778 [Property("SPEC", "Tizen.NUI.WebView.AddDynamicCertificatePath M")]
1779 [Property("SPEC_URL", "-")]
1780 [Property("CRITERIA", "MR")]
1781 [Property("COVPARAM", "")]
1782 [Property("AUTHOR", "guowei.wang@samsung.com")]
1783 public async Task WebViewAddDynamicCertificatePath()
1785 tlog.Debug(tag, $"WebViewAddDynamicCertificatePath START");
1787 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1788 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1790 tlog.Info(tag, "onLoadFinished is called!");
1791 webView.AddDynamicCertificatePath("127.0.0.0", "/");
1792 tcs.TrySetResult(true);
1794 webView.PageLoadFinished += onLoadFinished;
1796 webView.LoadUrl(url);
1797 var result = await tcs.Task;
1798 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1800 webView.PageLoadFinished -= onLoadFinished;
1802 tlog.Debug(tag, $"WebViewAddDynamicCertificatePath END (OK)");
1807 [Description("WebView CheckVideoPlayingAsynchronously.")]
1808 [Property("SPEC", "Tizen.NUI.WebView.CheckVideoPlayingAsynchronously M")]
1809 [Property("SPEC_URL", "-")]
1810 [Property("CRITERIA", "MR")]
1811 [Property("COVPARAM", "")]
1812 [Property("AUTHOR", "guowei.wang@samsung.com")]
1813 public async Task WebViewCheckVideoPlayingAsynchronously()
1815 tlog.Debug(tag, $"WebViewCheckVideoPlayingAsynchronously START");
1817 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1818 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1820 tlog.Info(tag, "onLoadFinished is called!");
1821 webView.CheckVideoPlayingAsynchronously(VideoCallback);
1822 tcs.TrySetResult(true);
1824 webView.PageLoadFinished += onLoadFinished;
1826 webView.LoadUrl(url);
1827 var result = await tcs.Task;
1828 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1830 webView.PageLoadFinished -= onLoadFinished;
1832 tlog.Debug(tag, $"WebViewCheckVideoPlayingAsynchronously END (OK)");
1837 [Description("WebView RegisterGeolocationPermissionCallback.")]
1838 [Property("SPEC", "Tizen.NUI.WebView.RegisterGeolocationPermissionCallback M")]
1839 [Property("SPEC_URL", "-")]
1840 [Property("CRITERIA", "MR")]
1841 [Property("COVPARAM", "")]
1842 [Property("AUTHOR", "guowei.wang@samsung.com")]
1843 public async Task WebViewRegisterGeolocationPermissionCallback()
1845 tlog.Debug(tag, $"WebViewRegisterGeolocationPermissionCallback START");
1847 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1848 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1850 tlog.Info(tag, "onLoadFinished is called!");
1851 tcs.TrySetResult(true);
1853 webView.PageLoadFinished += onLoadFinished;
1855 webView.RegisterGeolocationPermissionCallback(GeolocationCallback);
1857 webView.LoadUrl(url);
1858 var result = await tcs.Task;
1859 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1861 webView.PageLoadFinished -= onLoadFinished;
1863 tlog.Debug(tag, $"WebViewRegisterGeolocationPermissionCallback END (OK)");
1868 [Description("WebView GetPlainTextAsynchronously.")]
1869 [Property("SPEC", "Tizen.NUI.WebView.GetPlainTextAsynchronously M")]
1870 [Property("SPEC_URL", "-")]
1871 [Property("CRITERIA", "MR")]
1872 [Property("COVPARAM", "")]
1873 [Property("AUTHOR", "guowei.wang@samsung.com")]
1874 public async Task WebViewGetPlainTextAsynchronously()
1876 tlog.Debug(tag, $"WebViewGetPlainTextAsynchronously START");
1878 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1879 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1881 tlog.Info(tag, "onLoadFinished is called!");
1882 webView.GetPlainTextAsynchronously(PlainReceivedCallback);
1883 tcs.TrySetResult(true);
1885 webView.PageLoadFinished += onLoadFinished;
1887 webView.LoadUrl(url);
1888 var result = await tcs.Task;
1889 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1891 webView.PageLoadFinished -= onLoadFinished;
1893 tlog.Debug(tag, $"WebViewGetPlainTextAsynchronously END (OK)");
1898 [Description("WebView SetTtsFocus.")]
1899 [Property("SPEC", "Tizen.NUI.WebView.SetTtsFocus M")]
1900 [Property("SPEC_URL", "-")]
1901 [Property("CRITERIA", "MR")]
1902 [Property("COVPARAM", "")]
1903 [Property("AUTHOR", "guowei.wang@samsung.com")]
1904 public async Task WebViewSetTtsFocus()
1906 tlog.Debug(tag, $"WebViewSetTtsFocus START");
1908 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1909 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1911 tlog.Info(tag, "onLoadFinished is called!");
1912 webView.SetTtsFocus(false);
1913 tcs.TrySetResult(true);
1915 webView.PageLoadFinished += onLoadFinished;
1917 webView.LoadUrl(url);
1918 var result = await tcs.Task;
1919 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1921 webView.PageLoadFinished -= onLoadFinished;
1923 tlog.Debug(tag, $"WebViewSetTtsFocus END (OK)");
1928 [Description("WebView GetScreenshot.")]
1929 [Property("SPEC", "Tizen.NUI.WebView.GetScreenshot M")]
1930 [Property("SPEC_URL", "-")]
1931 [Property("CRITERIA", "MR")]
1932 [Property("COVPARAM", "")]
1933 [Property("AUTHOR", "guowei.wang@samsung.com")]
1934 public async Task WebViewGetScreenshot()
1936 tlog.Debug(tag, $"WebViewGetScreenshot START");
1938 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1939 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1941 tlog.Info(tag, "onLoadFinished is called!");
1942 var factor = webView.GetScaleFactor();
1943 webView.GetScreenshot(new Rectangle(5, 6, 100, 200), factor);
1944 tcs.TrySetResult(true);
1946 webView.PageLoadFinished += onLoadFinished;
1948 webView.LoadUrl(url);
1949 var result = await tcs.Task;
1950 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1952 webView.PageLoadFinished -= onLoadFinished;
1954 tlog.Debug(tag, $"WebViewGetScreenshot END (OK)");
1959 [Description("WebView GetScreenshotAsynchronously.")]
1960 [Property("SPEC", "Tizen.NUI.WebView.GetScreenshotAsynchronously M")]
1961 [Property("SPEC_URL", "-")]
1962 [Property("CRITERIA", "MR")]
1963 [Property("COVPARAM", "")]
1964 [Property("AUTHOR", "guowei.wang@samsung.com")]
1965 public async Task WebViewGetScreenshotAsynchronously()
1967 tlog.Debug(tag, $"WebViewGetScreenshotAsynchronously START");
1969 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1970 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1972 tlog.Info(tag, "onLoadFinished is called!");
1973 var factor = webView.GetScaleFactor();
1974 webView.GetScreenshotAsynchronously(new Rectangle(5, 6, 50, 50), factor, ScreenshotAcquiredCallbackCase);
1975 tcs.TrySetResult(true);
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, $"WebViewGetScreenshotAsynchronously END (OK)");
1990 [Description("WebView EvaluateJavaScript.")]
1991 [Property("SPEC", "Tizen.NUI.WebView.EvaluateJavaScript M")]
1992 [Property("SPEC_URL", "-")]
1993 [Property("CRITERIA", "MR")]
1994 [Property("COVPARAM", "")]
1995 [Property("AUTHOR", "guowei.wang@samsung.com")]
1996 public async Task WebViewEvaluateJavaScriptWithCallback()
1998 tlog.Debug(tag, $"WebViewEvaluateJavaScriptWithCallback START");
2000 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
2001 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
2003 tlog.Info(tag, "onLoadFinished is called!");
2004 webView.EvaluateJavaScript("<script type=\"text / javascript\">document.write(\"page\");</script>", JsCallback);
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, $"WebViewEvaluateJavaScriptWithCallback END (OK)");
2020 [Description("WebView ClearCache.")]
2021 [Property("SPEC", "Tizen.NUI.WebView.ClearCache M")]
2022 [Property("SPEC_URL", "-")]
2023 [Property("CRITERIA", "MR")]
2024 [Property("COVPARAM", "")]
2025 [Property("AUTHOR", "guowei.wang@samsung.com")]
2026 public async Task WebViewClearCache()
2028 tlog.Debug(tag, $"WebViewClearCache START");
2030 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
2031 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
2033 tlog.Info(tag, "onLoadFinished is called!");
2034 webView.ClearCache();
2035 tcs.TrySetResult(true);
2037 webView.PageLoadFinished += onLoadFinished;
2039 webView.LoadUrl(url);
2040 var result = await tcs.Task;
2041 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
2043 webView.PageLoadFinished -= onLoadFinished;
2045 tlog.Debug(tag, $"WebViewClearCache END (OK)");
2050 [Description("WebView ClearCookies.")]
2051 [Property("SPEC", "Tizen.NUI.WebView.ClearCookies M")]
2052 [Property("SPEC_URL", "-")]
2053 [Property("CRITERIA", "MR")]
2054 [Property("COVPARAM", "")]
2055 [Property("AUTHOR", "guowei.wang@samsung.com")]
2056 public async Task WebViewClearCookies()
2058 tlog.Debug(tag, $"WebViewClearCookies START");
2060 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
2061 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
2063 tlog.Info(tag, "onLoadFinished is called!");
2064 webView.ClearCookies();
2065 tcs.TrySetResult(true);
2067 webView.PageLoadFinished += onLoadFinished;
2069 webView.LoadUrl(url);
2070 var result = await tcs.Task;
2071 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
2073 webView.PageLoadFinished -= onLoadFinished;
2075 tlog.Debug(tag, $"WebViewClearCookies END (OK)");
2080 [Description("WebView DownCast.")]
2081 [Property("SPEC", "Tizen.NUI.WebView.DownCast M")]
2082 [Property("SPEC_URL", "-")]
2083 [Property("CRITERIA", "MR")]
2084 [Property("COVPARAM", "")]
2085 [Property("AUTHOR", "guowei.wang@samsung.com")]
2086 public void WebViewDownCast()
2088 tlog.Debug(tag, $"WebViewDownCast START");
2092 BaseComponents.WebView.DownCast(webView);
2096 tlog.Debug(tag, e.Message.ToString());
2097 Assert.Fail("Caught Exception : Failed!");
2100 tlog.Debug(tag, $"WebViewDownCast END (OK)");
2105 [Description("WebView Assign.")]
2106 [Property("SPEC", "Tizen.NUI.WebView.Assign M")]
2107 [Property("SPEC_URL", "-")]
2108 [Property("CRITERIA", "MR")]
2109 [Property("COVPARAM", "")]
2110 [Property("AUTHOR", "guowei.wang@samsung.com")]
2111 public void WebViewAssign()
2113 tlog.Debug(tag, $"WebViewAssign START");
2117 webView.Assign(webView);
2121 tlog.Debug(tag, e.Message.ToString());
2122 Assert.Fail("Caught Exception : Failed!");
2125 tlog.Debug(tag, $"WebViewAssign END (OK)");
2130 [Description("WebView Dispose.")]
2131 [Property("SPEC", "Tizen.NUI.WebView.Dispose M")]
2132 [Property("SPEC_URL", "-")]
2133 [Property("CRITERIA", "MR")]
2134 [Property("COVPARAM", "")]
2135 [Property("AUTHOR", "guowei.wang@samsung.com")]
2136 public void WebViewDispose()
2138 tlog.Debug(tag, $"WebViewDispose START");
2140 var testingTarget = new MyWebView();
2141 Assert.IsNotNull(testingTarget, "null handle");
2142 Assert.IsInstanceOf<Tizen.NUI.BaseComponents.WebView>(testingTarget, "Should return WebView instance.");
2144 testingTarget.OnDispose(DisposeTypes.Explicit);
2146 testingTarget.OnDispose(DisposeTypes.Explicit);
2148 tlog.Debug(tag, $"WebViewDispose END (OK)");