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

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

Issue 1572353002: QuicAlarms are now allocated out of an arena in QuicConnection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge recent changes. 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 | « net/quic/quic_alarm.cc ('k') | net/quic/quic_arena_scoped_ptr.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_alarm.h" 5 #include "net/quic/quic_alarm.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "testing/gmock/include/gmock/gmock.h" 8 #include "testing/gmock/include/gmock/gmock.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 using testing::Return; 11 using testing::Return;
12 using testing::Invoke; 12 using testing::Invoke;
13 13
14 namespace net { 14 namespace net {
15 namespace test { 15 namespace test {
16 namespace { 16 namespace {
17 17
18 class MockDelegate : public QuicAlarm::Delegate { 18 class MockDelegate : public QuicAlarm::Delegate {
19 public: 19 public:
20 MOCK_METHOD0(OnAlarm, QuicTime()); 20 MOCK_METHOD0(OnAlarm, QuicTime());
21 }; 21 };
22 22
23 class TestAlarm : public QuicAlarm { 23 class TestAlarm : public QuicAlarm {
24 public: 24 public:
25 explicit TestAlarm(QuicAlarm::Delegate* delegate) : QuicAlarm(delegate) {} 25 explicit TestAlarm(QuicAlarm::Delegate* delegate)
26 : QuicAlarm(QuicArenaScopedPtr<QuicAlarm::Delegate>(delegate)) {}
26 27
27 bool scheduled() const { return scheduled_; } 28 bool scheduled() const { return scheduled_; }
28 29
29 void FireAlarm() { 30 void FireAlarm() {
30 scheduled_ = false; 31 scheduled_ = false;
31 Fire(); 32 Fire();
32 } 33 }
33 34
34 protected: 35 protected:
35 void SetImpl() override { 36 void SetImpl() override {
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 Return(QuicTime::Zero()))); 132 Return(QuicTime::Zero())));
132 alarm_.FireAlarm(); 133 alarm_.FireAlarm();
133 EXPECT_TRUE(alarm_.IsSet()); 134 EXPECT_TRUE(alarm_.IsSet());
134 EXPECT_TRUE(alarm_.scheduled()); 135 EXPECT_TRUE(alarm_.scheduled());
135 EXPECT_EQ(deadline2_, alarm_.deadline()); 136 EXPECT_EQ(deadline2_, alarm_.deadline());
136 } 137 }
137 138
138 } // namespace 139 } // namespace
139 } // namespace test 140 } // namespace test
140 } // namespace net 141 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_alarm.cc ('k') | net/quic/quic_arena_scoped_ptr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698