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(); }
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; } }
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(); }
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); } } }
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; } }