@Test
  public void testFiresPresentationChangeToFullScreen() {
    environment.getRemoteObject().setHandler(new VideoOperationHandler(video));
    video.addPresentationListener(presentationListener);
    JsonObject parameters = new JsonObject();
    parameters.add(PROPERTY_PRESENTATION, Presentation.FULL_SCREEN.name());

    environment.dispatchNotify(Constants.EVENT_PRESENTATION, parameters);

    verify(presentationListener).presentationChanged(Presentation.FULL_SCREEN);
  }
  @Test
  public void testFiresPlaybackChange() {
    environment.getRemoteObject().setHandler(new VideoOperationHandler(video));
    video.addPlaybackListener(playbackListener);
    JsonObject parameters = new JsonObject();
    parameters.add(PROPERTY_PLAYBACK, Playback.ERROR.name());

    environment.dispatchNotify(Constants.EVENT_PLAYBACK, parameters);

    verify(playbackListener).playbackChanged(Playback.ERROR);
  }
  @Test
  public void testRendersPlaybackPlayOnce() {
    environment.getRemoteObject().setHandler(new VideoOperationHandler(video));
    video.addPlaybackListener(playbackListener);
    environment.newRequest();
    JsonObject parameters = new JsonObject();
    parameters.add(PROPERTY_PLAYBACK, Playback.PLAY.name());

    environment.dispatchNotify(Constants.EVENT_PLAYBACK, parameters);

    verify(playbackListener).playbackChanged(Playback.PLAY);
    assertFalse(hasOperation(WidgetUtil.getId(video), SET, null));
  }
Пример #4
0
 @Before
 public void setUp() {
   shell = new Shell(new Display());
   remoteObject = environment.getRemoteObject();
 }