Esempio n. 1
0
        public void TestMultithread()
        {
            Thread uiThread = new Thread(delegate() {
                using (TestForm testForm = new TestForm()) {
                    using (System.Threading.Timer taskDelay = new System.Threading.Timer(delegate(object state) {
                        testForm.Close();
                    }, null, 7500, Timeout.Infinite)) {
                        Application.Run(testForm);
                    }
                }
            });

            uiThread.Start();

            Thread uiThread2 = new Thread(delegate() {
                using (TestForm testForm = new TestForm()) {
                    using (System.Threading.Timer taskDelay = new System.Threading.Timer(delegate(object state) {
                        testForm.Close();
                    }, null, 7500, Timeout.Infinite)) {
                        Application.Run(testForm);
                    }
                }
            });

            uiThread2.Start();

            uiThread.Join();
            uiThread2.Join();
        }
Esempio n. 2
0
        public void FixtureSetUp()
        {
            try {
                // Support ES tests
                Egl.IsRequired = IsEsTest;

                // Create window
                Form = new TestForm(this);
                // Create device context
                _DeviceContext = DeviceContextFactory.Create(Form);

                // Set pixel format
                if (_DeviceContext is WindowsDeviceContext)
                {
                    SetPixelFormatWgl();
                }
                else if (_DeviceContext is NativeDeviceContext)
                {
                    SetPixelFormatEgl();
                }
                else
                {
                    throw new NotImplementedException("platform not supported");
                }
            } catch {
                // Release resources manually
                FixtureTearDown();

                throw;
            }
        }
Esempio n. 3
0
        public void TestMultithread()
        {
            int closeTimeout = Debugger.IsAttached ? 60000 * 5 : 7500;

            Thread uiThread = new Thread(delegate() {
                using (TestForm testForm = new TestForm()) {
                    using (System.Threading.Timer taskDelay = new System.Threading.Timer(delegate(object state) {
                        testForm.Close();
                    }, null, closeTimeout, Timeout.Infinite)) {
                        Application.Run(testForm);
                    }
                }
            });

            uiThread.Start();

            Thread uiThread2 = new Thread(delegate() {
                using (TestForm testForm = new TestForm()) {
                    using (System.Threading.Timer taskDelay = new System.Threading.Timer(delegate(object state) {
                        testForm.Close();
                    }, null, closeTimeout, Timeout.Infinite)) {
                        Application.Run(testForm);
                    }
                }
            });

            uiThread2.Start();

            uiThread.Join();
            uiThread2.Join();
        }
Esempio n. 4
0
 public void TestMinimalCase()
 {
     using (TestForm testForm = new TestForm()) {
         using (System.Threading.Timer taskDelay = new System.Threading.Timer(delegate(object state) {
             testForm.Close();
         }, null, 7500, Timeout.Infinite)) {
             Application.Run(testForm);
         }
     }
 }
Esempio n. 5
0
        public void FixtureSetUp()
        {
            try {
                // Create window
                Form = new TestForm(this);
                // Create device context
                _DeviceContext = DeviceContextFactory.Create(Form);
                // Set pixel format
                SetPixelFormatWgl();
            } catch {
                // Release resources manually
                FixtureTearDown();

                throw;
            }
        }