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

Side by Side Diff: chromecast/media/cma/backend/audio_video_pipeline_device_unittest.cc

Issue 1474573002: [Chromecast] Ignore MonitorLoop if EOS in unit test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « no previous file | no next file » | 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 <vector> 5 #include <vector>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 return; 369 return;
370 370
371 base::ThreadTaskRunnerHandle::Get()->PostTask( 371 base::ThreadTaskRunnerHandle::Get()->PostTask(
372 FROM_HERE, 372 FROM_HERE,
373 base::Bind(&AudioVideoPipelineDeviceTest::FeedVideoBuffer, 373 base::Bind(&AudioVideoPipelineDeviceTest::FeedVideoBuffer,
374 base::Unretained(this))); 374 base::Unretained(this)));
375 } 375 }
376 } 376 }
377 377
378 void AudioVideoPipelineDeviceTest::MonitorLoop() { 378 void AudioVideoPipelineDeviceTest::MonitorLoop() {
379 // Backend is stopped, no need to monitor the loop any more.
380 if (audio_decoder_ == nullptr && video_decoder_ == nullptr)
381 return;
382
379 base::TimeDelta media_time = 383 base::TimeDelta media_time =
380 base::TimeDelta::FromMicroseconds(backend_->GetCurrentPts()); 384 base::TimeDelta::FromMicroseconds(backend_->GetCurrentPts());
381 385
382 if (!pause_pattern_.empty() && 386 if (!pause_pattern_.empty() &&
383 pause_pattern_[pause_pattern_idx_].delay >= base::TimeDelta() && 387 pause_pattern_[pause_pattern_idx_].delay >= base::TimeDelta() &&
384 media_time >= pause_time_ + pause_pattern_[pause_pattern_idx_].delay) { 388 media_time >= pause_time_ + pause_pattern_[pause_pattern_idx_].delay) {
385 // Do Pause 389 // Do Pause
386 backend_->Pause(); 390 backend_->Pause();
387 pause_time_ = base::TimeDelta::FromMicroseconds(backend_->GetCurrentPts()); 391 pause_time_ = base::TimeDelta::FromMicroseconds(backend_->GetCurrentPts());
388 392
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 TEST_F(AudioVideoPipelineDeviceTest, WebmPlayback) { 488 TEST_F(AudioVideoPipelineDeviceTest, WebmPlayback) {
485 scoped_ptr<base::MessageLoop> message_loop(new base::MessageLoop()); 489 scoped_ptr<base::MessageLoop> message_loop(new base::MessageLoop());
486 490
487 ConfigureForFile("bear-640x360.webm"); 491 ConfigureForFile("bear-640x360.webm");
488 Start(); 492 Start();
489 message_loop->Run(); 493 message_loop->Run();
490 } 494 }
491 495
492 } // namespace media 496 } // namespace media
493 } // namespace chromecast 497 } // namespace chromecast
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698