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:
alwu 2020-04-28 05:26:49 +00:00
Родитель ad5bf1e7aa
Коммит 91cdddb2cb
1 изменённых файлов: 0 добавлений и 39 удалений

Просмотреть файл

@ -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)