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

Side by Side Diff: media/mojo/clients/mojo_renderer_unittest.cc

Issue 2276663003: Fix DCHECK in MojoRendererService::SetPlaybackRate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unit test Created 4 years, 3 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 | « no previous file | media/mojo/services/mojo_renderer_service.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 EXPECT_CALL(*mock_renderer_, Flush(_)).WillRepeatedly(RunClosure<0>()); 372 EXPECT_CALL(*mock_renderer_, Flush(_)).WillRepeatedly(RunClosure<0>());
373 EXPECT_CALL(*this, OnFlushed()); 373 EXPECT_CALL(*this, OnFlushed());
374 mojo_renderer_->Flush( 374 mojo_renderer_->Flush(
375 base::Bind(&MojoRendererTest::OnFlushed, base::Unretained(this))); 375 base::Bind(&MojoRendererTest::OnFlushed, base::Unretained(this)));
376 Destroy(); 376 Destroy();
377 } 377 }
378 378
379 // TODO(xhwang): Add more tests on OnError. For example, ErrorDuringFlush, 379 // TODO(xhwang): Add more tests on OnError. For example, ErrorDuringFlush,
380 // ErrorAfterFlush etc. 380 // ErrorAfterFlush etc.
381 381
382 TEST_F(MojoRendererTest, ErrorDuringPlayback) {
383 Initialize();
384
385 EXPECT_CALL(renderer_client_, OnError(PIPELINE_ERROR_DECODE)).Times(1);
386
387 Play();
388 remote_renderer_client_->OnError(PIPELINE_ERROR_DECODE);
389 base::RunLoop().RunUntilIdle();
390
391 EXPECT_CALL(*mock_renderer_, SetPlaybackRate(0.0)).Times(1);
392 mojo_renderer_->SetPlaybackRate(0.0);
393 Flush();
394 }
395
382 } // namespace media 396 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/mojo/services/mojo_renderer_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698