예제 #1
0
 public void flick(Coordinates where, int xOffset, int yOffset, int speed) {
   Map<String, Object> flickParams = CoordinatesUtils.paramsFromCoordinates(where);
   flickParams.put("xoffset", xOffset);
   flickParams.put("yoffset", yOffset);
   flickParams.put("speed", speed);
   executeMethod.execute(DriverCommand.TOUCH_FLICK, flickParams);
 }
예제 #2
0
 @Override
 public double getVolume() {
   return ((Number)
           driverExecuteMethod.execute(
               QtWebKitDriverCommand.GET_PLAYER_VOLUME, ImmutableMap.of("id", id)))
       .doubleValue();
 }
예제 #3
0
 @Override
 public double getCurrentPlayingPosition() {
   return ((Number)
           driverExecuteMethod.execute(
               QtWebKitDriverCommand.GET_CURRENT_PLAYING_POSITION, ImmutableMap.of("id", id)))
       .doubleValue();
 }
예제 #4
0
 @Override
 public double getSpeed() {
   return ((Number)
           driverExecuteMethod.execute(
               QtWebKitDriverCommand.GET_PLAYBACK_SPEED, ImmutableMap.of("id", id)))
       .doubleValue();
 }
예제 #5
0
 @Override
 public void setVolume(double volume) throws IllegalArgumentException {
   if (volume > 1 || volume < 0) {
     throw new IllegalArgumentException("Volume should be between 1 and 0");
   }
   driverExecuteMethod.execute(
       QtWebKitDriverCommand.SET_PLAYER_VOLUME, ImmutableMap.of("id", id, "volume", volume));
 }
예제 #6
0
 @Override
 public PlayerState getState() {
   Number response =
       (Number)
           driverExecuteMethod.execute(
               QtWebKitDriverCommand.GET_PLAYER_STATE, ImmutableMap.of("id", id));
   PlayerState state = PlayerState.values()[response.intValue()];
   return state;
 }
예제 #7
0
 public void scroll(int xOffset, int yOffset) {
   Map<String, Object> scrollParams = new HashMap<String, Object>();
   scrollParams.put("xoffset", xOffset);
   scrollParams.put("yoffset", yOffset);
   executeMethod.execute(DriverCommand.TOUCH_SCROLL, scrollParams);
 }
예제 #8
0
 public void longPress(Coordinates where) {
   Map<String, Object> longPressParams = CoordinatesUtils.paramsFromCoordinates(where);
   executeMethod.execute(DriverCommand.TOUCH_LONG_PRESS, longPressParams);
 }
예제 #9
0
 public void doubleTap(Coordinates where) {
   Map<String, Object> doubleTapParams = CoordinatesUtils.paramsFromCoordinates(where);
   executeMethod.execute(DriverCommand.TOUCH_DOUBLE_TAP, doubleTapParams);
 }
예제 #10
0
 public void scroll(Coordinates where, int xOffset, int yOffset) {
   Map<String, Object> scrollParams = CoordinatesUtils.paramsFromCoordinates(where);
   scrollParams.put("xoffset", xOffset);
   scrollParams.put("yoffset", yOffset);
   executeMethod.execute(DriverCommand.TOUCH_SCROLL, scrollParams);
 }
예제 #11
0
 public void move(int x, int y) {
   Map<String, Object> moveParams = new HashMap<String, Object>();
   moveParams.put("x", x);
   moveParams.put("y", y);
   executeMethod.execute(DriverCommand.TOUCH_MOVE, moveParams);
 }
예제 #12
0
 public void up(int x, int y) {
   Map<String, Object> upParams = new HashMap<String, Object>();
   upParams.put("x", x);
   upParams.put("y", y);
   executeMethod.execute(DriverCommand.TOUCH_UP, upParams);
 }
예제 #13
0
 @Override
 public void setMute(boolean mute) {
   driverExecuteMethod.execute(
       QtWebKitDriverCommand.SET_PLAYER_MUTE, ImmutableMap.of("id", id, "mute", mute));
 }
예제 #14
0
 @Override
 public void seek(double position) {
   driverExecuteMethod.execute(
       QtWebKitDriverCommand.SET_CURRENT_PLAYING_POSITION,
       ImmutableMap.of("id", id, "position", position));
 }
예제 #15
0
 @Override
 public void setSpeed(double speed) {
   driverExecuteMethod.execute(
       QtWebKitDriverCommand.SET_PLAYBACK_SPEED, ImmutableMap.of("id", id, "speed", speed));
 }
예제 #16
0
 public void flick(int xSpeed, int ySpeed) {
   Map<String, Object> flickParams = new HashMap<String, Object>();
   flickParams.put("xspeed", xSpeed);
   flickParams.put("yspeed", ySpeed);
   executeMethod.execute(DriverCommand.TOUCH_FLICK, flickParams);
 }
예제 #17
0
 public void down(int x, int y) {
   Map<String, Object> downParams = new HashMap<String, Object>();
   downParams.put("x", x);
   downParams.put("y", y);
   executeMethod.execute(DriverCommand.TOUCH_DOWN, downParams);
 }
예제 #18
0
 @Override
 public void setState(PlayerState state) {
   driverExecuteMethod.execute(
       QtWebKitDriverCommand.SET_PLAYER_STATE,
       ImmutableMap.of("id", id, "state", state.ordinal()));
 }
예제 #19
0
 @Override
 public boolean isMuted() {
   return (Boolean)
       driverExecuteMethod.execute(
           QtWebKitDriverCommand.GET_PLAYER_MUTE, ImmutableMap.of("id", id));
 }