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 // Make current thread (CPU) sleep...
145 webView.PageLoadStarted -= onLoadStarted;
147 tlog.Debug(tag, $"WebViewPageLoadStarted END (OK)");
152 [Description("WebView PageLoading.")]
153 [Property("SPEC", "Tizen.NUI.WebView.PageLoading E")]
154 [Property("SPEC_URL", "-")]
155 [Property("CRITERIA", "PRW")]
156 [Property("COVPARAM", "")]
157 [Property("AUTHOR", "guowei.wang@samsung.com")]
158 public async Task WebViewPageLoading()
160 tlog.Debug(tag, $"WebViewPageLoading START");
162 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
163 EventHandler<WebViewPageLoadEventArgs> onLoading = (s, e) => { tcs.TrySetResult(true); };
164 webView.PageLoading += onLoading;
166 webView.LoadUrl(url);
167 var result = await tcs.Task;
168 Assert.IsTrue(result, "PageLoading event should be invoked");
170 // Make current thread (CPU) sleep...
173 webView.PageLoading -= onLoading;
175 tlog.Debug(tag, $"WebViewPageLoading END (OK)");
180 [Description("WebView PageLoadFinished.")]
181 [Property("SPEC", "Tizen.NUI.WebView.PageLoadFinished E")]
182 [Property("SPEC_URL", "-")]
183 [Property("CRITERIA", "PRW")]
184 [Property("COVPARAM", "")]
185 [Property("AUTHOR", "guowei.wang@samsung.com")]
186 public async Task WebViewPageLoadFinished()
188 tlog.Debug(tag, $"WebViewPageLoadFinished START");
190 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
191 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) => { tcs.TrySetResult(true); };
192 webView.PageLoadFinished += onLoadFinished;
194 webView.LoadUrl(url);
195 var result = await tcs.Task;
196 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
198 // Make current thread (CPU) sleep...
201 webView.PageLoadFinished -= onLoadFinished;
203 tlog.Debug(tag, $"WebViewPageLoadFinished END (OK)");
208 [Description("WebView UrlChanged.")]
209 [Property("SPEC", "Tizen.NUI.WebView.UrlChanged E")]
210 [Property("SPEC_URL", "-")]
211 [Property("CRITERIA", "PRW")]
212 [Property("COVPARAM", "")]
213 [Property("AUTHOR", "guowei.wang@samsung.com")]
214 public async Task WebViewUrlChanged()
216 tlog.Debug(tag, $"WebViewUrlChanged START");
218 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
220 EventHandler<WebViewUrlChangedEventArgs> onUrlChange = (s, e) =>
222 Assert.IsNotNull(e.NewPageUrl, "New page url should not be null");
223 tcs.TrySetResult(true);
225 webView.UrlChanged += onUrlChange;
227 webView.LoadUrl(url);
228 var result = await tcs.Task;
229 Assert.IsTrue(result, "UrlChanged event should be invoked");
231 // Make current thread (CPU) sleep...
234 webView.UrlChanged -= onUrlChange;
236 tlog.Debug(tag, $"WebViewUrlChanged END (OK)");
241 [Description("WebView FrameRendered.")]
242 [Property("SPEC", "Tizen.NUI.WebView.FrameRendered A")]
243 [Property("SPEC_URL", "-")]
244 [Property("CRITERIA", "PRW")]
245 [Property("COVPARAM", "")]
246 [Property("AUTHOR", "guowei.wang@samsung.com")]
247 public async Task WebViewFrameRendered()
249 tlog.Debug(tag, $"WebViewFrameRendered START");
251 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
252 EventHandler<EventArgs> onFrameRender = (s, e) => { tcs.TrySetResult(true); };
253 webView.FrameRendered += onFrameRender;
255 webView.LoadUrl(url);
256 var result = await tcs.Task;
257 Assert.IsTrue(result, "FrameRendered event should be invoked");
259 // Make current thread (CPU) sleep...
262 webView.FrameRendered -= onFrameRender;
264 tlog.Debug(tag, $"WebViewFrameRendered END (OK)");
269 [Description("WebView ResponsePolicyDecided.")]
270 [Property("SPEC", "Tizen.NUI.WebView.ResponsePolicyDecided A")]
271 [Property("SPEC_URL", "-")]
272 [Property("CRITERIA", "PRW")]
273 [Property("COVPARAM", "")]
274 [Property("AUTHOR", "guowei.wang@samsung.com")]
275 public async Task WebViewResponsePolicyDecided()
277 tlog.Debug(tag, $"WebViewResponsePolicyDecided START");
279 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
280 EventHandler<WebViewPolicyDecidedEventArgs> onResponsePolicyDecide = (s, e) => { tcs.TrySetResult(true); };
281 webView.ResponsePolicyDecided += onResponsePolicyDecide;
283 webView.LoadUrl(urlForResponsePolicyTest);
284 var result = await tcs.Task;
285 Assert.IsTrue(result, "ResponsePolicyDecided event should be invoked");
287 // Make current thread (CPU) sleep...
290 webView.ResponsePolicyDecided -= onResponsePolicyDecide;
292 tlog.Debug(tag, $"WebViewResponsePolicyDecided END (OK)");
297 [Description("WebView NavigationPolicyDecided.")]
298 [Property("SPEC", "Tizen.NUI.WebView.NavigationPolicyDecided A")]
299 [Property("SPEC_URL", "-")]
300 [Property("CRITERIA", "PRW")]
301 [Property("COVPARAM", "")]
302 [Property("AUTHOR", "guowei.wang@samsung.com")]
303 public async Task WebViewNavigationPolicyDecided()
305 tlog.Debug(tag, $"WebViewNavigationPolicyDecided START");
307 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
309 EventHandler<WebViewPolicyDecidedEventArgs> onNavigationPolicyDecided = (s, e) =>
311 tlog.Info(tag, "onNavigationPolicyDecided is being called!");
312 tcs.TrySetResult(true);
314 webView.NavigationPolicyDecided += onNavigationPolicyDecided;
316 webView.LoadUrl(urlForNavigationPolicyTest);
317 var result = await tcs.Task;
318 Assert.IsTrue(result, "NavigationPolicyDecided event should be invoked");
320 // Make current thread (CPU) sleep...
323 webView.NavigationPolicyDecided -= onNavigationPolicyDecided;
325 tlog.Debug(tag, $"WebViewNavigationPolicyDecided END (OK)");
330 [Description("WebView CertificateConfirmed.")]
331 [Property("SPEC", "Tizen.NUI.WebView.CertificateConfirmed A")]
332 [Property("SPEC_URL", "-")]
333 [Property("CRITERIA", "PRW")]
334 [Property("COVPARAM", "")]
335 [Property("AUTHOR", "guowei.wang@samsung.com")]
336 public async Task WebViewCertificateConfirmed()
338 tlog.Debug(tag, $"WebViewCertificateConfirmed START");
340 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
342 EventHandler<WebViewCertificateReceivedEventArgs> onCertificateConfirme = (s, e) =>
344 tlog.Info(tag, "CertificateConfirmed is being called!");
345 tcs.TrySetResult(true);
347 webView.CertificateConfirmed += onCertificateConfirme;
349 webView.LoadUrl(urlForCertificateConfirmTest);
350 var result = await tcs.Task;
351 Assert.IsTrue(result, "CertificateConfirmed event should be invoked");
353 // Make current thread (CPU) sleep...
356 webView.CertificateConfirmed -= onCertificateConfirme;
358 tlog.Debug(tag, $"WebViewCertificateConfirmed END (OK)");
363 [Description("WebView SslCertificateChanged.")]
364 [Property("SPEC", "Tizen.NUI.WebView.SslCertificateChanged A")]
365 [Property("SPEC_URL", "-")]
366 [Property("CRITERIA", "PRW")]
367 [Property("COVPARAM", "")]
368 [Property("AUTHOR", "guowei.wang@samsung.com")]
369 public async Task WebViewSslCertificateChanged()
371 tlog.Debug(tag, $"WebViewSslCertificateChanged START");
373 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
374 EventHandler<WebViewCertificateReceivedEventArgs> onSslCertificateChange = (s, e) => { tcs.TrySetResult(true); };
375 webView.SslCertificateChanged += onSslCertificateChange;
377 webView.LoadUrl(url);
378 var result = await tcs.Task;
379 Assert.IsTrue(result, "SslCertificateChanged event should be invoked");
381 // Make current thread (CPU) sleep...
384 webView.SslCertificateChanged -= onSslCertificateChange;
386 tlog.Debug(tag, $"WebViewSslCertificateChanged END (OK)");
391 [Description("WebView ConsoleMessageReceived.")]
392 [Property("SPEC", "Tizen.NUI.WebView.ConsoleMessageReceived A")]
393 [Property("SPEC_URL", "-")]
394 [Property("CRITERIA", "PRW")]
395 [Property("COVPARAM", "")]
396 [Property("AUTHOR", "guowei.wang@samsung.com")]
397 public async Task WebViewConsoleMessageReceived()
399 tlog.Debug(tag, $"WebViewConsoleMessageReceived START");
401 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
402 EventHandler<WebViewConsoleMessageReceivedEventArgs> onConsoleMessageReceive = (s, e) => { tcs.TrySetResult(true); };
403 webView.ConsoleMessageReceived += onConsoleMessageReceive;
405 webView.LoadUrl(urlForConsoleMessageTest);
406 var result = await tcs.Task;
407 Assert.IsTrue(result, "ConsoleMessageReceived event should be invoked");
409 // Make current thread (CPU) sleep...
412 webView.ConsoleMessageReceived -= onConsoleMessageReceive;
414 tlog.Debug(tag, $"WebViewConsoleMessageReceived END (OK)");
419 [Description("WebView BackForwardList.")]
420 [Property("SPEC", "Tizen.NUI.WebView.BackForwardList A")]
421 [Property("SPEC_URL", "-")]
422 [Property("CRITERIA", "PRO")]
423 [Property("COVPARAM", "")]
424 [Property("AUTHOR", "guowei.wang@samsung.com")]
425 public void WebViewBackForwardList()
427 tlog.Debug(tag, $"WebViewBackForwardList START");
429 var result = webView.BackForwardList;
430 tlog.Debug(tag, "ForwardList : " + result);
432 tlog.Debug(tag, $"WebViewBackForwardList END (OK)");
437 [Description("WebView Context.")]
438 [Property("SPEC", "Tizen.NUI.WebView.Context A")]
439 [Property("SPEC_URL", "-")]
440 [Property("CRITERIA", "PRO")]
441 [Property("COVPARAM", "")]
442 [Property("AUTHOR", "guowei.wang@samsung.com")]
443 public void WebViewContext()
445 tlog.Debug(tag, $"WebViewContext START");
447 var result = webView.Context;
448 tlog.Debug(tag, "Context : " + result);
450 tlog.Debug(tag, $"WebViewContext END (OK)");
455 [Description("WebView CookieManager.")]
456 [Property("SPEC", "Tizen.NUI.WebView.CookieManager A")]
457 [Property("SPEC_URL", "-")]
458 [Property("CRITERIA", "PRO")]
459 [Property("COVPARAM", "")]
460 [Property("AUTHOR", "guowei.wang@samsung.com")]
461 public void WebViewCookieManager()
463 tlog.Debug(tag, $"WebViewCookieManager START");
465 var result = webView.CookieManager;
466 tlog.Debug(tag, "CookieManager : " + result);
468 tlog.Debug(tag, $"WebViewCookieManager END (OK)");
473 [Description("WebView Settings.")]
474 [Property("SPEC", "Tizen.NUI.WebView.Settings A")]
475 [Property("SPEC_URL", "-")]
476 [Property("CRITERIA", "PRO")]
477 [Property("COVPARAM", "")]
478 [Property("AUTHOR", "guowei.wang@samsung.com")]
479 public void WebViewSettings()
481 tlog.Debug(tag, $"WebViewSettings START");
483 var result = webView.Settings;
484 tlog.Debug(tag, "Settings : " + result);
486 tlog.Debug(tag, $"WebViewSettings END (OK)");
491 [Description("WebView Url.")]
492 [Property("SPEC", "Tizen.NUI.WebView.Url A")]
493 [Property("SPEC_URL", "-")]
494 [Property("CRITERIA", "PRW")]
495 [Property("COVPARAM", "")]
496 [Property("AUTHOR", "guowei.wang@samsung.com")]
497 public async Task WebViewUrl()
499 tlog.Debug(tag, $"WebViewUrl START");
500 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
501 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
503 tcs.TrySetResult(true);
505 webView.PageLoadFinished += onLoadFinished;
508 var result = await tcs.Task;
509 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
511 // Make current thread (CPU) sleep...
514 webView.PageLoadFinished -= onLoadFinished;
516 tlog.Debug(tag, "Url : " + webView.Url);
517 tlog.Debug(tag, $"WebViewUrl END (OK)");
522 [Description("WebView CacheModel.")]
523 [Property("SPEC", "Tizen.NUI.WebView.CacheModel A")]
524 [Property("SPEC_URL", "-")]
525 [Property("CRITERIA", "PRW")]
526 [Property("COVPARAM", "")]
527 [Property("AUTHOR", "guowei.wang@samsung.com")]
528 public void WebViewCacheModel()
530 tlog.Debug(tag, $"WebViewCacheModel START");
532 webView.CacheModel = Tizen.NUI.CacheModel.DocumentViewer;
533 tlog.Debug(tag, "CacheModel : " + webView.CacheModel);
535 webView.CacheModel = Tizen.NUI.CacheModel.DocumentBrowser;
536 tlog.Debug(tag, "CacheModel : " + webView.CacheModel);
538 webView.CacheModel = Tizen.NUI.CacheModel.PrimaryWebBrowser;
539 tlog.Debug(tag, "CacheModel : " + webView.CacheModel);
541 tlog.Debug(tag, $"WebViewCacheModel END (OK)");
546 [Description("WebView CookieAcceptPolicy.")]
547 [Property("SPEC", "Tizen.NUI.WebView.CookieAcceptPolicy A")]
548 [Property("SPEC_URL", "-")]
549 [Property("CRITERIA", "PRW")]
550 [Property("COVPARAM", "")]
551 [Property("AUTHOR", "guowei.wang@samsung.com")]
552 public void WebViewCookieAcceptPolicy()
554 tlog.Debug(tag, $"WebViewCookieAcceptPolicy START");
556 webView.CookieAcceptPolicy = (CookieAcceptPolicy)Tizen.NUI.WebCookieManager.CookieAcceptPolicyType.NoThirdParty;
557 tlog.Debug(tag, "CookieAcceptPolicy : " + webView.CookieAcceptPolicy);
559 webView.CookieAcceptPolicy = (CookieAcceptPolicy)Tizen.NUI.WebCookieManager.CookieAcceptPolicyType.Always;
560 tlog.Debug(tag, "CookieAcceptPolicy : " + webView.CookieAcceptPolicy);
562 webView.CookieAcceptPolicy = (CookieAcceptPolicy)Tizen.NUI.WebCookieManager.CookieAcceptPolicyType.Never;
563 tlog.Debug(tag, "CookieAcceptPolicy : " + webView.CookieAcceptPolicy);
565 tlog.Debug(tag, $"WebViewCookieAcceptPolicy END (OK)");
570 [Description("WebView UserAgent.")]
571 [Property("SPEC", "Tizen.NUI.WebView.UserAgent A")]
572 [Property("SPEC_URL", "-")]
573 [Property("CRITERIA", "PRW")]
574 [Property("COVPARAM", "")]
575 [Property("AUTHOR", "guowei.wang@samsung.com")]
576 public async Task WebViewUserAgent()
578 tlog.Debug(tag, $"WebViewUserAgent START");
580 webView.UserAgent = USER_AGENT;
581 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
582 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
584 tcs.TrySetResult(true);
586 webView.PageLoadFinished += onLoadFinished;
587 webView.LoadUrl(url);
588 var result = await tcs.Task;
589 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
591 // Make current thread (CPU) sleep...
594 webView.PageLoadFinished -= onLoadFinished;
596 tlog.Debug(tag, "UserAgent : " + webView.UserAgent);
597 tlog.Debug(tag, $"WebViewUserAgent END (OK)");
602 [Description("WebView EnableJavaScript.")]
603 [Property("SPEC", "Tizen.NUI.WebView.EnableJavaScript A")]
604 [Property("SPEC_URL", "-")]
605 [Property("CRITERIA", "PRW")]
606 [Property("COVPARAM", "")]
607 [Property("AUTHOR", "guowei.wang@samsung.com")]
608 public void WebViewEnableJavaScript()
610 tlog.Debug(tag, $"WebViewEnableJavaScript START");
612 webView.EnableJavaScript = true;
613 tlog.Debug(tag, "EnableJavaScript : " + webView.EnableJavaScript);
615 webView.EnableJavaScript = false;
616 tlog.Debug(tag, "EnableJavaScript : " + webView.EnableJavaScript);
618 tlog.Debug(tag, $"WebViewEnableJavaScript END (OK)");
623 [Description("WebView LoadImagesAutomatically.")]
624 [Property("SPEC", "Tizen.NUI.WebView.LoadImagesAutomatically A")]
625 [Property("SPEC_URL", "-")]
626 [Property("CRITERIA", "PRW")]
627 [Property("COVPARAM", "")]
628 [Property("AUTHOR", "guowei.wang@samsung.com")]
629 public void WebViewLoadImagesAutomatically()
631 tlog.Debug(tag, $"WebViewLoadImagesAutomatically START");
633 webView.LoadImagesAutomatically = true;
634 tlog.Debug(tag, "LoadImagesAutomatically : " + webView.LoadImagesAutomatically);
636 webView.LoadImagesAutomatically = false;
637 tlog.Debug(tag, "LoadImagesAutomatically : " + webView.LoadImagesAutomatically);
639 tlog.Debug(tag, $"WebViewLoadImagesAutomatically END (OK)");
644 [Description("WebView DefaultTextEncodingName.")]
645 [Property("SPEC", "Tizen.NUI.WebView.DefaultTextEncodingName A")]
646 [Property("SPEC_URL", "-")]
647 [Property("CRITERIA", "PRW")]
648 [Property("COVPARAM", "")]
649 [Property("AUTHOR", "guowei.wang@samsung.com")]
650 public void WebViewDefaultTextEncodingName()
652 tlog.Debug(tag, $"WebViewDefaultTextEncodingName START");
654 var result = webView.DefaultTextEncodingName;
655 tlog.Debug(tag, "DefaultTextEncodingName : " + result);
657 webView.DefaultTextEncodingName = "gbk";
658 tlog.Debug(tag, "DefaultTextEncodingName : " + result);
660 tlog.Debug(tag, $"WebViewDefaultTextEncodingName END (OK)");
665 [Description("WebView DefaultFontSize.")]
666 [Property("SPEC", "Tizen.NUI.WebView.DefaultFontSize A")]
667 [Property("SPEC_URL", "-")]
668 [Property("CRITERIA", "PRW")]
669 [Property("COVPARAM", "")]
670 [Property("AUTHOR", "guowei.wang@samsung.com")]
671 public void WebViewDefaultFontSize()
673 tlog.Debug(tag, $"WebViewDefaultFontSize START");
675 var result = webView.DefaultFontSize;
676 tlog.Debug(tag, "DefaultFontSize : " + result);
678 webView.DefaultFontSize = 32;
679 tlog.Debug(tag, "DefaultFontSize : " + result);
681 tlog.Debug(tag, $"WebViewDefaultFontSize END (OK)");
686 [Description("WebView ScrollSize.")]
687 [Property("SPEC", "Tizen.NUI.WebView.ScrollSize A")]
688 [Property("SPEC_URL", "-")]
689 [Property("CRITERIA", "PRO")]
690 [Property("COVPARAM", "")]
691 [Property("AUTHOR", "guowei.wang@samsung.com")]
692 public void WebViewScrollSize()
694 tlog.Debug(tag, $"WebViewScrollSize START");
696 tlog.Debug(tag, "Width : " + webView.ScrollSize.Width);
697 tlog.Debug(tag, "Height : " + webView.ScrollSize.Height);
699 tlog.Debug(tag, $"WebViewScrollSize END (OK)");
704 [Description("WebView ContentSize.")]
705 [Property("SPEC", "Tizen.NUI.WebView.ContentSize A")]
706 [Property("SPEC_URL", "-")]
707 [Property("CRITERIA", "PRO")]
708 [Property("COVPARAM", "")]
709 [Property("AUTHOR", "guowei.wang@samsung.com")]
710 public void WebViewContentSize()
712 tlog.Debug(tag, $"WebViewContentSize START");
714 tlog.Debug(tag, "Width : " + webView.ContentSize.Width);
715 tlog.Debug(tag, "Height : " + webView.ContentSize.Height);
717 tlog.Debug(tag, $"WebViewContentSize END (OK)");
722 [Description("WebView VideoHoleEnabled.")]
723 [Property("SPEC", "Tizen.NUI.WebView.VideoHoleEnabled A")]
724 [Property("SPEC_URL", "-")]
725 [Property("CRITERIA", "PRW")]
726 [Property("COVPARAM", "")]
727 [Property("AUTHOR", "guowei.wang@samsung.com")]
728 public void WebViewVideoHoleEnabled()
730 tlog.Debug(tag, $"WebViewVideoHoleEnabled START");
732 webView.VideoHoleEnabled = true;
733 tlog.Debug(tag, "VideoHoleEnabled : " + webView.VideoHoleEnabled);
735 webView.VideoHoleEnabled = false;
736 tlog.Debug(tag, "VideoHoleEnabled : " + webView.VideoHoleEnabled);
738 tlog.Debug(tag, $"WebViewVideoHoleEnabled END (OK)");
743 [Description("WebView MouseEventsEnabled.")]
744 [Property("SPEC", "Tizen.NUI.WebView.MouseEventsEnabled A")]
745 [Property("SPEC_URL", "-")]
746 [Property("CRITERIA", "PRW")]
747 [Property("COVPARAM", "")]
748 [Property("AUTHOR", "guowei.wang@samsung.com")]
749 public void WebViewMouseEventsEnabled()
751 tlog.Debug(tag, $"WebViewMouseEventsEnabled START");
753 webView.MouseEventsEnabled = true;
754 tlog.Debug(tag, "MouseEventsEnabled : " + webView.MouseEventsEnabled);
756 webView.MouseEventsEnabled = false;
757 tlog.Debug(tag, "MouseEventsEnabled : " + webView.MouseEventsEnabled);
759 tlog.Debug(tag, $"WebViewMouseEventsEnabled END (OK)");
764 [Description("WebView KeyEventsEnabled.")]
765 [Property("SPEC", "Tizen.NUI.WebView.KeyEventsEnabled A")]
766 [Property("SPEC_URL", "-")]
767 [Property("CRITERIA", "PRW")]
768 [Property("COVPARAM", "")]
769 [Property("AUTHOR", "guowei.wang@samsung.com")]
770 public void WebViewKeyEventsEnabled()
772 tlog.Debug(tag, $"WebViewKeyEventsEnabled START");
774 webView.KeyEventsEnabled = true;
775 tlog.Debug(tag, "KeyEventsEnabled : " + webView.KeyEventsEnabled);
777 webView.KeyEventsEnabled = false;
778 tlog.Debug(tag, "KeyEventsEnabled : " + webView.KeyEventsEnabled);
780 tlog.Debug(tag, $"WebViewKeyEventsEnabled END (OK)");
785 [Description("WebView ContentBackgroundColor.")]
786 [Property("SPEC", "Tizen.NUI.WebView.ContentBackgroundColor A")]
787 [Property("SPEC_URL", "-")]
788 [Property("CRITERIA", "PRW")]
789 [Property("COVPARAM", "")]
790 [Property("AUTHOR", "guowei.wang@samsung.com")]
791 public async Task WebViewContentBackgroundColor()
793 tlog.Debug(tag, $"WebViewContentBackgroundColor START");
795 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
796 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
798 webView.ContentBackgroundColor = new Vector4(0.3f, 0.5f, 1.0f, 0.0f);
799 tcs.TrySetResult(true);
801 webView.PageLoadFinished += onLoadFinished;
802 webView.LoadUrl(url);
803 var result = await tcs.Task;
804 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
806 // Make current thread (CPU) sleep...
809 webView.PageLoadFinished -= onLoadFinished;
811 tlog.Debug(tag, "ContentBackgroundColor : " + webView.ContentBackgroundColor);
813 tlog.Debug(tag, $"WebViewContentBackgroundColor END (OK)");
818 [Description("WebView TilesClearedWhenHidden.")]
819 [Property("SPEC", "Tizen.NUI.WebView.TilesClearedWhenHidden A")]
820 [Property("SPEC_URL", "-")]
821 [Property("CRITERIA", "PRW")]
822 [Property("COVPARAM", "")]
823 [Property("AUTHOR", "guowei.wang@samsung.com")]
824 public void WebViewTilesClearedWhenHidden()
826 tlog.Debug(tag, $"WebViewTilesClearedWhenHidden START");
828 webView.TilesClearedWhenHidden = true;
829 tlog.Debug(tag, "TilesClearedWhenHidden : " + webView.TilesClearedWhenHidden);
831 webView.TilesClearedWhenHidden = false;
832 tlog.Debug(tag, "TilesClearedWhenHidden : " + webView.TilesClearedWhenHidden);
834 tlog.Debug(tag, $"WebViewTilesClearedWhenHidden END (OK)");
839 [Description("WebView TileCoverAreaMultiplier.")]
840 [Property("SPEC", "Tizen.NUI.WebView.TileCoverAreaMultiplier A")]
841 [Property("SPEC_URL", "-")]
842 [Property("CRITERIA", "PRW")]
843 [Property("COVPARAM", "")]
844 [Property("AUTHOR", "guowei.wang@samsung.com")]
845 public void WebViewTileCoverAreaMultiplier()
847 tlog.Debug(tag, $"WebViewTileCoverAreaMultiplier START");
849 webView.TileCoverAreaMultiplier = 0.3f;
850 tlog.Debug(tag, "TileCoverAreaMultiplier : " + webView.TileCoverAreaMultiplier);
852 tlog.Debug(tag, $"WebViewTileCoverAreaMultiplier END (OK)");
857 [Description("WebView CursorEnabledByClient.")]
858 [Property("SPEC", "Tizen.NUI.WebView.CursorEnabledByClient A")]
859 [Property("SPEC_URL", "-")]
860 [Property("CRITERIA", "PRW")]
861 [Property("COVPARAM", "")]
862 [Property("AUTHOR", "guowei.wang@samsung.com")]
863 public void WebViewCursorEnabledByClient()
865 tlog.Debug(tag, $"WebViewCursorEnabledByClient START");
867 webView.CursorEnabledByClient = true;
868 tlog.Debug(tag, "CursorEnabledByClient : " + webView.CursorEnabledByClient);
870 webView.CursorEnabledByClient = false;
871 tlog.Debug(tag, "CursorEnabledByClient : " + webView.CursorEnabledByClient);
873 tlog.Debug(tag, $"WebViewCursorEnabledByClient END (OK)");
878 [Description("WebView SelectedText.")]
879 [Property("SPEC", "Tizen.NUI.WebView.SelectedText A")]
880 [Property("SPEC_URL", "-")]
881 [Property("CRITERIA", "PRO")]
882 [Property("COVPARAM", "")]
883 [Property("AUTHOR", "guowei.wang@samsung.com")]
884 public void WebViewSelectedText()
886 tlog.Debug(tag, $"WebViewSelectedText START");
888 var text = webView.SelectedText;
889 tlog.Debug(tag, "SelectedText : " + text);
891 tlog.Debug(tag, $"WebViewSelectedText END (OK)");
896 [Description("WebView Title.")]
897 [Property("SPEC", "Tizen.NUI.WebView.Title A")]
898 [Property("SPEC_URL", "-")]
899 [Property("CRITERIA", "PRO")]
900 [Property("COVPARAM", "")]
901 [Property("AUTHOR", "guowei.wang@samsung.com")]
902 public void WebViewTitle()
904 tlog.Debug(tag, $"WebViewTitle START");
906 var title = webView.Title;
907 tlog.Debug(tag, "Title : " + title);
909 tlog.Debug(tag, $"WebViewTitle END (OK)");
914 [Description("WebView Favicon.")]
915 [Property("SPEC", "Tizen.NUI.WebView.Favicon A")]
916 [Property("SPEC_URL", "-")]
917 [Property("CRITERIA", "PRO")]
918 [Property("COVPARAM", "")]
919 [Property("AUTHOR", "guowei.wang@samsung.com")]
920 public void WebViewFavicon()
922 tlog.Debug(tag, $"WebViewFavicon START");
924 var fav = webView.Favicon;
925 tlog.Debug(tag, "Favicon : " + fav);
927 tlog.Debug(tag, $"WebViewFavicon END (OK)");
932 [Description("WebView PageZoomFactor.")]
933 [Property("SPEC", "Tizen.NUI.WebView.PageZoomFactor A")]
934 [Property("SPEC_URL", "-")]
935 [Property("CRITERIA", "PRW")]
936 [Property("COVPARAM", "")]
937 [Property("AUTHOR", "guowei.wang@samsung.com")]
938 public void WebViewPageZoomFactor()
940 tlog.Debug(tag, $"WebViewPageZoomFactor START");
942 webView.PageZoomFactor = 0.3f;
943 tlog.Debug(tag, "PageZoomFactor : " + webView.PageZoomFactor);
945 tlog.Debug(tag, $"WebViewPageZoomFactor END (OK)");
950 [Description("WebView TextZoomFactor.")]
951 [Property("SPEC", "Tizen.NUI.WebView.TextZoomFactor A")]
952 [Property("SPEC_URL", "-")]
953 [Property("CRITERIA", "PRW")]
954 [Property("COVPARAM", "")]
955 [Property("AUTHOR", "guowei.wang@samsung.com")]
956 public void WebViewTextZoomFactor()
958 tlog.Debug(tag, $"WebViewTextZoomFactor START");
960 webView.TextZoomFactor = 0.2f;
961 tlog.Debug(tag, "TextZoomFactor : " + webView.TextZoomFactor);
963 tlog.Debug(tag, $"WebViewTextZoomFactor END (OK)");
968 [Description("WebView LoadProgressPercentage.")]
969 [Property("SPEC", "Tizen.NUI.WebView.LoadProgressPercentage A")]
970 [Property("SPEC_URL", "-")]
971 [Property("CRITERIA", "PRO")]
972 [Property("COVPARAM", "")]
973 [Property("AUTHOR", "guowei.wang@samsung.com")]
974 public void WebViewLoadProgressPercentage()
976 tlog.Debug(tag, $"WebViewLoadProgressPercentage START");
978 var result = webView.LoadProgressPercentage;
979 tlog.Debug(tag, "LoadProgressPercentage : " + result);
981 tlog.Debug(tag, $"WebViewLoadProgressPercentage END (OK)");
986 [Description("WebView LoadHtmlString.")]
987 [Property("SPEC", "Tizen.NUI.WebView.LoadHtmlString M")]
988 [Property("SPEC_URL", "-")]
989 [Property("CRITERIA", "MR")]
990 [Property("COVPARAM", "")]
991 [Property("AUTHOR", "guowei.wang@samsung.com")]
992 public async Task WebViewLoadHtmlString()
994 tlog.Debug(tag, $"WebViewLoadHtmlString START");
996 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
997 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
999 tlog.Info(tag, "onLoadFinished is called!");
1000 tcs.TrySetResult(true);
1002 webView.PageLoadFinished += onLoadFinished;
1004 webView.LoadHtmlString("<html><head lang=\"en\"></head></html>");
1006 var result = await tcs.Task;
1007 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1009 // Make current thread (CPU) sleep...
1010 await Task.Delay(1);
1012 webView.PageLoadFinished -= onLoadFinished;
1014 tlog.Debug(tag, $"WebViewLoadHtmlString END (OK)");
1019 [Description("WebView LoadHTMLString.")]
1020 [Property("SPEC", "Tizen.NUI.WebView.LoadHTMLString M")]
1021 [Property("SPEC_URL", "-")]
1022 [Property("CRITERIA", "MR")]
1023 [Property("COVPARAM", "")]
1024 [Property("AUTHOR", "guowei.wang@samsung.com")]
1025 public async Task WebViewLoadHTMLString()
1027 tlog.Debug(tag, $"WebViewLoadHTMLString START");
1029 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1030 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1032 tlog.Info(tag, "onLoadFinished is called!");
1033 tcs.TrySetResult(true);
1035 webView.PageLoadFinished += onLoadFinished;
1037 webView.LoadHTMLString("<html><head lang=\"en\"></head></html>");
1039 var result = await tcs.Task;
1040 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1042 // Make current thread (CPU) sleep...
1043 await Task.Delay(1);
1045 webView.PageLoadFinished -= onLoadFinished;
1047 tlog.Debug(tag, $"WebViewLoadHTMLString END (OK)");
1052 [Description("WebView LoadContents.")]
1053 [Property("SPEC", "Tizen.NUI.WebView.LoadContents M")]
1054 [Property("SPEC_URL", "-")]
1055 [Property("CRITERIA", "MR")]
1056 [Property("COVPARAM", "")]
1057 [Property("AUTHOR", "guowei.wang@samsung.com")]
1058 public async Task WebViewLoadContents()
1060 tlog.Debug(tag, $"WebViewLoadContents START");
1062 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1063 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1065 tlog.Info(tag, "onLoadFinished is called!");
1066 tcs.TrySetResult(true);
1068 webView.PageLoadFinished += onLoadFinished;
1070 webView.LoadContents("body", 18, " ", "gbk", null);
1072 var result = await tcs.Task;
1073 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1075 // Make current thread (CPU) sleep...
1076 await Task.Delay(1);
1078 webView.PageLoadFinished -= onLoadFinished;
1080 tlog.Debug(tag, $"WebViewLoadContents END (OK)");
1085 [Description("WebView Reload.")]
1086 [Property("SPEC", "Tizen.NUI.WebView.Reload M")]
1087 [Property("SPEC_URL", "-")]
1088 [Property("CRITERIA", "MR")]
1089 [Property("COVPARAM", "")]
1090 [Property("AUTHOR", "guowei.wang@samsung.com")]
1091 public async Task WebViewReload()
1093 tlog.Debug(tag, $"WebViewReload START");
1095 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1096 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1098 tlog.Info(tag, "onLoadFinished is called!");
1099 tcs.TrySetResult(true);
1101 webView.PageLoadFinished += onLoadFinished;
1103 webView.LoadUrl(url);
1105 var result = await tcs.Task;
1106 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1108 // Make current thread (CPU) sleep...
1109 await Task.Delay(1);
1113 webView.PageLoadFinished -= onLoadFinished;
1115 tlog.Debug(tag, $"WebViewReload END (OK)");
1120 [Description("WebView ReloadWithoutCache.")]
1121 [Property("SPEC", "Tizen.NUI.WebView.ReloadWithoutCache M")]
1122 [Property("SPEC_URL", "-")]
1123 [Property("CRITERIA", "MR")]
1124 [Property("COVPARAM", "")]
1125 [Property("AUTHOR", "guowei.wang@samsung.com")]
1126 public async Task WebViewReloadWithoutCache()
1128 tlog.Debug(tag, $"WebViewReloadWithoutCache START");
1130 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1131 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1133 tlog.Info(tag, "onLoadFinished is called!");
1134 tcs.TrySetResult(true);
1136 webView.PageLoadFinished += onLoadFinished;
1138 webView.LoadUrl(url);
1140 var result = await tcs.Task;
1141 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1143 // Make current thread (CPU) sleep...
1144 await Task.Delay(1);
1146 webView.ReloadWithoutCache();
1148 webView.PageLoadFinished -= onLoadFinished;
1150 tlog.Debug(tag, $"WebViewReloadWithoutCache END (OK)");
1155 [Description("WebView StopLoading.")]
1156 [Property("SPEC", "Tizen.NUI.WebView.StopLoading M")]
1157 [Property("SPEC_URL", "-")]
1158 [Property("CRITERIA", "MR")]
1159 [Property("COVPARAM", "")]
1160 [Property("AUTHOR", "guowei.wang@samsung.com")]
1161 public async Task WebViewStopLoading()
1163 tlog.Debug(tag, $"WebViewStopLoading START");
1165 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1166 EventHandler<WebViewPageLoadEventArgs> onLoadStarted = (s, e) =>
1168 tlog.Info(tag, "onLoadFinished is called!");
1169 tcs.TrySetResult(true);
1171 webView.PageLoadStarted += onLoadStarted;
1173 webView.LoadUrl(url);
1175 var result = await tcs.Task;
1176 Assert.IsTrue(result, "PageLoadStarted event should be invoked");
1178 // Make current thread (CPU) sleep...
1179 await Task.Delay(1);
1181 webView.StopLoading();
1183 webView.PageLoadStarted -= onLoadStarted;
1185 tlog.Debug(tag, $"WebViewStopLoading END (OK)");
1190 [Description("WebView Suspend.")]
1191 [Property("SPEC", "Tizen.NUI.WebView.Suspend M")]
1192 [Property("SPEC_URL", "-")]
1193 [Property("CRITERIA", "MR")]
1194 [Property("COVPARAM", "")]
1195 [Property("AUTHOR", "guowei.wang@samsung.com")]
1196 public async Task WebViewSuspend()
1198 tlog.Debug(tag, $"WebViewSuspend START");
1200 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1201 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1203 tlog.Info(tag, "onLoadFinished is called!");
1204 tcs.TrySetResult(true);
1206 webView.PageLoadFinished += onLoadFinished;
1207 webView.LoadUrl(url);
1209 var result = await tcs.Task;
1210 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1212 // Make current thread (CPU) sleep...
1213 await Task.Delay(1);
1218 webView.PageLoadFinished -= onLoadFinished;
1220 tlog.Debug(tag, $"WebViewSuspend END (OK)");
1225 [Description("WebView SuspendNetworkLoading.")]
1226 [Property("SPEC", "Tizen.NUI.WebView.SuspendNetworkLoading M")]
1227 [Property("SPEC_URL", "-")]
1228 [Property("CRITERIA", "MR")]
1229 [Property("COVPARAM", "")]
1230 [Property("AUTHOR", "guowei.wang@samsung.com")]
1231 public async Task WebViewSuspendNetworkLoading()
1233 tlog.Debug(tag, $"WebViewSuspendNetworkLoading START");
1235 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1236 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1238 tlog.Info(tag, "onLoadFinished is called!");
1239 tcs.TrySetResult(true);
1241 webView.PageLoadFinished += onLoadFinished;
1243 webView.LoadUrl(url);
1245 var result = await tcs.Task;
1246 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1248 // Make current thread (CPU) sleep...
1249 await Task.Delay(1);
1251 webView.SuspendNetworkLoading();
1252 webView.ResumeNetworkLoading();
1254 webView.PageLoadFinished -= onLoadFinished;
1256 tlog.Debug(tag, $"WebViewSuspendNetworkLoading END (OK)");
1261 [Description("WebView AddCustomHeader.")]
1262 [Property("SPEC", "Tizen.NUI.WebView.AddCustomHeader M")]
1263 [Property("SPEC_URL", "-")]
1264 [Property("CRITERIA", "MR")]
1265 [Property("COVPARAM", "")]
1266 [Property("AUTHOR", "guowei.wang@samsung.com")]
1267 public void WebViewAddCustomHeader()
1269 tlog.Debug(tag, $"WebViewAddCustomHeader START");
1271 var result = webView.AddCustomHeader("customHeader_title", "font-size: 32rpx");
1272 tlog.Debug(tag, "AddCustomHeader : " + result);
1274 result = webView.RemoveCustomHeader("customHeader_title");
1275 tlog.Debug(tag, "RemoveCustomHeader : " + result);
1277 tlog.Debug(tag, $"WebViewAddCustomHeader END (OK)");
1282 [Description("WebView ScrollBy.")]
1283 [Property("SPEC", "Tizen.NUI.WebView.ScrollBy M")]
1284 [Property("SPEC_URL", "-")]
1285 [Property("CRITERIA", "MR")]
1286 [Property("COVPARAM", "")]
1287 [Property("AUTHOR", "guowei.wang@samsung.com")]
1288 public async Task WebViewScrollBy()
1290 tlog.Debug(tag, $"WebViewScrollBy START");
1292 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1293 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1295 tlog.Info(tag, "onLoadFinished is called!");
1296 tcs.TrySetResult(true);
1298 webView.PageLoadFinished += onLoadFinished;
1300 webView.LoadUrl(url);
1301 var result = await tcs.Task;
1302 Assert.IsTrue(result, "ScrollEdgeReached event should be invoked");
1304 // Make current thread (CPU) sleep...
1305 await Task.Delay(1);
1307 webView.ScrollBy(0, 60);
1309 webView.PageLoadFinished -= onLoadFinished;
1311 tlog.Debug(tag, $"WebViewScrollBy END (OK)");
1316 [Description("WebView ScrollEdgeBy.")]
1317 [Property("SPEC", "Tizen.NUI.WebView.ScrollEdgeBy M")]
1318 [Property("SPEC_URL", "-")]
1319 [Property("CRITERIA", "MR")]
1320 [Property("COVPARAM", "")]
1321 [Property("AUTHOR", "guowei.wang@samsung.com")]
1322 public async Task WebViewScrollEdgeBy()
1324 tlog.Debug(tag, $"WebViewScrollEdgeBy START");
1326 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1327 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1329 tlog.Info(tag, "onLoadFinished is called!");
1330 tcs.TrySetResult(true);
1332 webView.PageLoadFinished += onLoadFinished;
1334 webView.LoadUrl(url);
1335 var result = await tcs.Task;
1336 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1338 // Make current thread (CPU) sleep...
1339 await Task.Delay(1);
1341 webView.ScrollEdgeBy(0, 60);
1343 webView.PageLoadFinished -= onLoadFinished;
1345 tlog.Debug(tag, $"WebViewScrollEdgeBy END (OK)");
1350 [Description("WebView GoBack.")]
1351 [Property("SPEC", "Tizen.NUI.WebView.GoBack M")]
1352 [Property("SPEC_URL", "-")]
1353 [Property("CRITERIA", "MR")]
1354 [Property("COVPARAM", "")]
1355 [Property("AUTHOR", "guowei.wang@samsung.com")]
1356 public async Task WebViewGoBack()
1358 tlog.Debug(tag, $"WebViewGoBack START");
1360 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1361 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1363 if (webView.Url.Contains("index.html"))
1365 tlog.Info(tag, "onLoadFinished is called!");
1366 webView.LoadUrl(secondUrl);
1370 tlog.Info(tag, "onLoadFinished is called!");
1371 tcs.TrySetResult(true);
1374 webView.PageLoadFinished += onLoadFinished;
1376 webView.LoadUrl(url);
1377 var result = await tcs.Task;
1378 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1380 // Make current thread (CPU) sleep...
1381 await Task.Delay(1);
1385 webView.PageLoadFinished -= onLoadFinished;
1387 tlog.Debug(tag, $"WebViewGoBack END (OK)");
1392 [Description("WebView GoForward.")]
1393 [Property("SPEC", "Tizen.NUI.WebView.GoForward M")]
1394 [Property("SPEC_URL", "-")]
1395 [Property("CRITERIA", "MR")]
1396 [Property("COVPARAM", "")]
1397 [Property("AUTHOR", "guowei.wang@samsung.com")]
1398 public async Task WebViewGoForward()
1400 tlog.Debug(tag, $"WebViewGoForward START");
1402 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1403 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1405 if (webView.Url.Contains("index.html"))
1407 tlog.Info(tag, "onLoadFinished is called!");
1408 webView.LoadUrl(secondUrl);
1412 tlog.Info(tag, "onLoadFinished is called!");
1413 tcs.TrySetResult(true);
1416 webView.PageLoadFinished += onLoadFinished;
1418 webView.LoadUrl(url);
1419 var result = await tcs.Task;
1420 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1422 // Make current thread (CPU) sleep...
1423 await Task.Delay(1);
1426 webView.GoForward();
1428 webView.PageLoadFinished -= onLoadFinished;
1430 tlog.Debug(tag, $"WebViewGoForward END (OK)");
1435 [Description("WebView CanGoBack.")]
1436 [Property("SPEC", "Tizen.NUI.WebView.CanGoBack M")]
1437 [Property("SPEC_URL", "-")]
1438 [Property("CRITERIA", "MR")]
1439 [Property("COVPARAM", "")]
1440 [Property("AUTHOR", "guowei.wang@samsung.com")]
1441 public async Task WebViewCanGoBack()
1443 tlog.Debug(tag, $"WebViewCanGoBack START");
1445 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1446 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1448 if (webView.Url.Contains("index.html"))
1450 tlog.Info(tag, "onLoadFinished is called!");
1451 webView.LoadUrl(secondUrl);
1455 tlog.Info(tag, "onLoadFinished is called!");
1456 tcs.TrySetResult(true);
1459 webView.PageLoadFinished += onLoadFinished;
1461 webView.LoadUrl(url);
1462 var result = await tcs.Task;
1463 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1465 // Make current thread (CPU) sleep...
1466 await Task.Delay(1);
1468 var canGo = webView.CanGoBack();
1469 Assert.IsTrue(canGo, "CanGoBack should be invoked");
1471 webView.PageLoadFinished -= onLoadFinished;
1473 tlog.Debug(tag, $"WebViewCanGoBack END (OK)");
1478 [Description("WebView CanGoForward.")]
1479 [Property("SPEC", "Tizen.NUI.WebView.CanGoForward M")]
1480 [Property("SPEC_URL", "-")]
1481 [Property("CRITERIA", "MR")]
1482 [Property("COVPARAM", "")]
1483 [Property("AUTHOR", "guowei.wang@samsung.com")]
1484 public async Task WebViewCanGoForward()
1486 tlog.Debug(tag, $"WebViewCanGoForward START");
1488 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1489 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1491 if (webView.Url.Contains("index.html"))
1493 tlog.Info(tag, "onLoadFinished is called!");
1494 webView.LoadUrl(secondUrl);
1498 tlog.Info(tag, "onLoadFinished is called!");
1499 tcs.TrySetResult(true);
1502 webView.PageLoadFinished += onLoadFinished;
1504 webView.LoadUrl(url);
1505 var result = await tcs.Task;
1506 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1508 // Make current thread (CPU) sleep...
1509 await Task.Delay(1);
1511 if (webView.CanGoForward())
1516 webView.PageLoadFinished -= onLoadFinished;
1518 tlog.Debug(tag, $"WebViewCanGoForward END (OK)");
1523 [Description("WebView EvaluateJavaScript.")]
1524 [Property("SPEC", "Tizen.NUI.WebView.EvaluateJavaScript M")]
1525 [Property("SPEC_URL", "-")]
1526 [Property("CRITERIA", "MR")]
1527 [Property("COVPARAM", "")]
1528 [Property("AUTHOR", "guowei.wang@samsung.com")]
1529 public async Task WebViewEvaluateJavaScript()
1531 tlog.Debug(tag, $"WebViewEvaluateJavaScript START");
1533 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1534 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1536 tlog.Info(tag, "onLoadFinished is called!");
1537 tcs.TrySetResult(true);
1539 webView.PageLoadFinished += onLoadFinished;
1541 webView.LoadUrl(url);
1542 var result = await tcs.Task;
1543 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1545 // Make current thread (CPU) sleep...
1546 await Task.Delay(1);
1548 webView.EvaluateJavaScript("<script type=\"text / javascript\">document.write(\"page\");</script>");
1550 webView.PageLoadFinished -= onLoadFinished;
1552 tlog.Debug(tag, $"WebViewEvaluateJavaScript END (OK)");
1557 [Description("WebView AddJavaScriptMessageHandler.")]
1558 [Property("SPEC", "Tizen.NUI.WebView.AddJavaScriptMessageHandler M")]
1559 [Property("SPEC_URL", "-")]
1560 [Property("CRITERIA", "MR")]
1561 [Property("COVPARAM", "")]
1562 [Property("AUTHOR", "guowei.wang@samsung.com")]
1563 public async Task WebViewAddJavaScriptMessageHandler()
1565 tlog.Debug(tag, $"WebViewAddJavaScriptMessageHandler START");
1567 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1568 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1570 tlog.Info(tag, "onLoadFinished is called!");
1571 tcs.TrySetResult(true);
1573 webView.PageLoadFinished += onLoadFinished;
1575 webView.LoadUrl(url);
1576 var result = await tcs.Task;
1577 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1579 // Make current thread (CPU) sleep...
1580 await Task.Delay(1);
1582 webView.AddJavaScriptMessageHandler("AllowOrigin", JsCallback);
1584 webView.PageLoadFinished -= onLoadFinished;
1586 tlog.Debug(tag, $"WebViewAddJavaScriptMessageHandler END (OK)");
1591 [Description("WebView RegisterJavaScriptAlertCallback.")]
1592 [Property("SPEC", "Tizen.NUI.WebView.RegisterJavaScriptAlertCallback M")]
1593 [Property("SPEC_URL", "-")]
1594 [Property("CRITERIA", "MR")]
1595 [Property("COVPARAM", "")]
1596 [Property("AUTHOR", "guowei.wang@samsung.com")]
1597 public async Task WebViewRegisterJavaScriptAlertCallback()
1599 tlog.Debug(tag, $"WebViewRegisterJavaScriptAlertCallback START");
1601 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1602 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1604 tlog.Info(tag, "onLoadFinished is called!");
1605 tcs.TrySetResult(true);
1607 webView.PageLoadFinished += onLoadFinished;
1609 webView.RegisterJavaScriptAlertCallback(JsCallback);
1611 webView.LoadUrl(url);
1612 var result = await tcs.Task;
1613 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1615 // Make current thread (CPU) sleep...
1616 await Task.Delay(1);
1618 webView.PageLoadFinished -= onLoadFinished;
1620 tlog.Debug(tag, $"WebViewRegisterJavaScriptAlertCallback END (OK)");
1625 [Description("WebView RegisterJavaScriptConfirmCallback.")]
1626 [Property("SPEC", "Tizen.NUI.WebView.RegisterJavaScriptConfirmCallback M")]
1627 [Property("SPEC_URL", "-")]
1628 [Property("CRITERIA", "MR")]
1629 [Property("COVPARAM", "")]
1630 [Property("AUTHOR", "guowei.wang@samsung.com")]
1631 public async Task WebViewRegisterJavaScriptConfirmCallback()
1633 tlog.Debug(tag, $"WebViewRegisterJavaScriptConfirmCallback START");
1635 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1636 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1638 tlog.Info(tag, "onLoadFinished is called!");
1639 tcs.TrySetResult(true);
1641 webView.PageLoadFinished += onLoadFinished;
1643 webView.RegisterJavaScriptConfirmCallback(JsCallback);
1645 webView.LoadUrl(url);
1646 var result = await tcs.Task;
1647 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1649 // Make current thread (CPU) sleep...
1650 await Task.Delay(1);
1652 webView.PageLoadFinished -= onLoadFinished;
1654 tlog.Debug(tag, $"WebViewRegisterJavaScriptConfirmCallback END (OK)");
1659 [Description("WebView RegisterJavaScriptPromptCallback.")]
1660 [Property("SPEC", "Tizen.NUI.WebView.RegisterJavaScriptPromptCallback M")]
1661 [Property("SPEC_URL", "-")]
1662 [Property("CRITERIA", "MR")]
1663 [Property("COVPARAM", "")]
1664 [Property("AUTHOR", "guowei.wang@samsung.com")]
1665 public async Task WebViewRegisterJavaScriptPromptCallback()
1667 tlog.Debug(tag, $"WebViewRegisterJavaScriptPromptCallback START");
1669 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1670 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1672 tlog.Info(tag, "onLoadFinished is called!");
1673 tcs.TrySetResult(true);
1675 webView.PageLoadFinished += onLoadFinished;
1677 webView.RegisterJavaScriptPromptCallback(PromptCallback);
1679 webView.LoadUrl(url);
1680 var result = await tcs.Task;
1681 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1683 // Make current thread (CPU) sleep...
1684 await Task.Delay(1);
1686 webView.PageLoadFinished -= onLoadFinished;
1688 tlog.Debug(tag, $"WebViewRegisterJavaScriptPromptCallback END (OK)");
1693 [Description("WebView ClearAllTilesResources.")]
1694 [Property("SPEC", "Tizen.NUI.WebView.ClearAllTilesResources M")]
1695 [Property("SPEC_URL", "-")]
1696 [Property("CRITERIA", "MR")]
1697 [Property("COVPARAM", "")]
1698 [Property("AUTHOR", "guowei.wang@samsung.com")]
1699 public async Task WebViewClearAllTilesResources()
1701 tlog.Debug(tag, $"WebViewClearAllTilesResources START");
1703 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1704 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1706 tlog.Info(tag, "onLoadFinished is called!");
1707 tcs.TrySetResult(true);
1709 webView.PageLoadFinished += onLoadFinished;
1711 webView.LoadUrl(url);
1712 var result = await tcs.Task;
1713 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1715 // Make current thread (CPU) sleep...
1716 await Task.Delay(1);
1718 webView.ClearAllTilesResources();
1720 webView.PageLoadFinished -= onLoadFinished;
1722 tlog.Debug(tag, $"WebViewClearAllTilesResources END (OK)");
1727 [Description("WebView ClearHistory.")]
1728 [Property("SPEC", "Tizen.NUI.WebView.ClearHistory M")]
1729 [Property("SPEC_URL", "-")]
1730 [Property("CRITERIA", "MR")]
1731 [Property("COVPARAM", "")]
1732 [Property("AUTHOR", "guowei.wang@samsung.com")]
1733 public async Task WebViewClearHistory()
1735 tlog.Debug(tag, $"WebViewClearHistory START");
1737 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1738 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1740 tlog.Info(tag, "onLoadFinished is called!");
1741 tcs.TrySetResult(true);
1743 webView.PageLoadFinished += onLoadFinished;
1745 webView.LoadUrl(url);
1746 var result = await tcs.Task;
1747 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1749 // Make current thread (CPU) sleep...
1750 await Task.Delay(1);
1752 webView.ClearHistory();
1754 webView.PageLoadFinished -= onLoadFinished;
1756 tlog.Debug(tag, $"WebViewClearHistory END (OK)");
1761 [Description("WebView SetScaleFactor.")]
1762 [Property("SPEC", "Tizen.NUI.WebView.SetScaleFactor M")]
1763 [Property("SPEC_URL", "-")]
1764 [Property("CRITERIA", "MR")]
1765 [Property("COVPARAM", "")]
1766 [Property("AUTHOR", "guowei.wang@samsung.com")]
1767 public async Task WebViewSetScaleFactor()
1769 tlog.Debug(tag, $"WebViewSetScaleFactor START");
1771 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1772 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1774 tlog.Info(tag, "onLoadFinished is called!");
1775 tcs.TrySetResult(true);
1777 webView.PageLoadFinished += onLoadFinished;
1779 webView.LoadUrl(url);
1780 var result = await tcs.Task;
1781 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1783 // Make current thread (CPU) sleep...
1784 await Task.Delay(1);
1786 using (Vector2 point = new Vector2(1.0f, 1.0f))
1788 webView.SetScaleFactor(0.2f, point);
1790 var factor = webView.GetScaleFactor();
1791 tlog.Debug(tag, "ScaleFactor : " + factor);
1794 webView.PageLoadFinished -= onLoadFinished;
1796 tlog.Debug(tag, $"WebViewSetScaleFactor END (OK)");
1801 [Description("WebView ActivateAccessibility.")]
1802 [Property("SPEC", "Tizen.NUI.WebView.ActivateAccessibility M")]
1803 [Property("SPEC_URL", "-")]
1804 [Property("CRITERIA", "MR")]
1805 [Property("COVPARAM", "")]
1806 [Property("AUTHOR", "guowei.wang@samsung.com")]
1807 public async Task WebViewActivateAccessibility()
1809 tlog.Debug(tag, $"WebViewActivateAccessibility START");
1811 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1812 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1814 tlog.Info(tag, "onLoadFinished is called!");
1815 tcs.TrySetResult(true);
1817 webView.PageLoadFinished += onLoadFinished;
1819 webView.LoadUrl(url);
1820 var result = await tcs.Task;
1821 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1823 // Make current thread (CPU) sleep...
1824 await Task.Delay(1);
1826 webView.ActivateAccessibility(false);
1828 webView.PageLoadFinished -= onLoadFinished;
1830 tlog.Debug(tag, $"WebViewActivateAccessibility END (OK)");
1835 [Description("WebView HighlightText.")]
1836 [Property("SPEC", "Tizen.NUI.WebView.HighlightText M")]
1837 [Property("SPEC_URL", "-")]
1838 [Property("CRITERIA", "MR")]
1839 [Property("COVPARAM", "")]
1840 [Property("AUTHOR", "guowei.wang@samsung.com")]
1841 public async Task WebViewHighlightText()
1843 tlog.Debug(tag, $"WebViewHighlightText START");
1845 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1846 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1848 tlog.Info(tag, "onLoadFinished is called!");
1849 tcs.TrySetResult(true);
1851 webView.PageLoadFinished += onLoadFinished;
1853 webView.LoadUrl(url);
1854 var result = await tcs.Task;
1855 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1857 // Make current thread (CPU) sleep...
1858 await Task.Delay(1);
1860 webView.HighlightText("web", BaseComponents.WebView.FindOption.AtWordStart, 3);
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 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 // Make current thread (CPU) sleep...
1892 await Task.Delay(1);
1894 webView.AddDynamicCertificatePath("127.0.0.0", "/");
1896 webView.PageLoadFinished -= onLoadFinished;
1898 tlog.Debug(tag, $"WebViewAddDynamicCertificatePath END (OK)");
1903 [Description("WebView CheckVideoPlayingAsynchronously.")]
1904 [Property("SPEC", "Tizen.NUI.WebView.CheckVideoPlayingAsynchronously M")]
1905 [Property("SPEC_URL", "-")]
1906 [Property("CRITERIA", "MR")]
1907 [Property("COVPARAM", "")]
1908 [Property("AUTHOR", "guowei.wang@samsung.com")]
1909 public async Task WebViewCheckVideoPlayingAsynchronously()
1911 tlog.Debug(tag, $"WebViewCheckVideoPlayingAsynchronously START");
1913 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1914 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1916 tlog.Info(tag, "onLoadFinished is called!");
1917 tcs.TrySetResult(true);
1919 webView.PageLoadFinished += onLoadFinished;
1921 webView.LoadUrl(url);
1922 var result = await tcs.Task;
1923 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1925 // Make current thread (CPU) sleep...
1926 await Task.Delay(1);
1928 webView.CheckVideoPlayingAsynchronously(VideoCallback);
1930 webView.PageLoadFinished -= onLoadFinished;
1932 tlog.Debug(tag, $"WebViewCheckVideoPlayingAsynchronously END (OK)");
1937 [Description("WebView RegisterGeolocationPermissionCallback.")]
1938 [Property("SPEC", "Tizen.NUI.WebView.RegisterGeolocationPermissionCallback M")]
1939 [Property("SPEC_URL", "-")]
1940 [Property("CRITERIA", "MR")]
1941 [Property("COVPARAM", "")]
1942 [Property("AUTHOR", "guowei.wang@samsung.com")]
1943 public async Task WebViewRegisterGeolocationPermissionCallback()
1945 tlog.Debug(tag, $"WebViewRegisterGeolocationPermissionCallback START");
1947 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1948 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1950 tlog.Info(tag, "onLoadFinished is called!");
1951 tcs.TrySetResult(true);
1953 webView.PageLoadFinished += onLoadFinished;
1955 webView.RegisterGeolocationPermissionCallback(GeolocationCallback);
1957 webView.LoadUrl(url);
1958 var result = await tcs.Task;
1959 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1961 // Make current thread (CPU) sleep...
1962 await Task.Delay(1);
1964 webView.PageLoadFinished -= onLoadFinished;
1966 tlog.Debug(tag, $"WebViewRegisterGeolocationPermissionCallback END (OK)");
1971 [Description("WebView GetPlainTextAsynchronously.")]
1972 [Property("SPEC", "Tizen.NUI.WebView.GetPlainTextAsynchronously M")]
1973 [Property("SPEC_URL", "-")]
1974 [Property("CRITERIA", "MR")]
1975 [Property("COVPARAM", "")]
1976 [Property("AUTHOR", "guowei.wang@samsung.com")]
1977 public async Task WebViewGetPlainTextAsynchronously()
1979 tlog.Debug(tag, $"WebViewGetPlainTextAsynchronously START");
1981 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
1982 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
1984 tlog.Info(tag, "onLoadFinished is called!");
1985 tcs.TrySetResult(true);
1987 webView.PageLoadFinished += onLoadFinished;
1989 webView.LoadUrl(url);
1990 var result = await tcs.Task;
1991 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
1993 // Make current thread (CPU) sleep...
1994 await Task.Delay(1);
1996 webView.GetPlainTextAsynchronously(PlainReceivedCallback);
1998 webView.PageLoadFinished -= onLoadFinished;
2000 tlog.Debug(tag, $"WebViewGetPlainTextAsynchronously END (OK)");
2005 [Description("WebView SetTtsFocus.")]
2006 [Property("SPEC", "Tizen.NUI.WebView.SetTtsFocus M")]
2007 [Property("SPEC_URL", "-")]
2008 [Property("CRITERIA", "MR")]
2009 [Property("COVPARAM", "")]
2010 [Property("AUTHOR", "guowei.wang@samsung.com")]
2011 public async Task WebViewSetTtsFocus()
2013 tlog.Debug(tag, $"WebViewSetTtsFocus START");
2015 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
2016 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
2018 tlog.Info(tag, "onLoadFinished is called!");
2019 tcs.TrySetResult(true);
2021 webView.PageLoadFinished += onLoadFinished;
2023 webView.LoadUrl(url);
2024 var result = await tcs.Task;
2025 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
2027 // Make current thread (CPU) sleep...
2028 await Task.Delay(1);
2030 webView.SetTtsFocus(true);
2032 webView.PageLoadFinished -= onLoadFinished;
2034 tlog.Debug(tag, $"WebViewSetTtsFocus END (OK)");
2039 [Description("WebView GetScreenshot.")]
2040 [Property("SPEC", "Tizen.NUI.WebView.GetScreenshot M")]
2041 [Property("SPEC_URL", "-")]
2042 [Property("CRITERIA", "MR")]
2043 [Property("COVPARAM", "")]
2044 [Property("AUTHOR", "guowei.wang@samsung.com")]
2045 public async Task WebViewGetScreenshot()
2047 tlog.Debug(tag, $"WebViewGetScreenshot START");
2049 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
2050 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
2052 tlog.Info(tag, "onLoadFinished is called!");
2053 tcs.TrySetResult(true);
2055 webView.PageLoadFinished += onLoadFinished;
2057 webView.LoadUrl(url);
2058 var result = await tcs.Task;
2059 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
2061 // Make current thread (CPU) sleep...
2062 await Task.Delay(1);
2064 var factor = webView.GetScaleFactor();
2065 webView.GetScreenshot(new Rectangle(5, 6, 100, 200), factor);
2067 webView.PageLoadFinished -= onLoadFinished;
2069 tlog.Debug(tag, $"WebViewGetScreenshot END (OK)");
2074 [Description("WebView GetScreenshotAsynchronously.")]
2075 [Property("SPEC", "Tizen.NUI.WebView.GetScreenshotAsynchronously M")]
2076 [Property("SPEC_URL", "-")]
2077 [Property("CRITERIA", "MR")]
2078 [Property("COVPARAM", "")]
2079 [Property("AUTHOR", "guowei.wang@samsung.com")]
2080 public async Task WebViewGetScreenshotAsynchronously()
2082 tlog.Debug(tag, $"WebViewGetScreenshotAsynchronously START");
2084 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
2085 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
2087 tlog.Info(tag, "onLoadFinished is called!");
2088 tcs.TrySetResult(true);
2090 webView.PageLoadFinished += onLoadFinished;
2092 webView.LoadUrl(url);
2093 var result = await tcs.Task;
2094 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
2096 // Make current thread (CPU) sleep...
2097 await Task.Delay(1);
2099 var factor = webView.GetScaleFactor();
2100 webView.GetScreenshotAsynchronously(new Rectangle(5, 6, 50, 50), factor, ScreenshotAcquiredCallbackCase);
2102 webView.PageLoadFinished -= onLoadFinished;
2104 tlog.Debug(tag, $"WebViewGetScreenshotAsynchronously END (OK)");
2109 [Description("WebView EvaluateJavaScript.")]
2110 [Property("SPEC", "Tizen.NUI.WebView.EvaluateJavaScript M")]
2111 [Property("SPEC_URL", "-")]
2112 [Property("CRITERIA", "MR")]
2113 [Property("COVPARAM", "")]
2114 [Property("AUTHOR", "guowei.wang@samsung.com")]
2115 public async Task WebViewEvaluateJavaScriptWithCallback()
2117 tlog.Debug(tag, $"WebViewEvaluateJavaScriptWithCallback START");
2119 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
2120 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
2122 tlog.Info(tag, "onLoadFinished is called!");
2123 tcs.TrySetResult(true);
2125 webView.PageLoadFinished += onLoadFinished;
2127 webView.LoadUrl(url);
2128 var result = await tcs.Task;
2129 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
2131 // Make current thread (CPU) sleep...
2132 await Task.Delay(1);
2134 webView.EvaluateJavaScript("<script type=\"text / javascript\">document.write(\"page\");</script>", JsCallback);
2136 webView.PageLoadFinished -= onLoadFinished;
2138 tlog.Debug(tag, $"WebViewEvaluateJavaScriptWithCallback END (OK)");
2143 [Description("WebView ClearCache.")]
2144 [Property("SPEC", "Tizen.NUI.WebView.ClearCache M")]
2145 [Property("SPEC_URL", "-")]
2146 [Property("CRITERIA", "MR")]
2147 [Property("COVPARAM", "")]
2148 [Property("AUTHOR", "guowei.wang@samsung.com")]
2149 public async Task WebViewClearCache()
2151 tlog.Debug(tag, $"WebViewClearCache START");
2153 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
2154 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
2156 tlog.Info(tag, "onLoadFinished is called!");
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 // Make current thread (CPU) sleep...
2166 await Task.Delay(1);
2168 webView.ClearCache();
2170 webView.PageLoadFinished -= onLoadFinished;
2172 tlog.Debug(tag, $"WebViewClearCache END (OK)");
2177 [Description("WebView ClearCookies.")]
2178 [Property("SPEC", "Tizen.NUI.WebView.ClearCookies M")]
2179 [Property("SPEC_URL", "-")]
2180 [Property("CRITERIA", "MR")]
2181 [Property("COVPARAM", "")]
2182 [Property("AUTHOR", "guowei.wang@samsung.com")]
2183 public async Task WebViewClearCookies()
2185 tlog.Debug(tag, $"WebViewClearCookies START");
2187 TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
2188 EventHandler<WebViewPageLoadEventArgs> onLoadFinished = (s, e) =>
2190 tlog.Info(tag, "onLoadFinished is called!");
2191 tcs.TrySetResult(true);
2193 webView.PageLoadFinished += onLoadFinished;
2195 webView.LoadUrl(url);
2196 var result = await tcs.Task;
2197 Assert.IsTrue(result, "PageLoadFinished event should be invoked");
2199 // Make current thread (CPU) sleep...
2200 await Task.Delay(1);
2202 webView.ClearCookies();
2204 webView.PageLoadFinished -= onLoadFinished;
2206 tlog.Debug(tag, $"WebViewClearCookies END (OK)");
2211 [Description("WebView DownCast.")]
2212 [Property("SPEC", "Tizen.NUI.WebView.DownCast M")]
2213 [Property("SPEC_URL", "-")]
2214 [Property("CRITERIA", "MR")]
2215 [Property("COVPARAM", "")]
2216 [Property("AUTHOR", "guowei.wang@samsung.com")]
2217 public async Task WebViewDownCast()
2219 tlog.Debug(tag, $"WebViewDownCast START");
2221 BaseComponents.WebView.DownCast(webView);
2223 await Task.Delay(1);
2225 tlog.Debug(tag, $"WebViewDownCast END (OK)");
2230 [Description("WebView Dispose.")]
2231 [Property("SPEC", "Tizen.NUI.WebView.Dispose M")]
2232 [Property("SPEC_URL", "-")]
2233 [Property("CRITERIA", "MR")]
2234 [Property("COVPARAM", "")]
2235 [Property("AUTHOR", "guowei.wang@samsung.com")]
2236 public void WebViewDispose()
2238 tlog.Debug(tag, $"WebViewDispose START");
2240 var testingTarget = new MyWebView();
2241 Assert.IsNotNull(testingTarget, "null handle");
2242 Assert.IsInstanceOf<Tizen.NUI.BaseComponents.WebView>(testingTarget, "Should return WebView instance.");
2244 testingTarget.OnDispose(DisposeTypes.Explicit);
2246 testingTarget.OnDispose(DisposeTypes.Explicit);
2248 tlog.Debug(tag, $"WebViewDispose END (OK)");