| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "net/quic/quic_client_push_promise_index.h" | 5 #include "net/quic/quic_client_push_promise_index.h" |
| 6 | 6 |
| 7 #include "net/quic/spdy_utils.h" | 7 #include "net/quic/spdy_utils.h" |
| 8 #include "net/quic/test_tools/crypto_test_utils.h" | 8 #include "net/quic/test_tools/crypto_test_utils.h" |
| 9 #include "net/quic/test_tools/mock_quic_client_promised_info.h" | 9 #include "net/quic/test_tools/mock_quic_client_promised_info.h" |
| 10 #include "net/quic/test_tools/quic_test_utils.h" | 10 #include "net/quic/test_tools/quic_test_utils.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 (*index_.promised_by_url())[url_] = &promised_; | 83 (*index_.promised_by_url())[url_] = &promised_; |
| 84 EXPECT_CALL(promised_, HandleClientRequest(_, _)) | 84 EXPECT_CALL(promised_, HandleClientRequest(_, _)) |
| 85 .WillOnce(Return(QUIC_FAILURE)); | 85 .WillOnce(Return(QUIC_FAILURE)); |
| 86 EXPECT_EQ(index_.Try(request_, nullptr, &handle_), QUIC_FAILURE); | 86 EXPECT_EQ(index_.Try(request_, nullptr, &handle_), QUIC_FAILURE); |
| 87 } | 87 } |
| 88 | 88 |
| 89 TEST_F(QuicClientPushPromiseIndexTest, TryNoPromise) { | 89 TEST_F(QuicClientPushPromiseIndexTest, TryNoPromise) { |
| 90 EXPECT_EQ(index_.Try(request_, nullptr, &handle_), QUIC_FAILURE); | 90 EXPECT_EQ(index_.Try(request_, nullptr, &handle_), QUIC_FAILURE); |
| 91 } | 91 } |
| 92 | 92 |
| 93 TEST_F(QuicClientPushPromiseIndexTest, GetNoPromise) { |
| 94 EXPECT_EQ(index_.GetPromised(url_), nullptr); |
| 95 } |
| 96 |
| 97 TEST_F(QuicClientPushPromiseIndexTest, GetPromise) { |
| 98 (*index_.promised_by_url())[url_] = &promised_; |
| 99 EXPECT_EQ(index_.GetPromised(url_), &promised_); |
| 100 } |
| 101 |
| 93 } // namespace | 102 } // namespace |
| 94 } // namespace test | 103 } // namespace test |
| 95 } // namespace net | 104 } // namespace net |
| OLD | NEW |