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

Side by Side Diff: media/filters/ffmpeg_demuxer_unittest.cc

Issue 2840593002: Remove usage of ScopedTaskScheduler. (Closed)
Patch Set: rebase Created 3 years, 7 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) 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <deque> 9 #include <deque>
10 #include <string> 10 #include <string>
11 11
12 #include "base/bind.h" 12 #include "base/bind.h"
13 #include "base/files/file_path.h" 13 #include "base/files/file_path.h"
14 #include "base/location.h" 14 #include "base/location.h"
15 #include "base/logging.h" 15 #include "base/logging.h"
16 #include "base/macros.h" 16 #include "base/macros.h"
17 #include "base/path_service.h" 17 #include "base/path_service.h"
18 #include "base/run_loop.h" 18 #include "base/run_loop.h"
19 #include "base/single_thread_task_runner.h" 19 #include "base/single_thread_task_runner.h"
20 #include "base/test/mock_callback.h" 20 #include "base/test/mock_callback.h"
21 #include "base/test/scoped_task_scheduler.h" 21 #include "base/test/scoped_task_environment.h"
22 #include "base/threading/thread.h" 22 #include "base/threading/thread.h"
23 #include "base/threading/thread_task_runner_handle.h" 23 #include "base/threading/thread_task_runner_handle.h"
24 #include "media/base/decrypt_config.h" 24 #include "media/base/decrypt_config.h"
25 #include "media/base/media_log.h" 25 #include "media/base/media_log.h"
26 #include "media/base/media_tracks.h" 26 #include "media/base/media_tracks.h"
27 #include "media/base/mock_demuxer_host.h" 27 #include "media/base/mock_demuxer_host.h"
28 #include "media/base/test_helpers.h" 28 #include "media/base/test_helpers.h"
29 #include "media/base/timestamp_constants.h" 29 #include "media/base/timestamp_constants.h"
30 #include "media/ffmpeg/ffmpeg_common.h" 30 #include "media/ffmpeg/ffmpeg_common.h"
31 #include "media/filters/ffmpeg_demuxer.h" 31 #include "media/filters/ffmpeg_demuxer.h"
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 272
273 // Accessor to demuxer internals. 273 // Accessor to demuxer internals.
274 void SetDurationKnown(bool duration_known) { 274 void SetDurationKnown(bool duration_known) {
275 demuxer_->duration_known_ = duration_known; 275 demuxer_->duration_known_ = duration_known;
276 if (!duration_known) 276 if (!duration_known)
277 demuxer_->duration_ = kInfiniteDuration; 277 demuxer_->duration_ = kInfiniteDuration;
278 } 278 }
279 279
280 // Fixture members. 280 // Fixture members.
281 281
282 base::test::ScopedTaskScheduler task_scheduler_; 282 base::test::ScopedTaskEnvironment scoped_task_environment_;
283 MediaLog media_log_; 283 MediaLog media_log_;
284 std::unique_ptr<FileDataSource> data_source_; 284 std::unique_ptr<FileDataSource> data_source_;
285 std::unique_ptr<FFmpegDemuxer> demuxer_; 285 std::unique_ptr<FFmpegDemuxer> demuxer_;
286 StrictMock<MockDemuxerHost> host_; 286 StrictMock<MockDemuxerHost> host_;
287 std::unique_ptr<MediaTracks> media_tracks_; 287 std::unique_ptr<MediaTracks> media_tracks_;
288 288
289 AVFormatContext* format_context() { 289 AVFormatContext* format_context() {
290 return demuxer_->glue_->format_context(); 290 return demuxer_->glue_->format_context();
291 } 291 }
292 292
(...skipping 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after
1653 // ensuring that status changes occur while an async read is pending. 1653 // ensuring that status changes occur while an async read is pending.
1654 audio_stream->FlushBuffers(); 1654 audio_stream->FlushBuffers();
1655 audio_stream->Read(base::Bind(&media::OnReadDone_ExpectEos)); 1655 audio_stream->Read(base::Bind(&media::OnReadDone_ExpectEos));
1656 CheckStreamStatusNotifications(demuxer_.get(), audio_stream); 1656 CheckStreamStatusNotifications(demuxer_.get(), audio_stream);
1657 video_stream->FlushBuffers(); 1657 video_stream->FlushBuffers();
1658 video_stream->Read(base::Bind(&media::OnReadDone_ExpectEos)); 1658 video_stream->Read(base::Bind(&media::OnReadDone_ExpectEos));
1659 CheckStreamStatusNotifications(demuxer_.get(), video_stream); 1659 CheckStreamStatusNotifications(demuxer_.get(), video_stream);
1660 } 1660 }
1661 1661
1662 } // namespace media 1662 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698