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

Side by Side Diff: net/quic/test_tools/quic_test_utils.h

Issue 2462823002: Deletes dead code. (Closed)
Patch Set: Updated patchset dependency Created 4 years, 1 month 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
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 // Common utilities for Quic tests 5 // Common utilities for Quic tests
6 6
7 #ifndef NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ 7 #ifndef NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_
8 #define NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ 8 #define NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_
9 9
10 #include <stddef.h> 10 #include <stddef.h>
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after
1040 // underflow. 1040 // underflow.
1041 ASSERT_LE(relative_margin, 1); 1041 ASSERT_LE(relative_margin, 1);
1042 ASSERT_GE(relative_margin, 0); 1042 ASSERT_GE(relative_margin, 0);
1043 1043
1044 T absolute_margin = expected * relative_margin; 1044 T absolute_margin = expected * relative_margin;
1045 1045
1046 EXPECT_GE(expected + absolute_margin, actual); 1046 EXPECT_GE(expected + absolute_margin, actual);
1047 EXPECT_LE(expected - absolute_margin, actual); 1047 EXPECT_LE(expected - absolute_margin, actual);
1048 } 1048 }
1049 1049
1050 template <typename T>
1051 QuicHeaderList AsHeaderList(const T& container) {
1052 QuicHeaderList l;
1053 l.OnHeaderBlockStart();
1054 size_t total_size = 0;
1055 for (auto p : container) {
1056 total_size += p.first.size() + p.second.size();
1057 l.OnHeader(p.first, p.second);
1058 }
1059 l.OnHeaderBlockEnd(total_size);
1060 return l;
1061 }
1062
1050 } // namespace test 1063 } // namespace test
1051 } // namespace net 1064 } // namespace net
1052 1065
1053 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ 1066 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « net/quic/test_tools/mock_quic_spdy_client_stream.h ('k') | net/tools/quic/quic_client_session_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698