| OLD | NEW |
| 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 <sys/epoll.h> | 6 #include <sys/epoll.h> |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 2748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2759 } | 2759 } |
| 2760 | 2760 |
| 2761 // Because of server push, client gets all pushed resources without actually | 2761 // Because of server push, client gets all pushed resources without actually |
| 2762 // sending requests for them. | 2762 // sending requests for them. |
| 2763 EXPECT_EQ(1u, client_->num_requests()); | 2763 EXPECT_EQ(1u, client_->num_requests()); |
| 2764 // Including response to original request, 12 responses in total were | 2764 // Including response to original request, 12 responses in total were |
| 2765 // recieved. | 2765 // recieved. |
| 2766 EXPECT_EQ(12u, client_->num_responses()); | 2766 EXPECT_EQ(12u, client_->num_responses()); |
| 2767 } | 2767 } |
| 2768 | 2768 |
| 2769 // TODO(ckrasic) - remove this when deprecating |
| 2770 // FLAGS_quic_enable_server_push_by_default. |
| 2769 TEST_P(EndToEndTestServerPush, DisabledWithoutConnectionOption) { | 2771 TEST_P(EndToEndTestServerPush, DisabledWithoutConnectionOption) { |
| 2772 FLAGS_quic_enable_server_push_by_default = false; |
| 2770 // Tests that server push won't be triggered when kSPSH is not set by client. | 2773 // Tests that server push won't be triggered when kSPSH is not set by client. |
| 2771 support_server_push_ = false; | 2774 support_server_push_ = false; |
| 2772 ASSERT_TRUE(Initialize()); | 2775 ASSERT_TRUE(Initialize()); |
| 2773 | 2776 |
| 2774 // Add a response with headers, body, and push resources. | 2777 // Add a response with headers, body, and push resources. |
| 2775 const string kBody = "body content"; | 2778 const string kBody = "body content"; |
| 2776 size_t const kNumResources = 4; | 2779 size_t const kNumResources = 4; |
| 2777 string push_urls[] = { | 2780 string push_urls[] = { |
| 2778 "https://example.com/font.woff", "https://example.com/script.js", | 2781 "https://example.com/font.woff", "https://example.com/script.js", |
| 2779 "https://fonts.example.com/font.woff", | 2782 "https://fonts.example.com/font.woff", |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2923 EXPECT_EQ(kBarResponseBody, client_->response_body()); | 2926 EXPECT_EQ(kBarResponseBody, client_->response_body()); |
| 2924 QuicConnectionStats client_stats = | 2927 QuicConnectionStats client_stats = |
| 2925 client_->client()->session()->connection()->GetStats(); | 2928 client_->client()->session()->connection()->GetStats(); |
| 2926 EXPECT_EQ(0u, client_stats.packets_lost); | 2929 EXPECT_EQ(0u, client_stats.packets_lost); |
| 2927 EXPECT_EQ(1, client_->client()->GetNumSentClientHellos()); | 2930 EXPECT_EQ(1, client_->client()->GetNumSentClientHellos()); |
| 2928 } | 2931 } |
| 2929 | 2932 |
| 2930 } // namespace | 2933 } // namespace |
| 2931 } // namespace test | 2934 } // namespace test |
| 2932 } // namespace net | 2935 } // namespace net |
| OLD | NEW |