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("internal/WebView/WebHttpRequestInterceptor")]
14 public class InternalWebHttpRequestInterceptorTest
16 private const string tag = "NUITEST";
17 private string url = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";
18 private static string[] runtimeArgs = { "Tizen.NUI.Devel.Tests", "--enable-dali-window", "--enable-spatial-navigation" };
19 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";
21 internal class MyWebHttpRequestInterceptor : WebHttpRequestInterceptor
23 public MyWebHttpRequestInterceptor(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
26 public void OnReleaseSwigCPtr(global::System.Runtime.InteropServices.HandleRef swigCPtr)
28 base.ReleaseSwigCPtr(swigCPtr);
35 tlog.Info(tag, "Init() is called!");
41 tlog.Info(tag, "Destroy() is called!");
46 [Description("WebHttpRequestInterceptor constructor.")]
47 [Property("SPEC", "Tizen.NUI.WebHttpRequestInterceptor.WebHttpRequestInterceptor C")]
48 [Property("SPEC_URL", "-")]
49 [Property("CRITERIA", "CONSTR")]
50 [Property("COVPARAM", "")]
51 [Property("AUTHOR", "guowei.wang@samsung.com")]
52 public void WebHttpRequestInterceptorConstructor()
54 tlog.Debug(tag, $"WebHttpRequestInterceptorConstructor START");
56 using (Tizen.NUI.BaseComponents.WebView webview = new Tizen.NUI.BaseComponents.WebView("Shanghai", "Asia/Shanghai"))
58 var testingTarget = new WebHttpRequestInterceptor(webview.SwigCPtr.Handle, false);
59 Assert.IsNotNull(testingTarget, "null handle");
60 Assert.IsInstanceOf<WebHttpRequestInterceptor>(testingTarget, "Should return WebHttpRequestInterceptor instance.");
62 testingTarget.Dispose();
65 tlog.Debug(tag, $"WebHttpRequestInterceptorConstructor END (OK)");