< prev index next >
tests/system/src/test/java/test/robot/com/sun/glass/ui/monocle/FuzzyTapTest.java
Print this page
rev 9504 : need to fix test log and others
*** 23,33 ****
* questions.
*/
package test.robot.com.sun.glass.ui.monocle;
! import com.sun.glass.ui.monocle.TestLog;
import test.robot.com.sun.glass.ui.monocle.ParameterizedTestBase;
import test.robot.com.sun.glass.ui.monocle.input.devices.TestTouchDevice;
import test.robot.com.sun.glass.ui.monocle.input.devices.TestTouchDevices;
import org.junit.Assert;
import org.junit.Test;
--- 23,33 ----
* questions.
*/
package test.robot.com.sun.glass.ui.monocle;
! import com.sun.glass.ui.monocle.TestLogShim;
import test.robot.com.sun.glass.ui.monocle.ParameterizedTestBase;
import test.robot.com.sun.glass.ui.monocle.input.devices.TestTouchDevice;
import test.robot.com.sun.glass.ui.monocle.input.devices.TestTouchDevices;
import org.junit.Assert;
import org.junit.Test;
*** 56,70 ****
final int y1 = y + tapRadius / 2;
int p = device.addPoint(x, y);
device.sync();
device.setAndRemovePoint(p, x1, y1);
device.sync();
! TestLog.waitForLog("Mouse pressed: " + x + ", " + y, 3000);
! TestLog.waitForLog("Mouse clicked: " + x + ", " + y, 3000);
! TestLog.waitForLog("Mouse released: " + x + ", " + y, 3000);
! Assert.assertEquals(0, TestLog.countLogContaining("Mouse dragged:"));
! Assert.assertEquals(0, TestLog.countLogContaining("Touch moved:"));
}
/** Touch down, small move, touch up */
@Test
public void tap1a() throws Exception {
--- 56,70 ----
final int y1 = y + tapRadius / 2;
int p = device.addPoint(x, y);
device.sync();
device.setAndRemovePoint(p, x1, y1);
device.sync();
! TestLogShim.waitForLog("Mouse pressed: " + x + ", " + y, 3000);
! TestLogShim.waitForLog("Mouse clicked: " + x + ", " + y, 3000);
! TestLogShim.waitForLog("Mouse released: " + x + ", " + y, 3000);
! Assert.assertEquals(0, TestLogShim.countLogContaining("Mouse dragged:"));
! Assert.assertEquals(0, TestLogShim.countLogContaining("Touch moved:"));
}
/** Touch down, small move, touch up */
@Test
public void tap1a() throws Exception {
*** 77,90 ****
device.sync();
device.setPoint(p, x1, y1);
device.sync();
device.removePoint(p);
device.sync();
! TestLog.waitForLog("Mouse clicked: " + x + ", " + y, 3000);
! TestLog.waitForLog("Mouse released: " + x + ", " + y, 3000);
! Assert.assertEquals(0, TestLog.countLogContaining("Mouse dragged:"));
! Assert.assertEquals(0, TestLog.countLogContaining("Touch moved:"));
}
/** Touch down, touch up outside the tap radius */
@Test
public void tap2() throws Exception {
--- 77,90 ----
device.sync();
device.setPoint(p, x1, y1);
device.sync();
device.removePoint(p);
device.sync();
! TestLogShim.waitForLog("Mouse clicked: " + x + ", " + y, 3000);
! TestLogShim.waitForLog("Mouse released: " + x + ", " + y, 3000);
! Assert.assertEquals(0, TestLogShim.countLogContaining("Mouse dragged:"));
! Assert.assertEquals(0, TestLogShim.countLogContaining("Touch moved:"));
}
/** Touch down, touch up outside the tap radius */
@Test
public void tap2() throws Exception {
*** 95,110 ****
final int y1 = y + tapRadius;
int p = device.addPoint(x, y);
device.sync();
device.setAndRemovePoint(p, x1, y1);
device.sync();
! TestLog.waitForLog("Mouse pressed: " + x + ", " + y, 3000);
! TestLog.waitForLog("Mouse released: " + x + ", " + y, 3000);
! TestLog.waitForLog("Mouse clicked: " + x + ", " + y, 3000);
! TestLog.waitForLog("Touch pressed: " + x + ", " + y, 3000);
! TestLog.waitForLog("Touch released: " + x + ", " + y, 3000);
! Assert.assertEquals(1, TestLog.countLogContaining("Mouse clicked:"));
}
/** Touch down, move outside touch radius, touch up */
@Test
public void tap2a() throws Exception {
--- 95,110 ----
final int y1 = y + tapRadius;
int p = device.addPoint(x, y);
device.sync();
device.setAndRemovePoint(p, x1, y1);
device.sync();
! TestLogShim.waitForLog("Mouse pressed: " + x + ", " + y, 3000);
! TestLogShim.waitForLog("Mouse released: " + x + ", " + y, 3000);
! TestLogShim.waitForLog("Mouse clicked: " + x + ", " + y, 3000);
! TestLogShim.waitForLog("Touch pressed: " + x + ", " + y, 3000);
! TestLogShim.waitForLog("Touch released: " + x + ", " + y, 3000);
! Assert.assertEquals(1, TestLogShim.countLogContaining("Mouse clicked:"));
}
/** Touch down, move outside touch radius, touch up */
@Test
public void tap2a() throws Exception {
*** 117,134 ****
device.sync();
device.setPoint(p, x1, y1);
device.sync();
device.removePoint(p);
device.sync();
! TestLog.waitForLog("Mouse pressed: " + x + ", " + y, 3000);
! TestLog.waitForLog("Mouse dragged: " + x1 + ", " + y1, 3000);
! TestLog.waitForLog("Mouse released: " + x1 + ", " + y1, 3000);
! TestLog.waitForLog("Mouse clicked: " + x1 + ", " + y1, 3000);
! TestLog.waitForLog("Touch pressed: " + x + ", " + y, 3000);
! TestLog.waitForLog("Touch moved: " + x1 + ", " + y1, 3000);
! TestLog.waitForLog("Touch released: " + x1 + ", " + y1, 3000);
! Assert.assertEquals(1, TestLog.countLogContaining("Mouse clicked: " + x1 + ", " + y1));
}
/** Touch down, drift outside touch radius, touch up */
@Test
public void tap3b() throws Exception {
--- 117,134 ----
device.sync();
device.setPoint(p, x1, y1);
device.sync();
device.removePoint(p);
device.sync();
! TestLogShim.waitForLog("Mouse pressed: " + x + ", " + y, 3000);
! TestLogShim.waitForLog("Mouse dragged: " + x1 + ", " + y1, 3000);
! TestLogShim.waitForLog("Mouse released: " + x1 + ", " + y1, 3000);
! TestLogShim.waitForLog("Mouse clicked: " + x1 + ", " + y1, 3000);
! TestLogShim.waitForLog("Touch pressed: " + x + ", " + y, 3000);
! TestLogShim.waitForLog("Touch moved: " + x1 + ", " + y1, 3000);
! TestLogShim.waitForLog("Touch released: " + x1 + ", " + y1, 3000);
! Assert.assertEquals(1, TestLogShim.countLogContaining("Mouse clicked: " + x1 + ", " + y1));
}
/** Touch down, drift outside touch radius, touch up */
@Test
public void tap3b() throws Exception {
*** 152,166 ****
device.setPoint(p, x2, y2);
device.sync();
// and release
device.removePoint(p);
device.sync();
! TestLog.waitForLog("Mouse pressed: " + x + ", " + y, 3000);
! TestLog.waitForLog("Mouse dragged: " + x2 + ", " + y2, 3000);
! TestLog.waitForLog("Mouse released: " + x2 + ", " + y2, 3000);
! TestLog.waitForLog("Mouse clicked: " + x2 + ", " + y2, 3000);
! TestLog.waitForLog("Touch pressed: " + x + ", " + y, 3000);
! TestLog.waitForLog("Touch moved: " + x2 + ", " + y2, 3000);
! TestLog.waitForLog("Touch released: " + x2 + ", " + y2, 3000);
! Assert.assertEquals(1, TestLog.countLogContaining("Mouse clicked: " + x2 + ", " + y2));
}
}
--- 152,166 ----
device.setPoint(p, x2, y2);
device.sync();
// and release
device.removePoint(p);
device.sync();
! TestLogShim.waitForLog("Mouse pressed: " + x + ", " + y, 3000);
! TestLogShim.waitForLog("Mouse dragged: " + x2 + ", " + y2, 3000);
! TestLogShim.waitForLog("Mouse released: " + x2 + ", " + y2, 3000);
! TestLogShim.waitForLog("Mouse clicked: " + x2 + ", " + y2, 3000);
! TestLogShim.waitForLog("Touch pressed: " + x + ", " + y, 3000);
! TestLogShim.waitForLog("Touch moved: " + x2 + ", " + y2, 3000);
! TestLogShim.waitForLog("Touch released: " + x2 + ", " + y2, 3000);
! Assert.assertEquals(1, TestLogShim.countLogContaining("Mouse clicked: " + x2 + ", " + y2));
}
}
< prev index next >