DeflateFrameClientExtensionHandshaker implements WebSocketClientExtensionHandshaker { @Override public WebSocketExtensionData newRequestData() { return new WebSocketExtensionData( useWebkitExtensionName ? X_WEBKIT_DEFLATE_FRAME_EXTENSION : DEFLATE_FRAME_EXTENSION, Collections.<String, String>emptyMap()); } DeflateFrameClientExtensionHandshaker(boolean useWebkitExtensionName);  DeflateFrameClientExtensionHandshaker(int compressionLevel, boolean useWebkitExtensionName); @Override WebSocketExtensionData newRequestData(); @Override WebSocketClientExtension handshakeExtension(WebSocketExtensionData extensionData);  }
@Test public void testWebkitDeflateFrameData() { DeflateFrameClientExtensionHandshaker handshaker = new DeflateFrameClientExtensionHandshaker(true); WebSocketExtensionData data = handshaker.newRequestData(); assertEquals(X_WEBKIT_DEFLATE_FRAME_EXTENSION, data.name()); assertTrue(data.parameters().isEmpty()); }
@Test public void testDeflateFrameData() { DeflateFrameClientExtensionHandshaker handshaker = new DeflateFrameClientExtensionHandshaker(false); WebSocketExtensionData data = handshaker.newRequestData(); assertEquals(DEFLATE_FRAME_EXTENSION, data.name()); assertTrue(data.parameters().isEmpty()); }