Ejemplo n.º 1
0
        public void WebContextRegisterMimeOverriddenCallback()
        {
            tlog.Debug(tag, $"WebContextRegisterMimeOverriddenCallback START");

            var testingTarget = new Tizen.NUI.BaseComponents.WebView("Shanghai", "Asia/Shanghai");

            Assert.IsNotNull(testingTarget, "null handle");
            Assert.IsInstanceOf <Tizen.NUI.BaseComponents.WebView>(testingTarget, "Should return WebView instance.");

            var context = testingTarget.Context;

            try
            {
                context.RegisterMimeOverriddenCallback(MimeWrittenCallback);
            }
            catch (Exception e)
            {
                tlog.Debug(tag, e.Message.ToString());
                Assert.Fail("Caught Exception :  Failed!");
            }

            testingTarget.ClearCache();
            testingTarget.ClearCookies();

            context.Dispose();
            testingTarget.Dispose();
            tlog.Debug(tag, $"WebContextRegisterMimeOverriddenCallback END (OK)");
        }
Ejemplo n.º 2
0
        public void WebContextSetTimeZoneOffset()
        {
            tlog.Debug(tag, $"WebContextSetTimeZoneOffset START");

            var testingTarget = new Tizen.NUI.BaseComponents.WebView("Shanghai", "Asia/Shanghai");

            Assert.IsNotNull(testingTarget, "null handle");
            Assert.IsInstanceOf <Tizen.NUI.BaseComponents.WebView>(testingTarget, "Should return WebView instance.");

            var context = testingTarget.Context;

            try
            {
                context.SetTimeZoneOffset(0.3f, 1.0f);
            }
            catch (Exception e)
            {
                tlog.Debug(tag, e.Message.ToString());
                Assert.Fail("Caught Exception :  Failed!");
            }

            testingTarget.ClearCache();
            testingTarget.ClearCookies();

            context.Dispose();
            testingTarget.Dispose();
            tlog.Debug(tag, $"WebContextSetTimeZoneOffset END (OK)");
        }
Ejemplo n.º 3
0
        public void WebContextDeleteWebDatabase()
        {
            tlog.Debug(tag, $"WebContextDeleteWebDatabase START");

            var testingTarget = new Tizen.NUI.BaseComponents.WebView("Shanghai", "Asia/Shanghai");

            Assert.IsNotNull(testingTarget, "null handle");
            Assert.IsInstanceOf <Tizen.NUI.BaseComponents.WebView>(testingTarget, "Should return WebView instance.");

            var context = testingTarget.Context;

            try
            {
                using (WebSecurityOrigin origin = new WebSecurityOrigin(testingTarget.SwigCPtr.Handle, false))
                {
                    context.DeleteWebDatabase(origin);
                }
            }
            catch (Exception e)
            {
                tlog.Debug(tag, e.Message.ToString());
                Assert.Fail("Caught Exception :  Failed!");
            }

            testingTarget.ClearCache();
            testingTarget.ClearCookies();

            context.Dispose();
            testingTarget.Dispose();
            tlog.Debug(tag, $"WebContextDeleteWebDatabase END (OK)");
        }
