Home | History | Annotate | Download | only in framed

Lines Matching refs:peer

52   private final MockSpdyPeer peer = new MockSpdyPeer();
55 peer.close();
59 peer.setVariantAndClient(HTTP_2, false);
62 peer.sendFrame().ping(false, 2, 3);
63 peer.acceptFrame(); // PING
64 peer.play();
67 connection(peer, HTTP_2);
69 // verify the peer received what was expected
70 MockSpdyPeer.InFrame ping = peer.takeFrame();
79 peer.setVariantAndClient(HTTP_2, false);
82 peer.acceptFrame(); // PING
83 peer.sendFrame().ping(true, 1, 5);
84 peer.play();
87 FramedConnection connection = connection(peer, HTTP_2);
92 // verify the peer received what was expected
93 MockSpdyPeer.InFrame pingFrame = peer.takeFrame();
101 peer.setVariantAndClient(HTTP_2, false);
108 peer.sendFrame().settings(initial);
109 peer.acceptFrame(); // ACK
110 peer.sendFrame().settings(shouldntImpactConnection);
111 peer.acceptFrame(); // ACK 2
112 peer.acceptFrame(); // HEADERS
113 peer.play();
115 FramedConnection connection = connection(peer, HTTP_2);
120 // Verify the peer received the ACK.
121 MockSpdyPeer.InFrame ackFrame = peer.takeFrame();
125 ackFrame = peer.takeFrame();
140 boolean client = false; // Peer is server, so we are client.
146 // verify the peer's settings were read and applied.
154 boolean client = false; // Peer is client, so we are server.
156 settings.set(Settings.ENABLE_PUSH, 0, 0); // The peer client disables push.
160 // verify the peer's settings were read and applied.
171 // verify the peer's settings were read and applied.
177 peer.setVariantAndClient(HTTP_2, false);
180 peer.acceptFrame(); // SYN_STREAM 3
181 peer.acceptFrame(); // SYN_STREAM 5
182 peer.sendFrame().goAway(3, PROTOCOL_ERROR, Util.EMPTY_BYTE_ARRAY);
183 peer.acceptFrame(); // PING
184 peer.sendFrame().ping(true, 1, 0);
185 peer.acceptFrame(); // DATA STREAM 3
186 peer.play();
189 FramedConnection connection = connection(peer, HTTP_2);
215 // verify the peer received what was expected
216 MockSpdyPeer.InFrame synStream1 = peer.takeFrame();
218 MockSpdyPeer.InFrame synStream2 = peer.takeFrame();
220 MockSpdyPeer.InFrame ping = peer.takeFrame();
222 MockSpdyPeer.InFrame data1 = peer.takeFrame();
229 peer.setVariantAndClient(HTTP_2, false);
235 peer.acceptFrame(); // SYN_STREAM
236 peer.sendFrame().synReply(false, 3, headerEntries("a", "android"));
239 peer.sendFrame().data(false, 3, data(24), 24);
240 peer.sendFrame().data(false, 3, data(25), 25);
241 peer.sendFrame().data(false, 3, data(1), 1);
242 peer.acceptFrame(); // connection WINDOW UPDATE
243 peer.acceptFrame(); // stream WINDOW UPDATE
245 peer.sendFrame().data(true, 3, data(0), 0);
246 peer.play();
249 FramedConnection connection = connection(peer, HTTP_2);
260 MockSpdyPeer.InFrame synStream = peer.takeFrame();
265 MockSpdyPeer.InFrame windowUpdate = peer.takeFrame();
280 peer.setVariantAndClient(HTTP_2, false);
283 peer.acceptFrame(); // SYN_STREAM
284 peer.sendFrame().synReply(false, 3, headerEntries("a", "android"));
285 peer.sendFrame().data(true, 3, data(0), 0);
286 peer.play();
289 FramedConnection connection = connection(peer, HTTP_2);
293 // Verify the peer received what was expected.
294 MockSpdyPeer.InFrame synStream = peer.takeFrame();
296 assertEquals(3, peer.frameCount());
300 peer.setVariantAndClient(HTTP_2, false);
303 peer.acceptFrame(); // SYN_STREAM
304 peer.acceptFrame(); // DATA
305 peer.sendFrame().synReply(false, 3, headerEntries("a", "android"));
306 peer.play();
309 FramedConnection connection = connection(peer, HTTP_2);
316 // Verify the peer received what was expected.
317 assertEquals(TYPE_HEADERS, peer.takeFrame().type);
318 assertEquals(TYPE_DATA, peer.takeFrame().type);
319 assertEquals(3, peer.frameCount());
323 peer.setVariantAndClient(HTTP_2, false);
325 byte[] buff = new byte[peer.maxOutboundDataLength() + 1];
329 peer.acceptFrame(); // SYN_STREAM
330 peer.sendFrame().synReply(false, 3, headerEntries("a", "android"));
331 peer.acceptFrame(); // DATA
332 peer.acceptFrame(); // DATA
333 peer.play();
336 FramedConnection connection = connection(peer, HTTP_2);
343 MockSpdyPeer.InFrame synStream = peer.takeFrame();
345 MockSpdyPeer.InFrame data = peer.takeFrame();
346 assertEquals(peer.maxOutboundDataLength(), data.data.length);
347 data = peer.takeFrame();
352 peer.setVariantAndClient(HTTP_2, false);
355 peer.acceptFrame(); // SYN_STREAM
356 peer.sendFrame().synReply(false, 3, headerEntries("a", "android"));
363 peer.sendFrame().pushPromise(3, 2, expectedRequestHeaders);
367 peer.sendFrame().synReply(true, 2, expectedResponseHeaders);
368 peer.sendFrame().data(true, 3, data(0), 0);
369 peer.play();
374 FramedConnection connection = connectionBuilder(peer, HTTP_2)
379 // verify the peer received what was expected
380 assertEquals(TYPE_HEADERS, peer.takeFrame().type);
387 peer.setVariantAndClient(HTTP_2, false);
390 peer.sendFrame().pushPromise(3, 2, headerEntries("a", "android"));
391 peer.acceptFrame(); // SYN_REPLY
392 peer.sendFrame().pushPromise(3, 2, headerEntries("b", "banana"));
393 peer.acceptFrame(); // RST_STREAM
394 peer.play();
397 FramedConnection connection = connectionBuilder(peer, HTTP_2).build();
400 // verify the peer received what was expected
401 assertEquals(TYPE_HEADERS, peer.takeFrame().type);
402 assertEquals(PROTOCOL_ERROR, peer.takeFrame().errorCode);
406 peer.setVariantAndClient(HTTP_2, false);
409 peer.sendFrame().pushPromise(3, 2, Arrays.asList(
415 peer.sendFrame().synReply(true, 2, Arrays.asList(
418 peer.acceptFrame(); // RST_STREAM
419 peer.play();
422 connectionBuilder(peer
425 // verify the peer received what was expected
426 MockSpdyPeer.InFrame rstStream = peer.takeFrame();
440 peer.setVariantAndClient(HTTP_2, false);
441 peer.acceptFrame(); // SYN_STREAM.
442 peer.play();
445 Socket socket = peer.openSocket();
466 peer.setVariantAndClient(HTTP_2, client);
467 peer.sendFrame().settings(settings);
468 peer.acceptFrame(); // ACK
469 peer.acceptFrame(); // PING
470 peer.sendFrame().ping(true, 1, 0);
471 peer.play();
474 FramedConnection connection = connection(peer, HTTP_2);
476 // verify the peer received the ACK
477 MockSpdyPeer.InFrame ackFrame = peer.takeFrame();
486 private FramedConnection connection(MockSpdyPeer peer, Variant variant) throws IOException {
487 return connectionBuilder(peer, variant).build();
490 private FramedConnection.Builder connectionBuilder(MockSpdyPeer peer, Variant variant)
493 .socket(peer.openSocket())