コード例 #1
0
ファイル: ThreadGuardTest.java プロジェクト: JoeHe/selenium
 @Test
 public void testInterfacesProxiedProperly() throws Exception {
   WebDriver actual = new PermissiveStubDriver();
   final WebDriver webdriver = ThreadGuard.protect(actual);
   HasTouchScreen hasTouchScreen = (HasTouchScreen) webdriver;
   assertNotNull(hasTouchScreen);
 }
コード例 #2
0
ファイル: ThreadGuardTest.java プロジェクト: JoeHe/selenium
 @Test
 public void testProtect() throws Exception {
   WebDriver actual = new PermissiveStubDriver();
   final WebDriver protect = ThreadGuard.protect(actual);
   final AtomicInteger successes = new AtomicInteger();
   Thread foo =
       new Thread(
           new Runnable() {
             public void run() {
               protect.findElement(By.id("foo"));
               successes.incrementAndGet();
             }
           });
   foo.start();
   foo.join();
   assertEquals(0, successes.get());
 }
コード例 #3
0
ファイル: ThreadGuardTest.java プロジェクト: JoeHe/selenium
 @Test
 public void testProtectSuccess() throws Exception {
   WebDriver actual = new PermissiveStubDriver();
   final WebDriver protect = ThreadGuard.protect(actual);
   assertNull(protect.findElement(By.id("foo")));
 }