Ejemplo n.º 4
0
        public async Task WebContextGetWebStorageUsageForOrigin()
        {
            tlog.Debug(tag, $"WebContextGetWebStorageUsageForOrigin 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.LoadUrl("https://www.youtube.com");
            await Task.Delay(60000);

            try
            {
                var result = testingTarget.Context.GetWebStorageOrigins(OnSecurityOriginListAcquired);
                tlog.Error(tag, "result : " + result);
            }
            catch (Exception e)
            {
                tlog.Debug(tag, e.Message.ToString());
                Assert.Fail("Caught Exception :  Failed!");
            }

            testingTarget.ClearCache();
            testingTarget.ClearCookies();

            testingTarget.Dispose();
            tlog.Debug(tag, $"GetWebStorageOrigins END (OK)");
        }
Ejemplo n.º 5
0
        public void WebContextCacheEnabled()
        {
            tlog.Debug(tag, $"WebContextCacheEnabled START");

            var testingTarget = new Tizen.NUI.BaseComponents.WebView("Shanghai", "Asia/Shanghai");

            Assert.IsNotNull(testingTarget, "null handle");
            Assert.IsInstanceOf <Tizen.NUI.BaseComponents.WebView>(testingTarget, "Should return WebView instance.");

            var context = testingTarget.Context;

            tlog.Debug(tag, "CacheEnabled : " + context.CacheEnabled);

            context.CacheEnabled = true;
            tlog.Debug(tag, "CacheEnabled : " + context.CacheEnabled);

            context.CacheEnabled = false;
            tlog.Debug(tag, "CacheEnabled : " + context.CacheEnabled);

            testingTarget.ClearCache();
            testingTarget.ClearCookies();

            context.Dispose();
            testingTarget.Dispose();
            tlog.Debug(tag, $"WebContextCertificateFilePath END (OK)");
        }
Ejemplo n.º 6
0
        public void WebContextGetWebDatabaseOrigins()
        {
            tlog.Debug(tag, $"WebContextGetWebDatabaseOrigins START");

            var testingTarget = new Tizen.NUI.BaseComponents.WebView("Shanghai", "Asia/Shanghai");

            Assert.IsNotNull(testingTarget, "null handle");
            Assert.IsInstanceOf <Tizen.NUI.BaseComponents.WebView>(testingTarget, "Should return WebView instance.");

            var context = testingTarget.Context;

            try
            {
                context.GetWebDatabaseOrigins(OriginListAcquiredCallback);
            }
            catch (Exception e)
            {
                tlog.Debug(tag, e.Message.ToString());
                Assert.Fail("Caught Exception :  Failed!");
            }

            testingTarget.ClearCache();
            testingTarget.ClearCookies();

            context.Dispose();
            testingTarget.Dispose();
            tlog.Debug(tag, $"WebContextGetWebDatabaseOrigins END (OK)");
        }
Ejemplo n.º 7
0
        public async Task WebConsoleMessageSource()
        {
            tlog.Debug(tag, $"WebConsoleMessageSource 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.ConsoleMessageReceived += OnConsoleMessageReceived;
            NUIApplication.GetDefaultWindow().Add(testingTarget);

            testingTarget.LoadUrl("https://www.youtube.com");

            await Task.Delay(60000);

            testingTarget.ClearCache();
            testingTarget.ClearCookies();
            NUIApplication.GetDefaultWindow().Remove(testingTarget);

            testingTarget.Dispose();
            tlog.Debug(tag, $"WebConsoleMessageSource END (OK)");
        }
Ejemplo n.º 8
0
 public void Destroy()
 {
     webView.ClearCache();
     webView.ClearCookies();
     webView.Dispose();
     tlog.Info(tag, "Destroy() is called!");
 }
Ejemplo n.º 9
0
        public async Task WebCertificateIsFromMainFrame()
        {
            tlog.Debug(tag, $"WebCertificateIsFromMainFrame 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.SslCertificateChanged += OnSslCertificateChanged;
            NUIApplication.GetDefaultWindow().Add(testingTarget);

            testingTarget.LoadUrl("http://www.baidu.com");
            await Task.Delay(10000);

            testingTarget.ClearCache();
            testingTarget.ClearCookies();
            NUIApplication.GetDefaultWindow().Remove(testingTarget);

            testingTarget.Dispose();
            tlog.Debug(tag, $"WebCertificateIsFromMainFrame END (OK)");
        }
Ejemplo n.º 10
0
        public async Task WebPageLoadErrorUrl()
        {
            tlog.Debug(tag, $"WebPageLoadErrorUrl 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.PageLoadError += OnPageLoadError;
            NUIApplication.GetDefaultWindow().Add(testingTarget);

            testingTarget.LoadUrl("http://111");

            await Task.Delay(10000);

            testingTarget.ClearCache();
            testingTarget.ClearCookies();
            NUIApplication.GetDefaultWindow().Remove(testingTarget);

            testingTarget.Dispose();
            tlog.Debug(tag, $"WebPageLoadErrorUrl END (OK)");
        }
        public async Task WebFormRepostPolicyDecisionMakerReply()
        {
            tlog.Debug(tag, $"WebFormRepostPolicyDecisionMakerReply 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.FormRepostPolicyDecided += OnFormRepostPolicyDecided;
            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, $"WebFormRepostPolicyDecisionMakerReply END (OK)");
        }
Ejemplo n.º 12
0
        public void WebContextProxyBypassRule()
        {
            tlog.Debug(tag, $"WebContextProxyBypassRule START");

            var testingTarget = new Tizen.NUI.BaseComponents.WebView("Shanghai", "Asia/Shanghai");

            Assert.IsNotNull(testingTarget, "null handle");
            Assert.IsInstanceOf <Tizen.NUI.BaseComponents.WebView>(testingTarget, "Should return WebView instance.");

            var context = testingTarget.Context;

            tlog.Debug(tag, "ProxyBypassRule : " + context.ProxyBypassRule);

            testingTarget.ClearCache();
            testingTarget.ClearCookies();

            context.Dispose();
            testingTarget.Dispose();
            tlog.Debug(tag, $"WebContextProxyBypassRule END (OK)");
        }
Ejemplo n.º 13
0
        public void WebContextDefaultZoomFactor()
        {
            tlog.Debug(tag, $"WebContextDefaultZoomFactor START");

            var testingTarget = new Tizen.NUI.BaseComponents.WebView("Shanghai", "Asia/Shanghai");

            Assert.IsNotNull(testingTarget, "null handle");
            Assert.IsInstanceOf <Tizen.NUI.BaseComponents.WebView>(testingTarget, "Should return WebView instance.");

            var context = testingTarget.Context;

            tlog.Debug(tag, "DefaultZoomFactor : " + context.DefaultZoomFactor);

            context.DefaultZoomFactor = 0.3f;
            tlog.Debug(tag, "DefaultZoomFactor : " + context.DefaultZoomFactor);

            testingTarget.ClearCache();
            testingTarget.ClearCookies();

            context.Dispose();
            testingTarget.Dispose();
            tlog.Debug(tag, $"WebContextDefaultZoomFactor END (OK)");
        }
Ejemplo n.º 14
0
        public void WebContextTimeOffset()
        {
            tlog.Debug(tag, $"WebContextTimeOffset START");

            var testingTarget = new Tizen.NUI.BaseComponents.WebView("Shanghai", "Asia/Shanghai");

            Assert.IsNotNull(testingTarget, "null handle");
            Assert.IsInstanceOf <Tizen.NUI.BaseComponents.WebView>(testingTarget, "Should return WebView instance.");

            var context = testingTarget.Context;

            tlog.Debug(tag, "TimeOffset : " + context.TimeOffset);

            context.TimeOffset = 0.3f;
            tlog.Debug(tag, "TimeOffset : " + context.TimeOffset);

            testingTarget.ClearCache();
            testingTarget.ClearCookies();

            context.Dispose();
            testingTarget.Dispose();
            tlog.Debug(tag, $"WebContextAppType END (OK)");
        }
Ejemplo n.º 15
0
        public void WebPasswordDataFingerprintUsed()
        {
            tlog.Debug(tag, $"WebPasswordDataFingerprintUsed START");

            using (Tizen.NUI.BaseComponents.WebView webview = new Tizen.NUI.BaseComponents.WebView("Shanghai", "Asia/Shanghai"))
            {
                webview.LoadUrl("http://www.baidu.com");

                var testingTarget = new WebPasswordData(webview.SwigCPtr.Handle, false);
                Assert.IsNotNull(testingTarget, "null handle");
                Assert.IsInstanceOf <WebPasswordData>(testingTarget, "Should return WebPasswordData instance.");

                var result = testingTarget.FingerprintUsed;
                tlog.Debug(tag, "FingerprintUsed : " + result);

                webview.ClearCache();
                webview.ClearCookies();

                testingTarget.Dispose();
            }

            tlog.Debug(tag, $"WebPasswordDataFingerprintUsed END (OK)");
        }
Ejemplo n.º 16
0
        public void WebSecurityOriginListGetItemAtIndex()
        {
            tlog.Debug(tag, $"WebSecurityOriginListGetItemAtIndex START");

            using (Tizen.NUI.BaseComponents.WebView webview = new Tizen.NUI.BaseComponents.WebView("Shanghai", "Asia/Shanghai"))
            {
                webview.LoadUrl("http://www.baidu.com");

                var testingTarget = new WebSecurityOriginList(webview.SwigCPtr.Handle, false);
                Assert.IsNotNull(testingTarget, "null handle");
                Assert.IsInstanceOf <WebSecurityOriginList>(testingTarget, "Should return WebSecurityOriginList instance.");

                var result = testingTarget.GetItemAtIndex(0);
                tlog.Debug(tag, "GetItemAtIndex : " + result);

                webview.ClearCache();
                webview.ClearCookies();

                testingTarget.Dispose();
            }

            tlog.Debug(tag, $"WebSecurityOriginListGetItemAtIndex END (OK)");
        }