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 "media/blink/webmediaplayer_impl.h" | 5 #include "media/blink/webmediaplayer_impl.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 client_.set_is_autoplaying_muted(true); | 726 client_.set_is_autoplaying_muted(true); |
727 | 727 |
728 EXPECT_CALL(delegate_, DidPlay(_, true, false, _)); | 728 EXPECT_CALL(delegate_, DidPlay(_, true, false, _)); |
729 SetDelegateState(WebMediaPlayerImpl::DelegateState::PLAYING); | 729 SetDelegateState(WebMediaPlayerImpl::DelegateState::PLAYING); |
730 | 730 |
731 client_.set_is_autoplaying_muted(false); | 731 client_.set_is_autoplaying_muted(false); |
732 EXPECT_CALL(delegate_, DidPlay(_, true, true, _)); | 732 EXPECT_CALL(delegate_, DidPlay(_, true, true, _)); |
733 wmpi_->SetVolume(1.0); | 733 wmpi_->SetVolume(1.0); |
734 } | 734 } |
735 | 735 |
| 736 TEST_F(WebMediaPlayerImplTest, NoStreams) { |
| 737 InitializeWebMediaPlayerImpl(true); |
| 738 PipelineMetadata metadata; |
| 739 |
| 740 // Nothing should happen. In particular, no assertions should fail. |
| 741 OnMetadata(metadata); |
| 742 } |
| 743 |
736 TEST_F(WebMediaPlayerImplTest, NaturalSizeChange) { | 744 TEST_F(WebMediaPlayerImplTest, NaturalSizeChange) { |
737 InitializeWebMediaPlayerImpl(true); | 745 InitializeWebMediaPlayerImpl(true); |
738 PipelineMetadata metadata; | 746 PipelineMetadata metadata; |
739 metadata.has_video = true; | 747 metadata.has_video = true; |
740 metadata.natural_size = gfx::Size(320, 240); | 748 metadata.natural_size = gfx::Size(320, 240); |
741 | 749 |
742 OnMetadata(metadata); | 750 OnMetadata(metadata); |
743 ASSERT_EQ(blink::WebSize(320, 240), wmpi_->NaturalSize()); | 751 ASSERT_EQ(blink::WebSize(320, 240), wmpi_->NaturalSize()); |
744 | 752 |
745 // TODO(sandersd): Verify that the client is notified of the size change? | 753 // TODO(sandersd): Verify that the client is notified of the size change? |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
994 WebMediaPlayerImplBackgroundBehaviorTest, | 1002 WebMediaPlayerImplBackgroundBehaviorTest, |
995 ::testing::Combine(::testing::Bool(), | 1003 ::testing::Combine(::testing::Bool(), |
996 ::testing::Bool(), | 1004 ::testing::Bool(), |
997 ::testing::Values(5, 300), | 1005 ::testing::Values(5, 300), |
998 ::testing::Values(5, 100), | 1006 ::testing::Values(5, 100), |
999 ::testing::Bool(), | 1007 ::testing::Bool(), |
1000 ::testing::Bool(), | 1008 ::testing::Bool(), |
1001 ::testing::Bool())); | 1009 ::testing::Bool())); |
1002 | 1010 |
1003 } // namespace media | 1011 } // namespace media |
OLD | NEW |