813ae6694d1c833eeae9abbb97ec8d054f44909c
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / internal / WebView / TSWebViewHttpAuthRequestedEventArgs.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/WebViewHttpAuthRequestedEventArgs")]
13     public class InternalWebViewHttpAuthRequestedEventArgsTest
14     {
15         private const string tag = "NUITEST";
16         private string url = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";
17
18         [SetUp]
19         public void Init()
20         {
21             tlog.Info(tag, "Init() is called!");
22         }
23
24         [TearDown]
25         public void Destroy()
26         {
27             tlog.Info(tag, "Destroy() is called!");
28         }
29
30         [Test]
31         [Category("P1")]
32         [Description("WebViewHttpAuthRequestedEventArgs constructor.")]
33         [Property("SPEC", "Tizen.NUI.WebViewHttpAuthRequestedEventArgs.WebViewHttpAuthRequestedEventArgs C")]
34         [Property("SPEC_URL", "-")]
35         [Property("CRITERIA", "CONSTR")]
36         [Property("COVPARAM", "")]
37         [Property("AUTHOR", "guowei.wang@samsung.com")]
38         public void WebViewHttpAuthRequestedEventArgsConstructor()
39         {
40             tlog.Debug(tag, $"WebViewHttpAuthRequestedEventArgsConstructor START");
41
42             using (Tizen.NUI.BaseComponents.WebView webview = new Tizen.NUI.BaseComponents.WebView("Shanghai", "Asia/Shanghai"))
43             {
44                 WebHttpAuthHandler handler = new WebHttpAuthHandler(webview.SwigCPtr.Handle, false);
45
46                 var testingTarget = new WebViewHttpAuthRequestedEventArgs(handler);
47                 Assert.IsNotNull(testingTarget, "null handle");
48                 Assert.IsInstanceOf<WebViewHttpAuthRequestedEventArgs>(testingTarget, "Should return WebViewHttpAuthRequestedEventArgs instance.");
49
50                 handler.Dispose();
51             }
52
53             tlog.Debug(tag, $"WebViewHttpAuthRequestedEventArgsConstructor END (OK)");
54         }
55
56         [Test]
57         [Category("P1")]
58         [Description("WebViewHttpAuthRequestedEventArgs HttpAuthHandler.")]
59         [Property("SPEC", "Tizen.NUI.WebViewHttpAuthRequestedEventArgs.HttpAuthHandler A")]
60         [Property("SPEC_URL", "-")]
61         [Property("CRITERIA", "PRO")]
62         [Property("COVPARAM", "")]
63         [Property("AUTHOR", "guowei.wang@samsung.com")]
64         public void WebViewHttpRequestInterceptedEventArgsHttpAuthHandler()
65         {
66             tlog.Debug(tag, $"WebViewHttpRequestInterceptedEventArgsHttpAuthHandler START");
67
68             using (Tizen.NUI.BaseComponents.WebView webview = new Tizen.NUI.BaseComponents.WebView("Shanghai", "Asia/Shanghai"))
69             {
70                 WebHttpAuthHandler handler = new WebHttpAuthHandler(webview.SwigCPtr.Handle, false);
71
72                 var testingTarget = new WebViewHttpAuthRequestedEventArgs(handler);
73                 
74                 handler.Dispose();
75             }
76
77             tlog.Debug(tag, $"WebViewHttpRequestInterceptedEventArgsHttpAuthHandler END (OK)");
78         }
79     }
80 }