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

Side by Side Diff: media/cast/net/pacing/paced_sender_unittest.cc

Issue 1273313003: clang: Enable -Wfor-loop-analysis. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: back to only -Wfor Created 4 years, 11 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 | « build/config/compiler/BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <list> 8 #include <list>
9 9
10 #include "base/big_endian.h" 10 #include "base/big_endian.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 } 112 }
113 113
114 // Use this function to drain the packet list in PacedSender without having 114 // Use this function to drain the packet list in PacedSender without having
115 // to test the pacing implementation details. 115 // to test the pacing implementation details.
116 bool RunUntilEmpty(int max_tries) { 116 bool RunUntilEmpty(int max_tries) {
117 for (int i = 0; i < max_tries; i++) { 117 for (int i = 0; i < max_tries; i++) {
118 testing_clock_.Advance(base::TimeDelta::FromMilliseconds(10)); 118 testing_clock_.Advance(base::TimeDelta::FromMilliseconds(10));
119 task_runner_->RunTasks(); 119 task_runner_->RunTasks();
120 if (mock_transport_.expected_packet_size_.empty()) 120 if (mock_transport_.expected_packet_size_.empty())
121 return true; 121 return true;
122 i++;
123 } 122 }
124 123
125 return mock_transport_.expected_packet_size_.empty(); 124 return mock_transport_.expected_packet_size_.empty();
126 } 125 }
127 126
128 std::vector<PacketEvent> packet_events_; 127 std::vector<PacketEvent> packet_events_;
129 base::SimpleTestTickClock testing_clock_; 128 base::SimpleTestTickClock testing_clock_;
130 TestPacketSender mock_transport_; 129 TestPacketSender mock_transport_;
131 scoped_refptr<test::FakeSingleThreadTaskRunner> task_runner_; 130 scoped_refptr<test::FakeSingleThreadTaskRunner> task_runner_;
132 scoped_ptr<PacedSender> paced_sender_; 131 scoped_ptr<PacedSender> paced_sender_;
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 EXPECT_TRUE(paced_sender_->ResendPackets(packets, dedup_info)); 457 EXPECT_TRUE(paced_sender_->ResendPackets(packets, dedup_info));
459 EXPECT_EQ(static_cast<int64_t>(kSize1), mock_transport_.GetBytesSent()); 458 EXPECT_EQ(static_cast<int64_t>(kSize1), mock_transport_.GetBytesSent());
460 459
461 dedup_info.resend_interval = base::TimeDelta::FromMilliseconds(5); 460 dedup_info.resend_interval = base::TimeDelta::FromMilliseconds(5);
462 EXPECT_TRUE(paced_sender_->ResendPackets(packets, dedup_info)); 461 EXPECT_TRUE(paced_sender_->ResendPackets(packets, dedup_info));
463 EXPECT_EQ(static_cast<int64_t>(2 * kSize1), mock_transport_.GetBytesSent()); 462 EXPECT_EQ(static_cast<int64_t>(2 * kSize1), mock_transport_.GetBytesSent());
464 } 463 }
465 464
466 } // namespace cast 465 } // namespace cast
467 } // namespace media 466 } // namespace media
OLDNEW
« no previous file with comments | « build/config/compiler/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698