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 #ifndef NET_SPDY_SPDY_PROTOCOL_TEST_UTILS_H_ | 5 #ifndef NET_SPDY_SPDY_PROTOCOL_TEST_UTILS_H_ |
6 #define NET_SPDY_SPDY_PROTOCOL_TEST_UTILS_H_ | 6 #define NET_SPDY_SPDY_PROTOCOL_TEST_UTILS_H_ |
7 | 7 |
8 // These functions support tests that need to compare two concrete SpdyFrameIR | 8 // These functions support tests that need to compare two concrete SpdyFrameIR |
9 // instances for equality. They return AssertionResult, so they may be used as | 9 // instances for equality. They return AssertionResult, so they may be used as |
10 // follows: | 10 // follows: |
11 // | 11 // |
12 // SomeSpdyFrameIRSubClass expected_ir(...); | 12 // SomeSpdyFrameIRSubClass expected_ir(...); |
13 // std::unique_ptr<SpdyFrameIR> collected_frame; | 13 // std::unique_ptr<SpdyFrameIR> collected_frame; |
14 // ... some test code that may fill in collected_frame ... | 14 // ... some test code that may fill in collected_frame ... |
15 // ASSERT_TRUE(VerifySpdyFrameIREquals(expected_ir, collected_frame.get())); | 15 // ASSERT_TRUE(VerifySpdyFrameIREquals(expected_ir, collected_frame.get())); |
16 // | 16 // |
17 // TODO(jamessynge): Where it makes sense in these functions, it would be nice | 17 // TODO(jamessynge): Where it makes sense in these functions, it would be nice |
18 // to make use of the existing gMock matchers here, instead of rolling our own. | 18 // to make use of the existing gMock matchers here, instead of rolling our own. |
19 | 19 |
20 #include <typeinfo> | 20 #include <typeinfo> |
21 | 21 |
22 #include "base/logging.h" | 22 #include "base/logging.h" |
23 #include "net/spdy/spdy_protocol.h" | 23 #include "net/spdy/core/spdy_protocol.h" |
24 #include "net/spdy/spdy_test_utils.h" | 24 #include "net/spdy/core/spdy_test_utils.h" |
25 #include "testing/gmock/include/gmock/gmock.h" | 25 #include "testing/gmock/include/gmock/gmock.h" |
26 | 26 |
27 namespace net { | 27 namespace net { |
28 namespace test { | 28 namespace test { |
29 | 29 |
30 // Verify the header entries in two SpdyFrameWithHeaderBlockIR instances | 30 // Verify the header entries in two SpdyFrameWithHeaderBlockIR instances |
31 // are the same. | 31 // are the same. |
32 ::testing::AssertionResult VerifySpdyFrameWithHeaderBlockIREquals( | 32 ::testing::AssertionResult VerifySpdyFrameWithHeaderBlockIREquals( |
33 const SpdyFrameWithHeaderBlockIR& expected, | 33 const SpdyFrameWithHeaderBlockIR& expected, |
34 const SpdyFrameWithHeaderBlockIR& actual); | 34 const SpdyFrameWithHeaderBlockIR& actual); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 ::testing::AssertionResult VerifySpdyFrameIREquals(const E& expected, | 150 ::testing::AssertionResult VerifySpdyFrameIREquals(const E& expected, |
151 const SpdyFrameIR* actual) { | 151 const SpdyFrameIR* actual) { |
152 DVLOG(1) << "VerifySpdyFrameIREquals"; | 152 DVLOG(1) << "VerifySpdyFrameIREquals"; |
153 return VerifySpdyFrameIREquals(&expected, actual); | 153 return VerifySpdyFrameIREquals(&expected, actual); |
154 } | 154 } |
155 | 155 |
156 } // namespace test | 156 } // namespace test |
157 } // namespace net | 157 } // namespace net |
158 | 158 |
159 #endif // NET_SPDY_SPDY_PROTOCOL_TEST_UTILS_H_ | 159 #endif // NET_SPDY_SPDY_PROTOCOL_TEST_UTILS_H_ |
OLD | NEW |