Home | History | Annotate | Download | only in framed

Lines Matching refs:peer

61   private final MockSpdyPeer peer = new MockSpdyPeer();
64 peer.close();
69 peer.acceptFrame(); // SYN_STREAM
70 peer.sendFrame()
72 peer.sendFrame().data(true, 1, new Buffer().writeUtf8("robot"), 5);
73 peer.acceptFrame(); // DATA
74 peer.play();
77 FramedConnection connection = connection(peer, SPDY3);
86 // verify the peer received what was expected
87 MockSpdyPeer.InFrame synStream = peer.takeFrame();
95 MockSpdyPeer.InFrame requestData = peer.takeFrame();
100 peer.acceptFrame(); // SYN_STREAM
101 peer.sendFrame().synReply(false, 1, headerEntries("b", "banana"));
102 peer.acceptFrame(); // PING
103 peer.sendFrame().ping(true, 1, 0);
104 peer.play();
106 FramedConnection connection = connection(peer, SPDY3);
116 peer.acceptFrame(); // SYN_STREAM
117 peer.acceptFrame(); // PING
118 peer.sendFrame().synReply(true, 1, headerEntries("a", "android"));
119 peer.sendFrame().ping(true, 1, 0);
120 peer.play();
123 FramedConnection connection = connection(peer, SPDY3);
129 // verify the peer received what was expected
130 MockSpdyPeer.InFrame synStream = peer.takeFrame();
133 MockSpdyPeer.InFrame ping = peer.takeFrame();
147 peer.sendFrame().synStream(false, false, 2, 0, pushHeaders);
148 peer.acceptFrame(); // SYN_REPLY
149 peer.play();
162 .socket(peer.openSocket())
166 // verify the peer received what was expected
167 MockSpdyPeer.InFrame reply = peer.takeFrame();
178 peer.sendFrame().synStream(false, false, 2, 0, headerEntries("a", "android"));
179 peer.acceptFrame(); // SYN_REPLY
180 peer.play();
191 connectionBuilder(peer, SPDY3).listener(listener).build();
193 // verify the peer received what was expected
194 MockSpdyPeer.InFrame reply = peer.takeFrame();
204 peer.sendFrame().ping(false, 2, 0);
205 peer.acceptFrame(); // PING
206 peer.play();
209 connection(peer, SPDY3);
211 // verify the peer received what was expected
212 MockSpdyPeer.InFrame ping = peer.takeFrame();
221 peer.acceptFrame(); // PING
222 peer.sendFrame().ping(true, 1, 5); // payload2 ignored in spdy!
223 peer.play();
226 FramedConnection connection = connection(peer, SPDY3);
231 // verify the peer received what was expected
232 MockSpdyPeer.InFrame pingFrame = peer.takeFrame();
241 peer.sendFrame().ping(false, 2, 0);
242 peer.acceptFrame(); // PING
243 peer.sendFrame().ping(true, 3, 0); // This ping will not be returned.
244 peer.sendFrame().ping(false, 4, 0);
245 peer.acceptFrame(); // PING
246 peer.play();
249 connection(peer, SPDY3);
251 // verify the peer received what was expected
252 MockSpdyPeer.InFrame ping2 = peer.takeFrame();
254 MockSpdyPeer.InFrame ping4 = peer.takeFrame();
262 peer.sendFrame().settings(settings);
263 peer.sendFrame().ping(false, 2, 0);
264 peer.acceptFrame(); // PING
265 peer.play();
277 FramedConnection connection = connectionBuilder(peer, SPDY3)
281 peer.takeFrame(); // Guarantees that the peer Settings frame has been processed.
294 peer.sendFrame().settings(settings1);
299 peer.sendFrame().settings(settings2);
300 peer.sendFrame().ping(false, 2, 0);
301 peer.acceptFrame();
302 peer.play();
305 FramedConnection connection = connection(peer, SPDY3);
307 peer.takeFrame(); // Guarantees that the Settings frame has been processed.
326 peer.sendFrame().settings(settings1);
327 peer.sendFrame().ping(false, 2, 0);
328 peer.acceptFrame();
329 peer.play();
332 FramedConnection connection = connection(peer, SPDY3);
334 peer.takeFrame(); // Guarantees that the Settings frame has been processed.
351 peer.sendFrame().data(true, 41, new Buffer().writeUtf8("bogus"), 5);
352 peer.acceptFrame(); // RST_STREAM
353 peer.sendFrame().ping(false, 2, 0);
354 peer.acceptFrame(); // PING
355 peer.play();
358 connection(peer, SPDY3);
360 // verify the peer received what was expected
361 MockSpdyPeer.InFrame rstStream = peer.takeFrame();
365 MockSpdyPeer.InFrame ping = peer.takeFrame();
371 peer.sendFrame().synReply(false, 41, headerEntries("a", "android"));
372 peer.acceptFrame(); // RST_STREAM
373 peer.sendFrame().ping(false, 2, 0);
374 peer.acceptFrame(); // PING
375 peer.play();
378 connection(peer, SPDY3);
380 // verify the peer received what was expected
381 MockSpdyPeer.InFrame rstStream = peer.takeFrame();
385 MockSpdyPeer.InFrame ping = peer.takeFrame();
391 peer.acceptFrame(); // SYN_STREAM
392 peer.sendFrame().synReply(false, 1, headerEntries("b", "banana"));
393 peer.acceptFrame(); // TYPE_DATA
394 peer.acceptFrame(); // TYPE_DATA with FLAG_FIN
395 peer.acceptFrame(); // PING
396 peer.sendFrame().ping(true, 1, 0);
397 peer.play();
400 FramedConnection connection = connection(peer, SPDY3);
416 // verify the peer received what was expected
417 MockSpdyPeer.InFrame synStream = peer.takeFrame();
422 MockSpdyPeer.InFrame data = peer.takeFrame();
426 MockSpdyPeer.InFrame fin = peer.takeFrame();
429 MockSpdyPeer.InFrame ping = peer.takeFrame();
436 peer.acceptFrame(); // SYN_STREAM
437 peer.sendFrame().rstStream(1, CANCEL);
438 peer.acceptFrame(); // PING
439 peer.sendFrame().ping(true, 1, 0);
440 peer.play();
443 FramedConnection connection = connection(peer, SPDY3);
462 // verify the peer received what was expected
463 MockSpdyPeer.InFrame synStream = peer.takeFrame();
468 MockSpdyPeer.InFrame ping = peer.takeFrame();
479 peer.acceptFrame(); // SYN_STREAM
480 peer.acceptFrame(); // RST_STREAM
481 peer.play();
484 FramedConnection connection = connection(peer, SPDY3);
504 // verify the peer received what was expected
505 MockSpdyPeer.InFrame synStream = peer.takeFrame();
510 MockSpdyPeer.InFrame rstStream = peer.takeFrame();
521 peer.acceptFrame(); // SYN_STREAM
522 peer.acceptFrame(); // DATA
523 peer.acceptFrame(); // DATA with FLAG_FIN
524 peer.acceptFrame(); // RST_STREAM
525 peer.play();
528 FramedConnection connection = connection(peer, SPDY3);
544 // verify the peer received what was expected
545 MockSpdyPeer.InFrame synStream = peer.takeFrame();
550 MockSpdyPeer.InFrame data = peer.takeFrame();
553 MockSpdyPeer.InFrame fin = peer.takeFrame();
557 MockSpdyPeer.InFrame rstStream = peer.takeFrame();
564 peer.acceptFrame(); // SYN_STREAM
565 peer.sendFrame().synReply(false, 1, headerEntries("b", "banana"));
566 peer.sendFrame().data(true, 1, new Buffer().writeUtf8("square"), 6);
567 peer.acceptFrame(); // PING
568 peer.sendFrame().ping(true, 1, 0);
569 peer.play();
572 FramedConnection connection = connection(peer, SPDY3);
579 // verify the peer received what was expected
580 MockSpdyPeer.InFrame synStream = peer.takeFrame();
589 peer.acceptFrame(); // SYN_STREAM
590 peer.sendFrame().synReply(false, 1, headerEntries("a", "android"));
591 peer.acceptFrame(); // PING
592 peer.sendFrame().synReply(false, 1, headerEntries("b", "banana"));
593 peer.sendFrame().ping(true, 1, 0);
594 peer.acceptFrame(); // RST_STREAM
595 peer.play();
598 FramedConnection connection = connection(peer, SPDY3);
609 // verify the peer received what was expected
610 MockSpdyPeer.InFrame synStream = peer.takeFrame();
613 MockSpdyPeer.InFrame ping = peer.takeFrame();
615 MockSpdyPeer.InFrame rstStream = peer.takeFrame();
623 peer.sendFrame().synStream(false, false, 2, 0, headerEntries("a", "android"));
624 peer.acceptFrame(); // SYN_REPLY
625 peer.sendFrame().synStream(false, false, 2, 0, headerEntries("b", "banana"));
626 peer.acceptFrame(); // RST_STREAM
627 peer.play();
640 .socket(peer.openSocket())
644 // verify the peer received what was expected
645 MockSpdyPeer.InFrame reply = peer.takeFrame();
648 MockSpdyPeer.InFrame rstStream = peer.takeFrame();
657 peer.acceptFrame(); // SYN_STREAM
658 peer.sendFrame().synReply(false, 1, headerEntries("a", "android"));
659 peer.sendFrame().data(true, 1, new Buffer().writeUtf8("robot"), 5);
660 peer.sendFrame().data(true, 1, new Buffer().writeUtf8("c3po"), 4); // Ignored.
661 peer.sendFrame().ping(false, 2, 0); // Ping just to make sure the stream was fastforwarded.
662 peer.acceptFrame(); // PING
663 peer.play();
666 FramedConnection connection = connection(peer, SPDY3);
671 // verify the peer received what was expected
672 MockSpdyPeer.InFrame synStream = peer.takeFrame();
675 MockSpdyPeer.InFrame ping = peer.takeFrame();
683 peer.acceptFrame(); // SYN_STREAM
684 peer.sendFrame().synReply(false, 1, headerEntries("b", "banana"));
685 peer.sendFrame().data(false, 1, new Buffer().write(new byte[dataLength]), dataLength);
686 peer.sendFrame().ping(false, 2, 0); // Ping just to make sure the stream was fastforwarded.
687 peer.acceptFrame(); // PING
688 peer.play();
691 FramedConnection connection = connection(peer, SPDY3);
695 // verify the peer received what was expected
696 MockSpdyPeer.InFrame synStream = peer.takeFrame();
699 MockSpdyPeer.InFrame ping = peer.takeFrame();
706 peer.acceptFrame(); // SYN_STREAM
707 peer.sendFrame().rstStream(1, REFUSED_STREAM);
708 peer.sendFrame().ping(false, 2, 0);
709 peer.acceptFrame(); // PING
710 peer.play();
713 FramedConnection connection = connection(peer, SPDY3);
723 // verify the peer received what was expected
724 MockSpdyPeer.InFrame synStream = peer.takeFrame();
727 MockSpdyPeer.InFrame ping = peer.takeFrame();
733 peer.setVariantAndClient(SPDY3, false);
736 peer.acceptFrame(); // SYN_STREAM 1
737 peer.acceptFrame(); // SYN_STREAM 3
738 peer.acceptFrame(); // PING.
739 peer.sendFrame().goAway(1, PROTOCOL_ERROR, Util.EMPTY_BYTE_ARRAY);
740 peer.sendFrame().ping(true, 1, 0);
741 peer.acceptFrame(); // DATA STREAM 1
742 peer.play();
745 FramedConnection connection = connection(peer, SPDY3);
771 // verify the peer received what was expected
772 MockSpdyPeer.InFrame synStream1 = peer.takeFrame();
774 MockSpdyPeer.InFrame synStream2 = peer.takeFrame();
776 MockSpdyPeer.InFrame ping = peer.takeFrame();
778 MockSpdyPeer.InFrame data1 = peer.takeFrame();
786 peer.acceptFrame(); // SYN_STREAM 1
787 peer.acceptFrame(); // GOAWAY
788 peer.acceptFrame(); // PING
789 peer.sendFrame().synStream(false, false, 2, 0, headerEntries("b", "b")); // Should be ignored!
790 peer.sendFrame().ping(true, 1, 0);
791 peer.play();
794 FramedConnection connection = connection(peer, SPDY3);
799 ping.roundTripTime(); // Prevent the peer from exiting prematurely.
801 // verify the peer received what was expected
802 MockSpdyPeer.InFrame synStream1 = peer.takeFrame();
804 MockSpdyPeer.InFrame pingFrame = peer.takeFrame();
806 MockSpdyPeer.InFrame goaway = peer.takeFrame();
814 peer.acceptFrame(); // GOAWAY
815 peer.play();
818 FramedConnection connection = connection(peer, SPDY3);
827 // verify the peer received what was expected
828 MockSpdyPeer.InFrame goaway = peer.takeFrame();
835 peer.acceptFrame(); // SYN_STREAM
836 peer.acceptFrame(); // GOAWAY
837 peer.acceptFrame(); // RST_STREAM
838 peer.play();
841 FramedConnection connection = connection(peer, SPDY3);
867 // verify the peer received what was expected
868 MockSpdyPeer.InFrame synStream = peer.takeFrame();
871 MockSpdyPeer.InFrame goaway = peer.takeFrame();
873 MockSpdyPeer.InFrame rstStream = peer.takeFrame();
880 peer.acceptFrame(); // PING
881 peer.acceptFrame(); // GOAWAY
882 peer.play();
885 FramedConnection connection = connection(peer, SPDY3);
893 peer.acceptFrame(); // SYN_STREAM
894 peer.acceptFrame(); // RST_STREAM
895 peer.play();
898 FramedConnection connection = connection(peer, SPDY3);
912 // verify the peer received what was expected
913 assertEquals(TYPE_HEADERS, peer.takeFrame().type);
914 assertEquals(TYPE_RST_STREAM, peer.takeFrame().type);
919 peer.acceptFrame(); // SYN_STREAM
920 peer.sendFrame().synReply(false, 1, headerEntries("a", "android"));
921 peer.acceptFrame(); // RST_STREAM
922 peer.play();
925 FramedConnection connection = connection(peer, SPDY3);
940 // verify the peer received what was expected
941 assertEquals(TYPE_HEADERS, peer.takeFrame().type);
942 assertEquals(TYPE_RST_STREAM, peer.takeFrame().type);
946 // Set the peer's receive window to 5 bytes!
950 peer.sendFrame().settings(peerSettings);
951 peer.acceptFrame(); // PING
952 peer.sendFrame().ping(true, 1, 0);
953 peer.acceptFrame(); // SYN_STREAM
954 peer.sendFrame().synReply(false, 1, headerEntries("a", "android"));
955 peer.acceptFrame(); // DATA
956 peer.acceptFrame(); // RST_STREAM
957 peer.play();
960 FramedConnection connection = connection(peer, SPDY3);
978 // verify the peer received what was expected
979 assertEquals(TYPE_PING, peer.takeFrame().type);
980 assertEquals(TYPE_HEADERS, peer.takeFrame().type);
981 assertEquals(TYPE_DATA, peer.takeFrame().type);
982 assertEquals(TYPE_RST_STREAM, peer.takeFrame().type);
986 // Set the peer's receive window to 5 bytes. Give the stream 5 bytes back, so only the
991 peer.sendFrame().settings(peerSettings);
992 peer.acceptFrame(); // SYN_STREAM
993 peer.sendFrame().synReply(false, 1, headerEntries("a", "android"));
994 peer.sendFrame().windowUpdate(1, 5);
995 peer.acceptFrame(); // PING
996 peer.sendFrame().ping(true, 1, 0);
997 peer.acceptFrame(); // DATA
998 peer.acceptFrame(); // RST_STREAM
999 peer.play();
1002 FramedConnection connection = connection(peer, SPDY3);
1019 // verify the peer received what was expected
1020 assertEquals(TYPE_HEADERS, peer.takeFrame().type);
1021 assertEquals(TYPE_PING, peer.takeFrame().type);
1022 assertEquals(TYPE_DATA, peer.takeFrame().type);
1023 assertEquals(TYPE_RST_STREAM, peer.takeFrame().type);
1028 peer.acceptFrame(); // SYN_STREAM
1029 peer.sendFrame().synReply(false, 1, headerEntries("a", "android"));
1030 peer.acceptFrame(); // DATA
1031 peer.play();
1034 FramedConnection connection = connection(peer, SPDY3);
1043 // verify the peer received one incoming frame
1044 assertEquals(TYPE_HEADERS, peer.takeFrame().type);
1045 MockSpdyPeer.InFrame data = peer.takeFrame();
1053 peer.acceptFrame(); // SYN_STREAM
1054 peer.acceptFrame(); // PING
1055 peer.sendFrame().synReply(false, 1, headerEntries("a", "android"));
1056 peer.sendFrame().headers(1, headerEntries("c", "c3po"));
1057 peer.sendFrame().ping(true, 1, 0);
1058 peer.play();
1061 FramedConnection connection = connection(peer, SPDY3);
1066 // verify the peer received what was expected
1067 MockSpdyPeer.InFrame synStream = peer.takeFrame();
1070 MockSpdyPeer.InFrame ping = peer.takeFrame();
1076 peer.acceptFrame(); // SYN_STREAM
1077 peer.acceptFrame(); // PING
1078 peer.sendFrame().headers(1, headerEntries("c", "c3po"));
1079 peer.acceptFrame(); // RST_STREAM
1080 peer.sendFrame().ping(true, 1, 0);
1081 peer.play();
1084 FramedConnection connection = connection(peer, SPDY3);
1094 // verify the peer received what was expected
1095 MockSpdyPeer.InFrame synStream = peer.takeFrame();
1098 MockSpdyPeer.InFrame ping = peer.takeFrame();
1100 MockSpdyPeer.InFrame rstStream = peer.takeFrame();
1106 peer.setVariantAndClient(SPDY3, false);
1112 peer.acceptFrame(); // SYN_STREAM
1113 peer.sendFrame().synReply(false, 1, headerEntries("a", "android"));
1116 peer.sendFrame().data(false, 1, data(24), 24);
1117 peer.sendFrame().data(false, 1, data(25), 25);
1118 peer.sendFrame().data(false, 1, data(1), 1);
1119 peer.acceptFrame(); // connection WINDOW UPDATE
1120 peer.acceptFrame(); // stream WINDOW UPDATE
1122 peer.sendFrame().data(true, 1, data(0), 0);
1123 peer.play();
1126 FramedConnection connection = connection(peer, SPDY3);
1137 MockSpdyPeer.InFrame synStream = peer.takeFrame();
1142 MockSpdyPeer.InFrame windowUpdate = peer.takeFrame();
1157 peer.setVariantAndClient(SPDY3, false);
1160 peer.acceptFrame(); // SYN_STREAM
1161 peer.sendFrame().synReply(false, 1, headerEntries("a", "android"));
1162 peer.sendFrame().data(true, 1, data(0), 0);
1163 peer.play();
1166 FramedConnection connection = connection(peer, SPDY3);
1170 // Verify the peer received what was expected.
1171 MockSpdyPeer.InFrame synStream = peer.takeFrame();
1173 assertEquals(3, peer.frameCount());
1177 peer.setVariantAndClient(SPDY3, false);
1180 peer.acceptFrame(); // SYN_STREAM
1181 peer.acceptFrame(); // DATA
1182 peer.sendFrame().synReply(false, 1, headerEntries("a", "android"));
1183 peer.play();
1186 FramedConnection connection = connection(peer, SPDY3);
1193 // Verify the peer received what was expected.
1194 assertEquals(TYPE_HEADERS, peer.takeFrame().type);
1195 assertEquals(TYPE_DATA, peer.takeFrame().type);
1196 assertEquals(3, peer.frameCount());
1201 peer.acceptFrame(); // SYN_STREAM
1202 peer.sendFrame().synReply(false, 1, headerEntries("a", "android"));
1203 peer.sendFrame().data(false, 1, data(1024), 1024);
1204 peer.truncateLastFrame(8 + 100);
1205 peer.play();
1208 FramedConnection connection = connection(peer, SPDY3);
1221 int framesThatFillWindow = roundUp(DEFAULT_INITIAL_WINDOW_SIZE, peer.maxOutboundDataLength());
1224 peer.acceptFrame(); // SYN_STREAM on stream 1
1226 peer.acceptFrame(); // DATA on stream 1
1228 peer.acceptFrame(); // SYN_STREAM on stream 2
1229 peer.acceptFrame(); // DATA on stream 2
1230 peer.play();
1233 FramedConnection connection = connection(peer, SPDY3);
1314 peer.acceptFrame(); // SYN_STREAM
1317 peer.sendFrame(trailingCompressedBytes);
1318 peer.sendFrame().data(true, 1, new Buffer().writeUtf8("robot"), 5);
1319 peer.acceptFrame(); // DATA
1320 peer.play();
1323 FramedConnection connection = connection(peer, SPDY3);
1331 peer.acceptFrame(); // SYN_STREAM.
1332 peer.play();
1335 Socket socket = peer.openSocket();
1359 private FramedConnection connection(MockSpdyPeer peer, Variant variant) throws IOException {
1360 return connectionBuilder(peer, variant).build();
1363 private FramedConnection.Builder connectionBuilder(MockSpdyPeer peer, Variant variant)
1366 .socket(peer.openSocket())