[NUI] Add TCs of WebView & Update some TCs of NUI.Devel.
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / internal / WebView / TSWebContextMenu.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 using System.Threading.Tasks;
7
8 namespace Tizen.NUI.Devel.Tests
9 {
10     using tlog = Tizen.Log;
11
12     [TestFixture]
13     [Description("internal/WebView/WebContextMenu")]
14     public class InternalWebContextMenuTest
15     {
16         private const string tag = "NUITEST";
17         private static string[] runtimeArgs = { "Tizen.NUI.Devel.Tests", "--enable-dali-window", "--enable-spatial-navigation" };
18         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";
19
20         private WebContextMenu contextMenu;
21         private Button[] buttons;
22
23         internal class MyWebContextMenu : WebContextMenu
24         {
25             public MyWebContextMenu(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
26             { }
27
28             public void OnReleaseSwigCPtr(global::System.Runtime.InteropServices.HandleRef swigCPtr)
29             {
30                 base.ReleaseSwigCPtr(swigCPtr);
31             }
32         }
33
34         [SetUp]
35         public void Init()
36         {
37             tlog.Info(tag, "Init() is called!");
38         }
39
40         [TearDown]
41         public void Destroy()
42         {
43             tlog.Info(tag, "Destroy() is called!");
44         }
45
46         [Test]
47         [Category("P1")]
48         [Description("WebContextMenu constructor.")]
49         [Property("SPEC", "Tizen.NUI.WebContextMenu.WebContextMenu C")]
50         [Property("SPEC_URL", "-")]
51         [Property("CRITERIA", "CONSTR")]
52         [Property("COVPARAM", "")]
53         [Property("AUTHOR", "guowei.wang@samsung.com")]
54         public void WebContextMenuConstructor()
55         {
56             tlog.Debug(tag, $"WebContextMenuConstructor START");
57
58             using (Tizen.NUI.BaseComponents.WebView webview = new Tizen.NUI.BaseComponents.WebView("Shanghai", "Asia/Shanghai"))
59             {
60                 var testingTarget = new WebContextMenu(webview.SwigCPtr.Handle, false);
61                 Assert.IsNotNull(testingTarget, "null handle");
62                 Assert.IsInstanceOf<WebContextMenu>(testingTarget, "Should return WebContextMenu instance.");
63
64                 testingTarget.Dispose();
65             }
66
67             tlog.Debug(tag, $"WebContextMenuConstructor END (OK)");
68         }
69     }
70 }