< prev index next >

tests/system/src/test/java/test/robot/com/sun/glass/ui/monocle/TouchLagTest.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.TestApplication; import javafx.geometry.Rectangle2D; import javafx.stage.Screen; import org.junit.After; import org.junit.Assert; --- 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.TestApplication; import javafx.geometry.Rectangle2D; import javafx.stage.Screen; import org.junit.After; import org.junit.Assert;
*** 40,51 **** private UInput ui; @Rule public TestName name = new TestName(); @Before public void setUpScreen() throws Exception { ! TestLog.reset(); ! TestLog.log(name.getMethodName()); TestApplication.showFullScreenScene(); TestApplication.addTouchListeners(); TestApplication.addMouseListeners(); initDevice(); } --- 40,51 ---- private UInput ui; @Rule public TestName name = new TestName(); @Before public void setUpScreen() throws Exception { ! TestLogShim.reset(); ! TestLogShim.log(name.getMethodName()); TestApplication.showFullScreenScene(); TestApplication.addTouchListeners(); TestApplication.addMouseListeners(); initDevice(); }
*** 97,115 **** /** Make sure we can process 1000 touch move events per second. We are * not required to report all these events, but must report the last one. */ @Test public void testTouchLag() throws Exception { ! TestLog.reset(); ui.processLine("EV_ABS ABS_X 300"); ui.processLine("EV_ABS ABS_Y 300"); ui.processLine("EV_KEY BTN_TOUCH 1"); ui.processLine("EV_ABS ABS_MT_POSITION_X 300"); ui.processLine("EV_ABS ABS_MT_POSITION_Y 300"); ui.processLine("EV_SYN SYN_MT_REPORT 0"); ui.processLine("EV_SYN SYN_REPORT 0"); ! TestLog.waitForLogContaining("TouchPoint: PRESSED", 3000l); // pre-process move event data into a byte array. That way we don't // have to count the time it takes to convert string event descriptions // into a byte stream. byte[] b = new byte[1024]; int offset = 0; --- 97,115 ---- /** Make sure we can process 1000 touch move events per second. We are * not required to report all these events, but must report the last one. */ @Test public void testTouchLag() throws Exception { ! TestLogShim.reset(); ui.processLine("EV_ABS ABS_X 300"); ui.processLine("EV_ABS ABS_Y 300"); ui.processLine("EV_KEY BTN_TOUCH 1"); ui.processLine("EV_ABS ABS_MT_POSITION_X 300"); ui.processLine("EV_ABS ABS_MT_POSITION_Y 300"); ui.processLine("EV_SYN SYN_MT_REPORT 0"); ui.processLine("EV_SYN SYN_REPORT 0"); ! TestLogShim.waitForLogContaining("TouchPoint: PRESSED", 3000l); // pre-process move event data into a byte array. That way we don't // have to count the time it takes to convert string event descriptions // into a byte stream. byte[] b = new byte[1024]; int offset = 0;
*** 146,156 **** } long t = System.currentTimeMillis() - startTime; // Make sure events could be sent in the required time Assert.assertTrue("Took " + t + "ms to send 3000 events", t < (long) (3000l * TestApplication.getTimeScale())); ! TestLog.log("Sent 3000 events in " + t + "ms"); // move to 400, 410 ui.writeValue(b, xs[0], 400); ui.writeValue(b, xs[1], 400); ui.writeValue(b, ys[0], 410); ui.writeValue(b, ys[1], 410); --- 146,156 ---- } long t = System.currentTimeMillis() - startTime; // Make sure events could be sent in the required time Assert.assertTrue("Took " + t + "ms to send 3000 events", t < (long) (3000l * TestApplication.getTimeScale())); ! TestLogShim.log("Sent 3000 events in " + t + "ms"); // move to 400, 410 ui.writeValue(b, xs[0], 400); ui.writeValue(b, xs[1], 400); ui.writeValue(b, ys[0], 410); ui.writeValue(b, ys[1], 410);
*** 158,184 **** // release ui.processLine("EV_KEY BTN_TOUCH 0"); ui.processLine("EV_SYN SYN_MT_REPORT 0"); ui.processLine("EV_SYN SYN_REPORT 0"); // Make sure events could be delivered in the required time ! TestLog.waitForLog("Touch moved: 400, 410", 3000l - t); } /** Make sure we can process 1000 multitouch move events per second. We are * not required to report all these events, but must report the last one. */ @Test public void testMultitouchLag() throws Exception { ! TestLog.reset(); ui.processLine("EV_ABS ABS_X 300"); ui.processLine("EV_ABS ABS_Y 300"); ui.processLine("EV_KEY BTN_TOUCH 1"); ui.processLine("EV_ABS ABS_MT_POSITION_X 300"); ui.processLine("EV_ABS ABS_MT_POSITION_Y 300"); ui.processLine("EV_SYN SYN_MT_REPORT 0"); ui.processLine("EV_SYN SYN_REPORT 0"); ! TestLog.waitForLogContaining("TouchPoint: PRESSED", 3000); // pre-process move event data into a byte array. That way we don't // have to count the time it takes to convert string event descriptions // into a byte stream. byte[] b = new byte[1024]; int offset = 0; --- 158,184 ---- // release ui.processLine("EV_KEY BTN_TOUCH 0"); ui.processLine("EV_SYN SYN_MT_REPORT 0"); ui.processLine("EV_SYN SYN_REPORT 0"); // Make sure events could be delivered in the required time ! TestLogShim.waitForLog("Touch moved: 400, 410", 3000l - t); } /** Make sure we can process 1000 multitouch move events per second. We are * not required to report all these events, but must report the last one. */ @Test public void testMultitouchLag() throws Exception { ! TestLogShim.reset(); ui.processLine("EV_ABS ABS_X 300"); ui.processLine("EV_ABS ABS_Y 300"); ui.processLine("EV_KEY BTN_TOUCH 1"); ui.processLine("EV_ABS ABS_MT_POSITION_X 300"); ui.processLine("EV_ABS ABS_MT_POSITION_Y 300"); ui.processLine("EV_SYN SYN_MT_REPORT 0"); ui.processLine("EV_SYN SYN_REPORT 0"); ! TestLogShim.waitForLogContaining("TouchPoint: PRESSED", 3000); // pre-process move event data into a byte array. That way we don't // have to count the time it takes to convert string event descriptions // into a byte stream. byte[] b = new byte[1024]; int offset = 0;
*** 225,235 **** } long t = System.currentTimeMillis() - startTime; // Make sure events could be sent in the required time Assert.assertTrue("Took " + t + "ms to send 3000 events", t < (long) (3000l * TestApplication.getTimeScale())); ! TestLog.log("Sent 3000 events in " + t + "ms"); // move to (400, 410), (350, 360); ui.writeValue(b, baseX, 400); ui.writeValue(b, baseY, 410); ui.writeValue(b, xs[0], 400); ui.writeValue(b, ys[0], 410); --- 225,235 ---- } long t = System.currentTimeMillis() - startTime; // Make sure events could be sent in the required time Assert.assertTrue("Took " + t + "ms to send 3000 events", t < (long) (3000l * TestApplication.getTimeScale())); ! TestLogShim.log("Sent 3000 events in " + t + "ms"); // move to (400, 410), (350, 360); ui.writeValue(b, baseX, 400); ui.writeValue(b, baseY, 410); ui.writeValue(b, xs[0], 400); ui.writeValue(b, ys[0], 410);
*** 248,255 **** ui.processLine("EV_ABS ABS_Y 410"); ui.processLine("EV_KEY BTN_TOUCH 0"); ui.processLine("EV_SYN SYN_MT_REPORT 0"); ui.processLine("EV_SYN SYN_REPORT 0"); // Make sure events could be delivered in the required time ! TestLog.waitForLog("Touch released: 400, 410", 3000l - t); } } --- 248,255 ---- ui.processLine("EV_ABS ABS_Y 410"); ui.processLine("EV_KEY BTN_TOUCH 0"); ui.processLine("EV_SYN SYN_MT_REPORT 0"); ui.processLine("EV_SYN SYN_REPORT 0"); // Make sure events could be delivered in the required time ! TestLogShim.waitForLog("Touch released: 400, 410", 3000l - t); } }
< prev index next >