- [Test]
- [Category("P1")]
- [Description("WebHttpAuthHandler constructor.")]
- [Property("SPEC", "Tizen.NUI.WebHttpAuthHandler.WebHttpAuthHandler C")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "CONSTR")]
- [Property("COVPARAM", "")]
- [Property("AUTHOR", "guowei.wang@samsung.com")]
- public void WebHttpAuthHandlerConstructor()
- {
- tlog.Debug(tag, $"WebHttpAuthHandlerConstructor START");
-
- using (Tizen.NUI.BaseComponents.WebView webview = new Tizen.NUI.BaseComponents.WebView("Shanghai", "Asia/Shanghai"))
- {
- var testingTarget = new WebHttpAuthHandler(webview.SwigCPtr.Handle, false);
- Assert.IsNotNull(testingTarget, "null handle");
- Assert.IsInstanceOf<WebHttpAuthHandler>(testingTarget, "Should return WebHttpAuthHandler instance.");
-
- testingTarget.Dispose();
- }
-
- tlog.Debug(tag, $"WebHttpAuthHandlerConstructor END (OK)");
- }
-
- [Test]
- [Category("P1")]
- [Description("WebHttpAuthHandler Realm.")]
- [Property("SPEC", "Tizen.NUI.WebHttpAuthHandler.Realm A")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "PRO")]
- [Property("COVPARAM", "")]
- [Property("AUTHOR", "guowei.wang@samsung.com")]
- public async Task WebHttpAuthHandlerRealm()
- {
- tlog.Debug(tag, $"WebHttpAuthHandlerRealm START");
-
- var testingTarget = new Tizen.NUI.BaseComponents.WebView(runtimeArgs)
- {
- Size = new Size(500, 200),
- UserAgent = USER_AGENT
- };
- Assert.IsNotNull(testingTarget, "null handle");
- Assert.IsInstanceOf<Tizen.NUI.BaseComponents.WebView>(testingTarget, "Should return Tizen.NUI.BaseComponents.WebView instance.");
-
- testingTarget.HttpAuthRequested += OnHttpAuthRequested;
- NUIApplication.GetDefaultWindow().Add(testingTarget);
-
- testingTarget.LoadUrl("http://www.163.com");
- await Task.Delay(10000);
-
- testingTarget.ClearCache();
- testingTarget.ClearCookies();
- NUIApplication.GetDefaultWindow().Remove(testingTarget);
-
- testingTarget.Dispose();
- tlog.Debug(tag, $"WebHttpAuthHandlerRealm END (OK)");
- }
-
- private void OnHttpAuthRequested(object sender, WebViewHttpAuthRequestedEventArgs e)
- {
- tlog.Info(tag, $"HttpAuthRequested, Url: {e.HttpAuthHandler.Realm}");
- e.HttpAuthHandler.CancelCredential();
- e.HttpAuthHandler.UseCredential("tizen", "samsung");
- e.HttpAuthHandler.Suspend();
- }
+ //TODO... This TC will be blocked because web engine does not support it any longer.
+ //[Test]
+ //[Category("P1")]
+ //[Description("WebHttpAuthHandler CancelCredential.")]
+ //[Property("SPEC", "Tizen.NUI.WebHttpAuthHandler.CancelCredential M")]
+ //[Property("SPEC_URL", "-")]
+ //[Property("CRITERIA", "PRO")]
+ //[Property("COVPARAM", "")]
+ //[Property("AUTHOR", "guowei.wang@samsung.com")]
+ //public async Task WebHttpAuthHandlerCancelCredential()
+ //{
+ // tlog.Debug(tag, $"WebHttpAuthHandlerRealm START");
+
+ // TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
+ // EventHandler<WebViewHttpAuthRequestedEventArgs> onHttpAuthRequested = (s, e) =>
+ // {
+ // tlog.Info(tag, $"HttpAuthRequested, Url: {e.HttpAuthHandler.Realm}");
+ // e.HttpAuthHandler.CancelCredential();
+ // tcs.TrySetResult(true);
+ // };
+
+ // webview_.HttpAuthRequested += onHttpAuthRequested;
+
+ // webview_.LoadUrl(urlForHttpAuth);
+ // var result = await tcs.Task;
+ // Assert.IsTrue(result, "HttpAuthRequested event should be invoked.");
+
+ // // Make current thread (CPU) sleep...
+ // await Task.Delay(1);
+
+ // webview_.HttpAuthRequested -= onHttpAuthRequested;
+
+ // tlog.Debug(tag, $"WebHttpAuthHandlerRealm END (OK)");
+ //}
+
+ //TODO... This TC will be blocked because web engine does not support it any longer.
+ //[Test]
+ //[Category("P1")]
+ //[Description("WebHttpAuthHandler UseCredential.")]
+ //[Property("SPEC", "Tizen.NUI.WebHttpAuthHandler.UseCredential M")]
+ //[Property("SPEC_URL", "-")]
+ //[Property("CRITERIA", "PRO")]
+ //[Property("COVPARAM", "")]
+ //[Property("AUTHOR", "guowei.wang@samsung.com")]
+ //public async Task WebHttpAuthHandlerUseCredential()
+ //{
+ // tlog.Debug(tag, $"WebHttpAuthHandlerRealm START");
+
+ // TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
+ // EventHandler<WebViewHttpAuthRequestedEventArgs> onHttpAuthRequested = (s, e) =>
+ // {
+ // tlog.Info(tag, $"HttpAuthRequested, Url: {e.HttpAuthHandler.Realm}");
+ // e.HttpAuthHandler.UseCredential("tizen", "samsung");
+ // tcs.TrySetResult(true);
+ // };
+
+ // webview_.HttpAuthRequested += onHttpAuthRequested;
+
+ // webview_.LoadUrl(urlForHttpAuth);
+ // var result = await tcs.Task;
+ // Assert.IsTrue(result, "HttpAuthRequested event should be invoked.");
+
+ // // Make current thread (CPU) sleep...
+ // await Task.Delay(1);
+
+ // webview_.HttpAuthRequested -= onHttpAuthRequested;
+
+ // tlog.Debug(tag, $"WebHttpAuthHandlerRealm END (OK)");
+ //}
+
+ //TODO... This TC will be blocked because web engine does not support it any longer.
+ //[Test]
+ //[Category("P1")]
+ //[Description("WebHttpAuthHandler Suspend.")]
+ //[Property("SPEC", "Tizen.NUI.WebHttpAuthHandler.Suspend M")]
+ //[Property("SPEC_URL", "-")]
+ //[Property("CRITERIA", "PRO")]
+ //[Property("COVPARAM", "")]
+ //[Property("AUTHOR", "guowei.wang@samsung.com")]
+ //public async Task WebHttpAuthHandlerSuspend()
+ //{
+ // tlog.Debug(tag, $"WebHttpAuthHandlerRealm START");
+
+ // TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
+ // EventHandler<WebViewHttpAuthRequestedEventArgs> onHttpAuthRequested = (s, e) =>
+ // {
+ // tlog.Info(tag, $"HttpAuthRequested, Url: {e.HttpAuthHandler.Realm}");
+ // e.HttpAuthHandler.Suspend();
+ // tcs.TrySetResult(true);
+ // };
+
+ // webview_.HttpAuthRequested += onHttpAuthRequested;
+
+ // webview_.LoadUrl(urlForHttpAuth);
+ // var result = await tcs.Task;
+ // Assert.IsTrue(result, "HttpAuthRequested event should be invoked.");
+
+ // // Make current thread (CPU) sleep...
+ // await Task.Delay(1);
+
+ // webview_.HttpAuthRequested -= onHttpAuthRequested;
+
+ // tlog.Debug(tag, $"WebHttpAuthHandlerRealm END (OK)");
+ //}