Skip to content

Commit 62f51a3

Browse files
committed
ADAP-102 added test case for Window.setZoomLevel and Window.getZoomLevel
1 parent cdabd35 commit 62f51a3

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

src/test/java/com/openfin/desktop/WindowTest.java

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import org.junit.AfterClass;
1414
import org.junit.BeforeClass;
15+
import org.junit.Ignore;
1516
import org.junit.Test;
1617
import org.slf4j.Logger;
1718
import org.slf4j.LoggerFactory;
@@ -754,4 +755,43 @@ public void onError(Ack ack) {
754755
TestUtils.closeApplication(application);
755756
}
756757

758+
@Ignore
759+
@Test
760+
public void getSetZoomLevel() throws Exception {
761+
double level = -1.5;
762+
ApplicationOptions options = TestUtils.getAppOptions(null);
763+
Application application = TestUtils.runApplication(options, desktopConnection);
764+
Window window = application.getWindow();
765+
CountDownLatch latch1 = new CountDownLatch(1);
766+
767+
window.setZoomLevel(level, new AckListener() {
768+
769+
@Override
770+
public void onSuccess(Ack ack) {
771+
latch1.countDown();
772+
}
773+
774+
@Override
775+
public void onError(Ack ack) {
776+
logger.error("error setting zoom level, reason: {}", ack.getReason());
777+
}
778+
});
779+
latch1.await(10, TimeUnit.SECONDS);
780+
assertEquals("setZoomLevel test timeout", 0, latch1.getCount());
781+
782+
CountDownLatch latch2 = new CountDownLatch(1);
783+
window.getZoomLevel(new AsyncCallback<Double>() {
784+
785+
@Override
786+
public void onSuccess(Double zLevel) {
787+
if (zLevel.doubleValue() == level) {
788+
latch2.countDown();
789+
}
790+
}
791+
}, null);
792+
latch2.await(10, TimeUnit.SECONDS);
793+
assertEquals("getZoomLevel test timeout", 0, latch2.getCount());
794+
795+
TestUtils.closeApplication(application);
796+
}
757797
}

0 commit comments

Comments
 (0)