0d1088cdb29450fb65cead3002a606293c94f4d3
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / internal / WebView / TSWebHitTestResult.cs
1 using global::System;
2 using NUnit.Framework;
3 using NUnit.Framework.TUnit;
4 using Tizen.NUI.Components;
5 using Tizen.NUI.BaseComponents;
6
7 namespace Tizen.NUI.Devel.Tests
8 {
9     using tlog = Tizen.Log;
10
11     [TestFixture]
12     [Description("internal/WebView/WebHitTestResult")]
13     public class InternalWebHitTestResultTest
14     {
15         private const string tag = "NUITEST";
16         private string url = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";
17
18         internal class MyWebHitTestResult : WebHitTestResult
19         {
20             public MyWebHitTestResult(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
21             { }
22
23             public void OnReleaseSwigCPtr(global::System.Runtime.InteropServices.HandleRef swigCPtr)
24             {
25                 base.ReleaseSwigCPtr(swigCPtr);
26             }
27         }
28
29         [SetUp]
30         public void Init()
31         {
32             tlog.Info(tag, "Init() is called!");
33         }
34
35         [TearDown]
36         public void Destroy()
37         {
38             tlog.Info(tag, "Destroy() is called!");
39         }
40
41         [Test]
42         [Category("P1")]
43         [Description("WebHitTestResult constructor.")]
44         [Property("SPEC", "Tizen.NUI.WebHitTestResult.WebHitTestResult C")]
45         [Property("SPEC_URL", "-")]
46         [Property("CRITERIA", "CONSTR")]
47         [Property("COVPARAM", "")]
48         [Property("AUTHOR", "guowei.wang@samsung.com")]
49         public void WebHitTestResultConstructor()
50         {
51             tlog.Debug(tag, $"WebHitTestResultConstructor START");
52
53             using (Tizen.NUI.BaseComponents.WebView webview = new Tizen.NUI.BaseComponents.WebView("Shanghai", "Asia/Shanghai"))
54             {
55                 var testingTarget = new WebHitTestResult(webview.SwigCPtr.Handle, false);
56                 Assert.IsNotNull(testingTarget, "null handle");
57                 Assert.IsInstanceOf<WebHitTestResult>(testingTarget, "Should return WebHitTestResult instance.");
58
59                 testingTarget.Dispose();
60             }
61
62             tlog.Debug(tag, $"WebHitTestResultConstructor END (OK)");
63         }
64     }
65 }