| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |