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

Side by Side Diff: net/quic/quic_connection_helper_test.cc

Issue 76723002: Land Recent QUIC Changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compilation error Created 7 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 | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_connection.cc ('k') | net/quic/quic_connection_test.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) 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/quic/quic_connection_helper.h" 5 #include "net/quic/quic_connection_helper.h"
6 6
7 #include <vector>
8
9 #include "net/quic/test_tools/mock_clock.h" 7 #include "net/quic/test_tools/mock_clock.h"
10 #include "net/quic/test_tools/mock_random.h" 8 #include "net/quic/test_tools/mock_random.h"
11 #include "net/quic/test_tools/test_task_runner.h" 9 #include "net/quic/test_tools/test_task_runner.h"
12 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
13 11
14 namespace net { 12 namespace net {
15 namespace test { 13 namespace test {
14 namespace {
16 15
17 class TestDelegate : public QuicAlarm::Delegate { 16 class TestDelegate : public QuicAlarm::Delegate {
18 public: 17 public:
19 TestDelegate() : fired_(false) {} 18 TestDelegate() : fired_(false) {}
20 19
21 virtual QuicTime OnAlarm() OVERRIDE { 20 virtual QuicTime OnAlarm() OVERRIDE {
22 fired_ = true; 21 fired_ = true;
23 return QuicTime::Zero(); 22 return QuicTime::Zero();
24 } 23 }
25 24
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 // The latter task is still posted. 134 // The latter task is still posted.
136 ASSERT_EQ(1u, runner_->GetPostedTasks().size()); 135 ASSERT_EQ(1u, runner_->GetPostedTasks().size());
137 136
138 // When the latter task is executed, the weak ptr will be invalid and 137 // When the latter task is executed, the weak ptr will be invalid and
139 // the alarm will not fire. 138 // the alarm will not fire.
140 runner_->RunNextTask(); 139 runner_->RunNextTask();
141 EXPECT_EQ(QuicTime::Zero().Add(delta), clock_.Now()); 140 EXPECT_EQ(QuicTime::Zero().Add(delta), clock_.Now());
142 EXPECT_FALSE(delegate->fired()); 141 EXPECT_FALSE(delegate->fired());
143 } 142 }
144 143
144 } // namespace
145 } // namespace test 145 } // namespace test
146 } // namespace net 146 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_connection.cc ('k') | net/quic/quic_connection_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698