< prev index next >
tests/system/src/test/java/test/robot/com/sun/glass/ui/monocle/MonocleUInput.java
Print this page
rev 9491 : 8145203: Refactor systemTests for clear separation of tests
Reviewed-by: kcr
@@ -21,31 +21,31 @@
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
-package com.sun.glass.ui.monocle;
+package test.robot.com.sun.glass.ui.monocle;
+import test.robot.com.sun.glass.ui.monocle.TestApplication;
import com.sun.glass.ui.Application;
+import com.sun.glass.ui.monocle.LinuxInputDeviceRegistryShim;
import javafx.application.Platform;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.Pipe;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicReference;
+import test.com.sun.glass.ui.monocle.NativeUInput;
class MonocleUInput extends NativeUInput {
private Pipe pipe;
- private LinuxInputDevice device;
- private final LinuxInputDeviceRegistry registry;
+ private LinuxInputDeviceRegistryShim.LinuxInputDeviceShim device;
MonocleUInput() {
super();
- registry = (LinuxInputDeviceRegistry)
- NativePlatformFactory.getNativePlatform().getInputDeviceRegistry();
}
@Override
protected void createDevice() {
try {
@@ -56,16 +56,16 @@
uevent.put("PRODUCT",
Integer.toHexString(bus) + "/"
+ Integer.toHexString(vendor) + "/"
+ Integer.toHexString(product) + "/"
+ Integer.toHexString(version));
- Application.invokeAndWait(() -> device = registry.addDevice(
- new LinuxInputDevice(capabilities,
- createAbsCapsMap(),
+ Application.invokeAndWait(() -> device
+ = LinuxInputDeviceRegistryShim.addDevice(capabilities,
+ absCaps,
pipe.source(),
udevManifest,
- uevent),
+ uevent,
"Simulated Linux Input Device"));
}
protected void openConnection() {
}
@@ -84,17 +84,17 @@
} catch (IOException e) {
e.printStackTrace();
}
pipe = null;
if (device != null) {
- final LinuxInputDevice d = device;
+ final LinuxInputDeviceRegistryShim.LinuxInputDeviceShim d = device;
if (Platform.isFxApplicationThread()) {
- registry.removeDevice(d);
+ LinuxInputDeviceRegistryShim.removeDevice(d);
} else {
CountDownLatch latch = new CountDownLatch(1);
Platform.runLater(() -> {
- registry.removeDevice(d);
+ LinuxInputDeviceRegistryShim.removeDevice(d);
latch.countDown();
});
try {
latch.await();
} catch (InterruptedException e) {
< prev index next >