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

Side by Side Diff: net/quic/core/packet_number_indexed_queue_test.cc

Issue 2901773004: Landing Recent QUIC changes until May 20, 2017. (Closed)
Patch Set: Disable quic_restart_flag_quic_big_endian_connection_id_server until tests can be fixed. Created 3 years, 7 months 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
« no previous file with comments | « net/quic/core/packet_number_indexed_queue.h ('k') | net/quic/core/quic_connection.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2017 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/core/packet_number_indexed_queue.h" 5 #include "net/quic/core/packet_number_indexed_queue.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 ASSERT_FALSE(queue_.Remove(1002)); 162 ASSERT_FALSE(queue_.Remove(1002));
163 } 163 }
164 164
165 TEST_F(PacketNumberIndexedQueueTest, FailToRemoveElementsTwice) { 165 TEST_F(PacketNumberIndexedQueueTest, FailToRemoveElementsTwice) {
166 queue_.Emplace(1001, "one"); 166 queue_.Emplace(1001, "one");
167 ASSERT_TRUE(queue_.Remove(1001)); 167 ASSERT_TRUE(queue_.Remove(1001));
168 ASSERT_FALSE(queue_.Remove(1001)); 168 ASSERT_FALSE(queue_.Remove(1001));
169 ASSERT_FALSE(queue_.Remove(1001)); 169 ASSERT_FALSE(queue_.Remove(1001));
170 } 170 }
171 171
172 TEST_F(PacketNumberIndexedQueueTest, ConstGetter) {
173 queue_.Emplace(1001, "one");
174 const auto& const_queue = queue_;
175
176 EXPECT_EQ("one", *const_queue.GetEntry(1001));
177 EXPECT_EQ(nullptr, const_queue.GetEntry(1002));
178 }
179
172 } // namespace 180 } // namespace
173 } // namespace net 181 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/packet_number_indexed_queue.h ('k') | net/quic/core/quic_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698