Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(279)

Side by Side Diff: net/tools/quic/end_to_end_test.cc

Issue 839143002: Roll Chrome into Mojo. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Rebase Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/ssl/openssl_ssl_util.cc ('k') | net/tools/quic/quic_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stddef.h> 5 #include <stddef.h>
6 #include <string> 6 #include <string>
7 #include <sys/epoll.h> 7 #include <sys/epoll.h>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 EXPECT_EQ(200u, client_->response_headers()->parsed_response_code()); 464 EXPECT_EQ(200u, client_->response_headers()->parsed_response_code());
465 } 465 }
466 466
467 TEST_P(EndToEndTest, SeparateFinPacket) { 467 TEST_P(EndToEndTest, SeparateFinPacket) {
468 ASSERT_TRUE(Initialize()); 468 ASSERT_TRUE(Initialize());
469 469
470 HTTPMessage request(HttpConstants::HTTP_1_1, 470 HTTPMessage request(HttpConstants::HTTP_1_1,
471 HttpConstants::POST, "/foo"); 471 HttpConstants::POST, "/foo");
472 request.set_has_complete_message(false); 472 request.set_has_complete_message(false);
473 473
474 // Send a request in two parts: the request and then an empty packet with FIN.
474 client_->SendMessage(request); 475 client_->SendMessage(request);
475 476 client_->SendData("", true);
476 client_->SendData(string(), true);
477
478 client_->WaitForResponse(); 477 client_->WaitForResponse();
479 EXPECT_EQ(kFooResponseBody, client_->response_body()); 478 EXPECT_EQ(kFooResponseBody, client_->response_body());
480 EXPECT_EQ(200u, client_->response_headers()->parsed_response_code()); 479 EXPECT_EQ(200u, client_->response_headers()->parsed_response_code());
481 480
481 // Now do the same thing but with a content length.
482 request.AddBody("foo", true); 482 request.AddBody("foo", true);
483
484 client_->SendMessage(request); 483 client_->SendMessage(request);
485 client_->SendData(string(), true); 484 client_->SendData("", true);
486 client_->WaitForResponse(); 485 client_->WaitForResponse();
487 EXPECT_EQ(kFooResponseBody, client_->response_body()); 486 EXPECT_EQ(kFooResponseBody, client_->response_body());
488 EXPECT_EQ(200u, client_->response_headers()->parsed_response_code()); 487 EXPECT_EQ(200u, client_->response_headers()->parsed_response_code());
489 } 488 }
490 489
491 TEST_P(EndToEndTest, MultipleRequestResponse) { 490 TEST_P(EndToEndTest, MultipleRequestResponse) {
492 ASSERT_TRUE(Initialize()); 491 ASSERT_TRUE(Initialize());
493 492
494 EXPECT_EQ(kFooResponseBody, client_->SendSynchronousRequest("/foo")); 493 EXPECT_EQ(kFooResponseBody, client_->SendSynchronousRequest("/foo"));
495 EXPECT_EQ(200u, client_->response_headers()->parsed_response_code()); 494 EXPECT_EQ(200u, client_->response_headers()->parsed_response_code());
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after
1366 const QuicSentPacketManager& server_sent_packet_manager = 1365 const QuicSentPacketManager& server_sent_packet_manager =
1367 *GetSentPacketManagerFromFirstServerSession(); 1366 *GetSentPacketManagerFromFirstServerSession();
1368 EXPECT_TRUE(server_sent_packet_manager.using_pacing()); 1367 EXPECT_TRUE(server_sent_packet_manager.using_pacing());
1369 EXPECT_TRUE(client_sent_packet_manager.using_pacing()); 1368 EXPECT_TRUE(client_sent_packet_manager.using_pacing());
1370 } 1369 }
1371 1370
1372 } // namespace 1371 } // namespace
1373 } // namespace test 1372 } // namespace test
1374 } // namespace tools 1373 } // namespace tools
1375 } // namespace net 1374 } // namespace net
OLDNEW
« no previous file with comments | « net/ssl/openssl_ssl_util.cc ('k') | net/tools/quic/quic_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698