use of org.eclipse.jetty.websocket.common.extensions.ExtensionTool.Tester in project jetty.project by eclipse.
the class DeflateFrameExtensionTest method testChrome20_TimeTime.
@Test
public void testChrome20_TimeTime() {
Tester tester = serverExtensions.newTester("deflate-frame");
tester.assertNegotiated("deflate-frame");
// Captured from Chrome 20.x - "time:" then "time:" once more (sent from browser)
tester.parseIncomingHex(// "time:"
"c18782467424a88fb869374474", // "time:"
"c1853cfda17f16fcb07f3c");
tester.assertHasFrames("time:", "time:");
}
use of org.eclipse.jetty.websocket.common.extensions.ExtensionTool.Tester in project jetty.project by eclipse.
the class PerMessageDeflateExtensionTest method testDraft21_Hello_UnCompressedBlock.
/**
* Decode payload example as seen in draft-ietf-hybi-permessage-compression-21.
* <p>
* Section 8.2.3.1: A message compressed using 1 compressed DEFLATE block
*/
@Test
public void testDraft21_Hello_UnCompressedBlock() {
Tester tester = clientExtensions.newTester("permessage-deflate");
tester.assertNegotiated("permessage-deflate");
tester.parseIncomingHex(// (HEADER added for this test)
"0xc1 0x07", // example frame from RFC
"0xf2 0x48 0xcd 0xc9 0xc9 0x07 0x00");
tester.assertHasFrames("Hello");
}
use of org.eclipse.jetty.websocket.common.extensions.ExtensionTool.Tester in project jetty.project by eclipse.
the class PerMessageDeflateExtensionTest method testDraft21_SharingL77SlidingWindow_NoContextTakeover.
/**
* Decode payload example as seen in draft-ietf-hybi-permessage-compression-21.
* <p>
* Section 8.2.3.2: Sharing LZ77 Sliding Window
*/
@Test
public void testDraft21_SharingL77SlidingWindow_NoContextTakeover() {
Tester tester = clientExtensions.newTester("permessage-deflate");
tester.assertNegotiated("permessage-deflate");
// 2 message, shared LZ77 window
tester.parseIncomingHex(// (HEADER added for this test)
"0xc1 0x07", "0xf2 0x48 0xcd 0xc9 0xc9 0x07 0x00", // (HEADER added for this test)
"0xc1 0x05", "0xf2 0x00 0x11 0x00 0x00");
tester.assertHasFrames("Hello", "Hello");
}
use of org.eclipse.jetty.websocket.common.extensions.ExtensionTool.Tester in project jetty.project by eclipse.
the class PerMessageDeflateExtensionTest method testDraft21_DeflateBlockWithBFinal1.
/**
* Decode payload example as seen in draft-ietf-hybi-permessage-compression-21.
* <p>
* Section 8.2.3.4: Using a DEFLATE Block with BFINAL Set to 1
*/
@Test
public void testDraft21_DeflateBlockWithBFinal1() {
Tester tester = clientExtensions.newTester("permessage-deflate");
tester.assertNegotiated("permessage-deflate");
// 1 message
tester.parseIncomingHex(// header
"0xc1 0x08", // example payload
"0xf3 0x48 0xcd 0xc9 0xc9 0x07 0x00 0x00");
tester.assertHasFrames("Hello");
}
use of org.eclipse.jetty.websocket.common.extensions.ExtensionTool.Tester in project jetty.project by eclipse.
the class PerMessageDeflateExtensionTest method testDraft21_SharingL77SlidingWindow_ContextTakeover.
/**
* Decode payload example as seen in draft-ietf-hybi-permessage-compression-21.
* <p>
* Section 8.2.3.2: Sharing LZ77 Sliding Window
*/
@Test
public void testDraft21_SharingL77SlidingWindow_ContextTakeover() {
Tester tester = clientExtensions.newTester("permessage-deflate");
tester.assertNegotiated("permessage-deflate");
// context takeover (2 messages)
tester.parseIncomingHex(// (HEADER added for this test)
"0xc1 0x07", "0xf2 0x48 0xcd 0xc9 0xc9 0x07 0x00", // (HEADER added for this test)
"0xc1 0x07", "0xf2 0x48 0xcd 0xc9 0xc9 0x07 0x00");
tester.assertHasFrames("Hello", "Hello");
}
Aggregations