use of org.eclipse.jetty.websocket.common.extensions.ExtensionTool.Tester in project jetty.project by eclipse.
the class PerMessageDeflateExtensionTest method testDraft21_DeflateBlockWithNoCompression.
/**
* Decode payload example as seen in draft-ietf-hybi-permessage-compression-21.
* <p>
* Section 8.2.3.3: Using a DEFLATE Block with No Compression
*/
@Test
public void testDraft21_DeflateBlockWithNoCompression() {
Tester tester = clientExtensions.newTester("permessage-deflate");
tester.assertNegotiated("permessage-deflate");
// 1 message / no compression
tester.parseIncomingHex(// example frame
"0xc1 0x0b 0x00 0x05 0x00 0xfa 0xff 0x48 0x65 0x6c 0x6c 0x6f 0x00");
tester.assertHasFrames("Hello");
}
use of org.eclipse.jetty.websocket.common.extensions.ExtensionTool.Tester in project jetty.project by eclipse.
the class PerMessageDeflateExtensionTest method testPyWebSocket_Client_NoContextTakeover_ThreeOra.
@Test
public void testPyWebSocket_Client_NoContextTakeover_ThreeOra() {
Tester tester = clientExtensions.newTester("permessage-deflate; client_max_window_bits; client_no_context_takeover");
tester.assertNegotiated("permessage-deflate");
// Captured from Pywebsocket (r790) - 3 messages with similar parts.
// context takeover (3 messages)
tester.parseIncomingHex(// ToraTora
"c1 09 0a c9 2f 4a 0c 01 62 00 00", // AtoraFlora
"c1 0b 72 2c c9 2f 4a 74 cb 01 12 00 00", // PhloraTora
"c1 0b 0a c8 c8 c9 2f 4a 0c 01 62 00 00");
tester.assertHasFrames("ToraTora", "AtoraFlora", "PhloraTora");
}
Aggregations