| 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 "net/spdy/spdy_test_utils.h" | 5 #include "net/spdy/spdy_test_utils.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cstring> | 8 #include <cstring> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 if (identical) return; | 87 if (identical) return; |
| 88 ADD_FAILURE() | 88 ADD_FAILURE() |
| 89 << "Description:\n" | 89 << "Description:\n" |
| 90 << description | 90 << description |
| 91 << "\n\nExpected:\n" | 91 << "\n\nExpected:\n" |
| 92 << HexDumpWithMarks(expected, expected_len, marks.get(), max_len) | 92 << HexDumpWithMarks(expected, expected_len, marks.get(), max_len) |
| 93 << "\nActual:\n" | 93 << "\nActual:\n" |
| 94 << HexDumpWithMarks(actual, actual_len, marks.get(), max_len); | 94 << HexDumpWithMarks(actual, actual_len, marks.get(), max_len); |
| 95 } | 95 } |
| 96 | 96 |
| 97 void SetFrameFlags(SpdySerializedFrame* frame, | 97 void SetFrameFlags(SpdySerializedFrame* frame, uint8_t flags) { |
| 98 uint8_t flags, | |
| 99 SpdyMajorVersion spdy_version) { | |
| 100 frame->data()[4] = flags; | 98 frame->data()[4] = flags; |
| 101 } | 99 } |
| 102 | 100 |
| 103 void SetFrameLength(SpdySerializedFrame* frame, | 101 void SetFrameLength(SpdySerializedFrame* frame, size_t length) { |
| 104 size_t length, | |
| 105 SpdyMajorVersion spdy_version) { | |
| 106 CHECK_GT(1u << 14, length); | 102 CHECK_GT(1u << 14, length); |
| 107 { | 103 { |
| 108 int32_t wire_length = base::HostToNet32(length); | 104 int32_t wire_length = base::HostToNet32(length); |
| 109 memcpy(frame->data(), reinterpret_cast<char*>(&wire_length) + 1, 3); | 105 memcpy(frame->data(), reinterpret_cast<char*>(&wire_length) + 1, 3); |
| 110 } | 106 } |
| 111 } | 107 } |
| 112 | 108 |
| 113 string a2b_hex(const char* hex_data) { | 109 string a2b_hex(const char* hex_data) { |
| 114 std::vector<uint8_t> output; | 110 std::vector<uint8_t> output; |
| 115 string result; | 111 string result; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 bool TestServerPushDelegate::CancelPush(GURL url) { | 175 bool TestServerPushDelegate::CancelPush(GURL url) { |
| 180 auto itr = push_helpers.find(url); | 176 auto itr = push_helpers.find(url); |
| 181 DCHECK(itr != push_helpers.end()); | 177 DCHECK(itr != push_helpers.end()); |
| 182 itr->second->Cancel(); | 178 itr->second->Cancel(); |
| 183 push_helpers.erase(itr); | 179 push_helpers.erase(itr); |
| 184 return true; | 180 return true; |
| 185 } | 181 } |
| 186 | 182 |
| 187 } // namespace test | 183 } // namespace test |
| 188 } // namespace net | 184 } // namespace net |
| OLD | NEW |