зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1632317 - part2 : remove improper tests. r=bryce
This patch will do : - remove tests which are not correct based on new implementation. --- More details about this change : After calling controller's methods, the controller's state won't be changed, it would be changed after the amount of playing media changes, which are depending on other modules and can't be tested here. - `ChangePlayingStateViaPlayPauseStop` would check state after calling controller's method, which is incorrect. - `AlwaysInaudibleIfControllerIsNotPlaying` would check audible which also references to controller's state Differential Revision: https://phabricator.services.mozilla.com/D72088
This commit is contained in:
Родитель
ad5bf1e7aa
Коммит
91cdddb2cb
|
@ -66,45 +66,6 @@ TEST(MediaController, AudibleChanged)
|
|||
ASSERT_TRUE(!controller->IsAudible());
|
||||
}
|
||||
|
||||
TEST(MediaController, AlwaysInaudibleIfControllerIsNotPlaying)
|
||||
{
|
||||
RefPtr<MediaController> controller = new MediaController(CONTROLLER_ID);
|
||||
ASSERT_TRUE(!controller->IsAudible());
|
||||
|
||||
controller->NotifyMediaAudibleChanged(MediaAudibleState::eAudible);
|
||||
ASSERT_TRUE(!controller->IsAudible());
|
||||
|
||||
controller->Play();
|
||||
ASSERT_TRUE(controller->IsAudible());
|
||||
|
||||
controller->Pause();
|
||||
ASSERT_TRUE(!controller->IsAudible());
|
||||
|
||||
controller->Play();
|
||||
ASSERT_TRUE(controller->IsAudible());
|
||||
|
||||
controller->Stop();
|
||||
ASSERT_TRUE(!controller->IsAudible());
|
||||
}
|
||||
|
||||
TEST(MediaController, ChangePlayingStateViaPlayPauseStop)
|
||||
{
|
||||
RefPtr<MediaController> controller = new MediaController(CONTROLLER_ID);
|
||||
ASSERT_TRUE(controller->GetState() == MediaSessionPlaybackState::None);
|
||||
|
||||
controller->Play();
|
||||
ASSERT_TRUE(controller->GetState() == MediaSessionPlaybackState::Playing);
|
||||
|
||||
controller->Pause();
|
||||
ASSERT_TRUE(controller->GetState() == MediaSessionPlaybackState::Paused);
|
||||
|
||||
controller->Play();
|
||||
ASSERT_TRUE(controller->GetState() == MediaSessionPlaybackState::Playing);
|
||||
|
||||
controller->Stop();
|
||||
ASSERT_TRUE(controller->GetState() == MediaSessionPlaybackState::None);
|
||||
}
|
||||
|
||||
class FakeControlledMedia final {
|
||||
public:
|
||||
explicit FakeControlledMedia(MediaController* aController)
|
||||
|
|
Загрузка…
Ссылка в новой задаче