public void testInit() { CountdownLatch latch = new CountdownLatch(1); InitListener listener = new InitListener(latch); Platform.init(listener); latch.Wait(); Assert.AreEqual(listener.initState, InitStateChangedEvent.InitState.INITIALIZED); tearDown(); }
public void testGetService() { CountdownLatch latch = new CountdownLatch(1); InitListener listener = new InitListener(latch); Assert.IsNull(Platform.getService()); Platform.init(listener); latch.Wait(); Assert.IsNotNull(Platform.getService()); tearDown(); }
public void testGetScreenSharingSources() { _service.getScreenCaptureSources(createScrSourcesResponder(), 160); List <ScreenCaptureSource> sources = awaitScrSourcesResult(10000); Assert.IsTrue(sources.Count > 0); Console.Error.WriteLine("Got sources: " + sources.Count); CountdownLatch latch = new CountdownLatch(1); PictureForm pForm = new PictureForm(sources); pForm.ShowDialog(); }
public void testEchoNotification() { CountdownLatch latch = new CountdownLatch(); MockEventListener listener = new MockEventListener(latch); _service.addServiceListener(createVoidResponder(), listener); awaitVoidResult("addServiceListener"); _service.sendEchoNotification(createVoidResponder(), "whatever"); awaitVoidResult(); Assert.IsTrue(latch.Wait(), "Got timeout when waiting for the event"); Assert.IsNotNull(listener.receivedEvent); Assert.AreEqual("whatever", listener.receivedEvent.echoValue); }
protected void setUp() { CountdownLatch latch = new CountdownLatch(1); InitListener listener = new InitListener(latch); Platform.init(listener); latch.Wait(); Assert.AreEqual(InitStateChangedEvent.InitState.INITIALIZED, listener.initState, "Failed to initialize the platform due to: " + listener.errMsg); _service = Platform.getService(); dispatcher = new AddLiveServiceEventDispatcher(); _service.addServiceListener(createVoidResponder(), dispatcher); awaitVoidResult("addServiceListener"); }
private void setupCall() { _lastError = 0; _latch = new CountdownLatch(); }
public InitListener(CountdownLatch latch) { _latch = latch; }
public MockEventListener(CountdownLatch latch) { _latch = latch; }
public void testGetScreenSharingSources() { _service.getScreenCaptureSources(createScrSourcesResponder(), 160); List<ScreenCaptureSource> sources = awaitScrSourcesResult(10000); Assert.IsTrue(sources.Count > 0); Console.Error.WriteLine("Got sources: " + sources.Count); CountdownLatch latch = new CountdownLatch(1); PictureForm pForm = new PictureForm(sources); pForm.ShowDialog(); }