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

Side by Side Diff: media/cast/rtcp/sender_rtcp_event_subscriber_unittest.cc

Issue 210303003: Cast: Remove LoggingStats in favor of event subscribers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile Created 6 years, 9 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 | « media/cast/rtcp/rtcp_unittest.cc ('k') | media/cast/test/encode_decode_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 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 "base/memory/ref_counted.h" 5 #include "base/memory/ref_counted.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/test/simple_test_tick_clock.h" 7 #include "base/test/simple_test_tick_clock.h"
8 #include "base/time/tick_clock.h" 8 #include "base/time/tick_clock.h"
9 #include "media/cast/cast_environment.h" 9 #include "media/cast/cast_environment.h"
10 #include "media/cast/logging/logging_defines.h" 10 #include "media/cast/logging/logging_defines.h"
(...skipping 12 matching lines...) Expand all
23 23
24 class SenderRtcpEventSubscriberTest : public ::testing::Test { 24 class SenderRtcpEventSubscriberTest : public ::testing::Test {
25 protected: 25 protected:
26 SenderRtcpEventSubscriberTest() 26 SenderRtcpEventSubscriberTest()
27 : testing_clock_(new base::SimpleTestTickClock()), 27 : testing_clock_(new base::SimpleTestTickClock()),
28 task_runner_(new test::FakeSingleThreadTaskRunner(testing_clock_)), 28 task_runner_(new test::FakeSingleThreadTaskRunner(testing_clock_)),
29 cast_environment_(new CastEnvironment( 29 cast_environment_(new CastEnvironment(
30 scoped_ptr<base::TickClock>(testing_clock_).Pass(), 30 scoped_ptr<base::TickClock>(testing_clock_).Pass(),
31 task_runner_, 31 task_runner_,
32 task_runner_, 32 task_runner_,
33 task_runner_, 33 task_runner_)),
34 GetLoggingConfigWithRawEventsAndStatsEnabled())),
35 event_subscriber_(kMaxEventEntries) { 34 event_subscriber_(kMaxEventEntries) {
36 cast_environment_->Logging()->AddRawEventSubscriber(&event_subscriber_); 35 cast_environment_->Logging()->AddRawEventSubscriber(&event_subscriber_);
37 } 36 }
38 37
39 virtual ~SenderRtcpEventSubscriberTest() { 38 virtual ~SenderRtcpEventSubscriberTest() {
40 cast_environment_->Logging()->RemoveRawEventSubscriber(&event_subscriber_); 39 cast_environment_->Logging()->RemoveRawEventSubscriber(&event_subscriber_);
41 } 40 }
42 41
43 base::SimpleTestTickClock* testing_clock_; // Owned by CastEnvironment. 42 base::SimpleTestTickClock* testing_clock_; // Owned by CastEnvironment.
44 scoped_refptr<test::FakeSingleThreadTaskRunner> task_runner_; 43 scoped_refptr<test::FakeSingleThreadTaskRunner> task_runner_;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 event_subscriber_.GetRtcpEventsAndReset(&events); 111 event_subscriber_.GetRtcpEventsAndReset(&events);
113 112
114 // Event with RTP timestamp 10 should have been dropped when 110 is inserted. 113 // Event with RTP timestamp 10 should have been dropped when 110 is inserted.
115 ASSERT_EQ(10u, events.size()); 114 ASSERT_EQ(10u, events.size());
116 EXPECT_EQ(20u, events.begin()->first); 115 EXPECT_EQ(20u, events.begin()->first);
117 EXPECT_EQ(110u, events.rbegin()->first); 116 EXPECT_EQ(110u, events.rbegin()->first);
118 } 117 }
119 118
120 } // namespace cast 119 } // namespace cast
121 } // namespace media 120 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/rtcp/rtcp_unittest.cc ('k') | media/cast/test/encode_decode_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698