@SmallTest @Feature({"Zoom test"}) public void testZoomUsingMultiTouch() throws Throwable { XWalkSettings settings = getXWalkSettingsOnUiThreadByXWalkView(getXWalkView()); loadDataSync(getZoomableHtml(0.5f), "text/html", false); assertTrue(settings.supportZoom()); assertFalse(settings.getBuiltInZoomControls()); assertFalse(settings.supportsMultiTouchZoomForTest()); settings.setBuiltInZoomControls(true); assertTrue(settings.supportsMultiTouchZoomForTest()); settings.setSupportZoom(false); assertFalse(settings.supportsMultiTouchZoomForTest()); }
@SmallTest public void testZoomUsingMultiTouch() { try { XWalkSettings settings = getXWalkSettingsOnUiThreadByXWalkView(getXWalkView()); String url = "file:///android_asset/zoom.html"; loadUrlSync(url); assertTrue(settings.supportZoom()); assertFalse(settings.getBuiltInZoomControls()); assertFalse(settings.supportsMultiTouchZoomForTest()); settings.setBuiltInZoomControls(true); assertTrue(settings.supportsMultiTouchZoomForTest()); settings.setSupportZoom(false); assertFalse(settings.supportsMultiTouchZoomForTest()); } catch (Exception e) { assertTrue(false); e.printStackTrace(); } catch (Throwable e) { assertTrue(false); e.printStackTrace(); } }
void setAndLoadForDoubleTapZoom(boolean flag) { // setUseWideViewPort() should be called at first. mXWalkSettings.setUseWideViewPort(flag); mXWalkSettings.setBuiltInZoomControls(flag); mXWalkView.loadUrl("file:///android_asset/doubletapzoom.html"); }
void setAndLoadForBuiltInZoom(boolean flag) { mXWalkSettings.setBuiltInZoomControls(flag); mXWalkView.loadUrl("file:///android_asset/builtinzoom.html"); }