@Test
 public void testGetGlobalQueueSpeed() {
   assertEquals(defaultSpeed, CommandQueue.getSpeed());
   FrameGroupCommandQueueSet session1 =
       FrameGroupCommandQueueSet.makeQueueSet(
           firstSessionId,
           RemoteControlConfiguration.DEFAULT_PORT,
           new RemoteControlConfiguration());
   int sessionSpeedOnInit = session1.getSpeed();
   assertEquals(defaultSpeed, sessionSpeedOnInit);
   FrameGroupCommandQueueSet.clearQueueSet(firstSessionId);
 }
 public void testGetPresetSpeedValidSession() {
   assertEquals(defaultSpeed, CommandQueue.getSpeed());
   FrameGroupCommandQueueSet session1 =
       FrameGroupCommandQueueSet.makeQueueSet(
           firstSessionId,
           RemoteControlConfiguration.DEFAULT_PORT,
           new RemoteControlConfiguration());
   assertNotNull(session1);
   SeleniumDriverResourceHandler.setSpeedForSession(firstSessionId, newSpeed);
   String speed = SeleniumDriverResourceHandler.getSpeedForSession(firstSessionId);
   assertEquals(newSpeedString, speed);
   FrameGroupCommandQueueSet.clearQueueSet(firstSessionId);
 }
  @Test
  public void testCommandQueueInitSpeedMatchesSessionSpeed() {
    assertEquals(defaultSpeed, CommandQueue.getSpeed());
    FrameGroupCommandQueueSet session1 =
        FrameGroupCommandQueueSet.makeQueueSet(
            firstSessionId,
            RemoteControlConfiguration.DEFAULT_PORT,
            new RemoteControlConfiguration());
    session1.setSpeed(newSpeed);

    CommandQueue queue1 = session1.getCommandQueue(firstQueueId);
    assertEquals(newSpeed, queue1.getQueueDelay());
    assertEquals(defaultSpeed, CommandQueue.getSpeed());

    FrameGroupCommandQueueSet.clearQueueSet(firstSessionId);
  }
Ejemplo n.º 4
0
 /**
  * Isolated dependency
  *
  * @param sessionId
  * @param port
  * @param configuration
  * @return a new FrameGroupCommandQueueSet instance
  */
 protected FrameGroupCommandQueueSet makeQueueSet(
     String sessionId, int port, RemoteControlConfiguration configuration) {
   return FrameGroupCommandQueueSet.makeQueueSet(
       sessionId, configuration.getPortDriversShouldContact(), configuration);
 }