Ejemplo n.º 1
0
        public void BaseTestCleanup()
        {
            GC.Collect();
            GC.WaitForPendingFinalizers();

            var counters = V8TestProxy.Create().GetCounters();

            Assert.AreEqual(0UL, counters.ContextCount, "Not all V8 contexts were destroyed.");
            Assert.AreEqual(0UL, counters.IsolateCount, "Not all V8 isolates were destroyed.");
        }
Ejemplo n.º 2
0
        public void BaseTestCleanup()
        {
            GC.Collect();
            GC.WaitForPendingFinalizers();

            var proxy    = V8TestProxy.Create();
            var counters = proxy.GetCounters();

            for (var attempts = 0; attempts < 10; attempts++)
            {
                if ((counters.ContextCount == 0UL) && (counters.IsolateCount == 0UL))
                {
                    return;
                }

                Thread.Sleep(100);
                counters = proxy.GetCounters();
            }

            Assert.AreEqual(0UL, counters.ContextCount, "Not all V8 contexts were destroyed.");
            Assert.AreEqual(0UL, counters.IsolateCount, "Not all V8 isolates were destroyed.");
        }
Ejemplo n.º 3
0
        public void BaseTestCleanup()
        {
            DocumentLoader.Default.DiscardCachedDocuments();

            GC.Collect();
            GC.WaitForPendingFinalizers();

            var proxy      = V8TestProxy.Create();
            var statistics = proxy.GetStatistics();

            for (var attempts = 0; attempts < 10; attempts++)
            {
                if ((statistics.ContextCount == 0UL) && (statistics.IsolateCount == 0UL))
                {
                    return;
                }

                Thread.Sleep(100);
                statistics = proxy.GetStatistics();
            }

            Assert.AreEqual(0UL, statistics.ContextCount, "Not all V8 contexts were destroyed.");
            Assert.AreEqual(0UL, statistics.IsolateCount, "Not all V8 isolates were destroyed.");
        }