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/WebHttpAuthHandler")]
14 public class InternalWebHttpAuthHandlerTest
16 private const string tag = "NUITEST";
17 private string urlForHttpAuth = "https://review.tizen.org/gerrit/#/";
18 private BaseComponents.WebView webview_;
23 tlog.Info(tag, "Init() is called!");
24 webview_ = new BaseComponents.WebView()
26 Size = new Size(500, 200),
33 tlog.Info(tag, "Destroy() is being called!");
35 tlog.Info(tag, "Destroy() is called!");
38 //TODO... This TC will be blocked because web engine does not support it any longer.
41 //[Description("WebHttpAuthHandler CancelCredential.")]
42 //[Property("SPEC", "Tizen.NUI.WebHttpAuthHandler.CancelCredential M")]
43 //[Property("SPEC_URL", "-")]
44 //[Property("CRITERIA", "PRO")]
45 //[Property("COVPARAM", "")]
46 //[Property("AUTHOR", "guowei.wang@samsung.com")]
47 //public async Task WebHttpAuthHandlerCancelCredential()
49 // tlog.Debug(tag, $"WebHttpAuthHandlerRealm START");
51 // TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
52 // EventHandler<WebViewHttpAuthRequestedEventArgs> onHttpAuthRequested = (s, e) =>
54 // tlog.Info(tag, $"HttpAuthRequested, Url: {e.HttpAuthHandler.Realm}");
55 // e.HttpAuthHandler.CancelCredential();
56 // tcs.TrySetResult(true);
59 // webview_.HttpAuthRequested += onHttpAuthRequested;
61 // webview_.LoadUrl(urlForHttpAuth);
62 // var result = await tcs.Task;
63 // Assert.IsTrue(result, "HttpAuthRequested event should be invoked.");
65 // // Make current thread (CPU) sleep...
66 // await Task.Delay(1);
68 // webview_.HttpAuthRequested -= onHttpAuthRequested;
70 // tlog.Debug(tag, $"WebHttpAuthHandlerRealm END (OK)");
73 //TODO... This TC will be blocked because web engine does not support it any longer.
76 //[Description("WebHttpAuthHandler UseCredential.")]
77 //[Property("SPEC", "Tizen.NUI.WebHttpAuthHandler.UseCredential M")]
78 //[Property("SPEC_URL", "-")]
79 //[Property("CRITERIA", "PRO")]
80 //[Property("COVPARAM", "")]
81 //[Property("AUTHOR", "guowei.wang@samsung.com")]
82 //public async Task WebHttpAuthHandlerUseCredential()
84 // tlog.Debug(tag, $"WebHttpAuthHandlerRealm START");
86 // TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
87 // EventHandler<WebViewHttpAuthRequestedEventArgs> onHttpAuthRequested = (s, e) =>
89 // tlog.Info(tag, $"HttpAuthRequested, Url: {e.HttpAuthHandler.Realm}");
90 // e.HttpAuthHandler.UseCredential("tizen", "samsung");
91 // tcs.TrySetResult(true);
94 // webview_.HttpAuthRequested += onHttpAuthRequested;
96 // webview_.LoadUrl(urlForHttpAuth);
97 // var result = await tcs.Task;
98 // Assert.IsTrue(result, "HttpAuthRequested event should be invoked.");
100 // // Make current thread (CPU) sleep...
101 // await Task.Delay(1);
103 // webview_.HttpAuthRequested -= onHttpAuthRequested;
105 // tlog.Debug(tag, $"WebHttpAuthHandlerRealm END (OK)");
108 //TODO... This TC will be blocked because web engine does not support it any longer.
111 //[Description("WebHttpAuthHandler Suspend.")]
112 //[Property("SPEC", "Tizen.NUI.WebHttpAuthHandler.Suspend M")]
113 //[Property("SPEC_URL", "-")]
114 //[Property("CRITERIA", "PRO")]
115 //[Property("COVPARAM", "")]
116 //[Property("AUTHOR", "guowei.wang@samsung.com")]
117 //public async Task WebHttpAuthHandlerSuspend()
119 // tlog.Debug(tag, $"WebHttpAuthHandlerRealm START");
121 // TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
122 // EventHandler<WebViewHttpAuthRequestedEventArgs> onHttpAuthRequested = (s, e) =>
124 // tlog.Info(tag, $"HttpAuthRequested, Url: {e.HttpAuthHandler.Realm}");
125 // e.HttpAuthHandler.Suspend();
126 // tcs.TrySetResult(true);
129 // webview_.HttpAuthRequested += onHttpAuthRequested;
131 // webview_.LoadUrl(urlForHttpAuth);
132 // var result = await tcs.Task;
133 // Assert.IsTrue(result, "HttpAuthRequested event should be invoked.");
135 // // Make current thread (CPU) sleep...
136 // await Task.Delay(1);
138 // webview_.HttpAuthRequested -= onHttpAuthRequested;
140 // tlog.Debug(tag, $"WebHttpAuthHandlerRealm END (OK)");