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

Side by Side Diff: content/renderer/media/render_media_log_unittest.cc

Issue 2645953004: Update duration when demuxed packets exceed known duration. (Closed)
Patch Set: Remove broken CGI server. Rate limit duration changed events. Created 3 years, 10 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
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 <tuple> 5 #include <tuple>
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/test/simple_test_tick_clock.h" 8 #include "base/test/simple_test_tick_clock.h"
9 #include "base/test/test_mock_time_task_runner.h" 9 #include "base/test/test_mock_time_task_runner.h"
10 #include "content/common/view_messages.h" 10 #include "content/common/view_messages.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 116
117 // Verify contents. There should only be a single buffered extents changed 117 // Verify contents. There should only be a single buffered extents changed
118 // event. 118 // event.
119 std::vector<media::MediaLogEvent> events = GetMediaLogEvents(); 119 std::vector<media::MediaLogEvent> events = GetMediaLogEvents();
120 ASSERT_EQ(3u, events.size()); 120 ASSERT_EQ(3u, events.size());
121 EXPECT_EQ(media::MediaLogEvent::LOAD, events[0].type); 121 EXPECT_EQ(media::MediaLogEvent::LOAD, events[0].type);
122 EXPECT_EQ(media::MediaLogEvent::SEEK, events[1].type); 122 EXPECT_EQ(media::MediaLogEvent::SEEK, events[1].type);
123 EXPECT_EQ(media::MediaLogEvent::BUFFERED_EXTENTS_CHANGED, events[2].type); 123 EXPECT_EQ(media::MediaLogEvent::BUFFERED_EXTENTS_CHANGED, events[2].type);
124 } 124 }
125 125
126 TEST_F(RenderMediaLogTest, DurationChanged) {
127 AddEvent(media::MediaLogEvent::LOAD);
128 AddEvent(media::MediaLogEvent::SEEK);
129
130 // This event is handled separately and should always appear last regardless
131 // of how many times we see it.
132 AddEvent(media::MediaLogEvent::DURATION_SET);
133 AddEvent(media::MediaLogEvent::DURATION_SET);
134 AddEvent(media::MediaLogEvent::DURATION_SET);
135
136 EXPECT_EQ(0, message_count());
137 Advance(base::TimeDelta::FromMilliseconds(1000));
138 EXPECT_EQ(1, message_count());
139
140 // Verify contents. There should only be a single buffered extents changed
141 // event.
142 std::vector<media::MediaLogEvent> events = GetMediaLogEvents();
143 ASSERT_EQ(3u, events.size());
144 EXPECT_EQ(media::MediaLogEvent::LOAD, events[0].type);
145 EXPECT_EQ(media::MediaLogEvent::SEEK, events[1].type);
146 EXPECT_EQ(media::MediaLogEvent::DURATION_SET, events[2].type);
147 }
148
126 } // namespace content 149 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698