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

Side by Side Diff: net/tools/quic/quic_epoll_alarm_factory_test.cc

Issue 1918953003: Landing Recent QUIC changes until 4/22/2016 14:55 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Deleted SpdyFramerTests missed while mergeing 120451808 Created 4 years, 8 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/tools/quic/quic_dispatcher.cc ('k') | net/tools/quic/quic_epoll_connection_helper_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) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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/tools/quic/quic_epoll_alarm_factory.h" 5 #include "net/tools/quic/quic_epoll_alarm_factory.h"
6
7 #include "net/tools/quic/quic_epoll_clock.h"
6 #include "net/tools/quic/test_tools/mock_epoll_server.h" 8 #include "net/tools/quic/test_tools/mock_epoll_server.h"
7 #include "testing/base/public/gmock.h" 9 #include "testing/gtest/include/gtest/gtest.h"
8 #include "testing/base/public/gunit.h"
9 10
10 namespace net { 11 namespace net {
11 namespace test { 12 namespace test {
12 namespace { 13 namespace {
13 14
15 class TestDelegate : public QuicAlarm::Delegate {
16 public:
17 TestDelegate() : fired_(false) {}
18
19 void OnAlarm() override { fired_ = true; }
20
21 bool fired() const { return fired_; }
22
23 private:
24 bool fired_;
25 };
26
14 // The boolean parameter denotes whether or not to use an arena. 27 // The boolean parameter denotes whether or not to use an arena.
15 class QuicEpollAlarmFactoryTest : public ::testing::TestWithParam<bool> { 28 class QuicEpollAlarmFactoryTest : public ::testing::TestWithParam<bool> {
16 protected: 29 protected:
17 QuicEpollAlarmFactoryTest() 30 QuicEpollAlarmFactoryTest()
18 : clock_(&epoll_server_), alarm_factory_(&epoll_server_) {} 31 : clock_(&epoll_server_), alarm_factory_(&epoll_server_) {}
19 32
20 QuicConnectionArena* GetArenaParam() { 33 QuicConnectionArena* GetArenaParam() {
21 return GetParam() ? &arena_ : nullptr; 34 return GetParam() ? &arena_ : nullptr;
22 } 35 }
23 36
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 EXPECT_TRUE(alarm->IsSet()); 130 EXPECT_TRUE(alarm->IsSet());
118 131
119 // Update it with an uninitialized time and ensure it's cancelled. 132 // Update it with an uninitialized time and ensure it's cancelled.
120 alarm->Update(QuicTime::Zero(), QuicTime::Delta::FromMicroseconds(1)); 133 alarm->Update(QuicTime::Zero(), QuicTime::Delta::FromMicroseconds(1));
121 EXPECT_FALSE(alarm->IsSet()); 134 EXPECT_FALSE(alarm->IsSet());
122 } 135 }
123 136
124 } // namespace 137 } // namespace
125 } // namespace test 138 } // namespace test
126 } // namespace net 139 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_dispatcher.cc ('k') | net/tools/quic/quic_epoll_connection_helper_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698