提交 9927f8f8 编写于 作者: B bird_j 提交者: Gitee

ActsPlayerStateAsyncTest 刷新

Signed-off-by: Nbird_j <jianghongpeng@huawei.com>
上级 ef861739
......@@ -205,7 +205,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_0800, Func
std::shared_ptr<TestPlayerCallback> testCallback = std::make_shared<TestPlayerCallback>(&testObj);
EXPECT_EQ(RET_OK, player->SetPlayerCallback(testCallback));
ASSERT_EQ(RET_OK, player->PrepareAsync());
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_5_SEC, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_5_SEC, SEEK_MODE));
EXPECT_EQ(RET_OK, player->Play());
sleep(PLAYING_TIME);
EXPECT_TRUE(player->IsPlaying());
......@@ -242,7 +242,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_0900, Func
sleep(PLAYING_TIME);
EXPECT_TRUE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_5_SEC, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_5_SEC, SEEK_MODE));
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_NEAR(SEEK_TIME_5_SEC, time, DELTA_TIME);
......@@ -276,7 +276,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_1000, Func
sleep(PLAYING_TIME);
EXPECT_TRUE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_5_SEC, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_5_SEC, SEEK_MODE));
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_NEAR(SEEK_TIME_5_SEC, time, DELTA_TIME);
......@@ -309,7 +309,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_1100, Func
sleep(PLAYING_TIME);
EXPECT_TRUE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_5_SEC, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_5_SEC, SEEK_MODE));
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_NEAR(SEEK_TIME_5_SEC, time, DELTA_TIME);
EXPECT_EQ(RET_OK, player->Pause());
......@@ -344,7 +344,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_1200, Func
sleep(PLAYING_TIME);
EXPECT_TRUE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_5_SEC, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_5_SEC, SEEK_MODE));
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_NEAR(SEEK_TIME_5_SEC, time, DELTA_TIME);
......@@ -381,7 +381,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_1300, Func
sleep(PLAYING_TIME);
EXPECT_TRUE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_5_SEC, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_5_SEC, SEEK_MODE));
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_NEAR(SEEK_TIME_5_SEC, time, DELTA_TIME);
......@@ -419,7 +419,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_1400, Func
sleep(PLAYING_TIME);
EXPECT_TRUE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_5_SEC, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_5_SEC, SEEK_MODE));
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_NEAR(SEEK_TIME_5_SEC, time, DELTA_TIME);
......@@ -585,7 +585,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_1900, Func
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_NEAR(PLAYING_TIME * 1000, time, DELTA_TIME);
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_2_SEC, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_2_SEC, SEEK_MODE));
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_NEAR(SEEK_TIME_2_SEC, time, DELTA_TIME);
......@@ -626,7 +626,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_2000, Func
EXPECT_EQ(RET_OK, player->SetLooping(false));
EXPECT_EQ(RET_OK, player->GetDuration(durationTime));
EXPECT_EQ(RET_OK, player->Seek(durationTime + 1, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(durationTime + 1, SEEK_MODE));
EXPECT_EQ(RET_OK, testCallback->WaitForState(PLAYER_PLAYBACK_COMPLETE));
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_EQ(durationTime, time);
......@@ -662,7 +662,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_2100, Func
ASSERT_EQ(RET_OK, player->PrepareAsync());
EXPECT_EQ(RET_OK, player->SetLooping(false));
EXPECT_EQ(RET_OK, player->GetDuration(durationTime));
EXPECT_EQ(RET_OK, player->Seek(durationTime + 1, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(durationTime + 1, SEEK_MODE));
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_EQ(durationTime, time);
EXPECT_FALSE(player->IsLooping());
......@@ -704,7 +704,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_2200, Func
EXPECT_EQ(RET_OK, player->SetLooping(true));
EXPECT_EQ(RET_OK, player->GetDuration(durationTime));
EXPECT_EQ(RET_OK, player->Seek(durationTime + 1, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(durationTime + 1, SEEK_MODE));
sleep(PLAYING_TIME);
EXPECT_TRUE(player->IsLooping());
EXPECT_TRUE(player->IsPlaying());
......@@ -746,7 +746,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_2300, Func
EXPECT_EQ(RET_OK, player->SetLooping(false));
EXPECT_EQ(RET_OK, player->GetDuration(durationTime));
EXPECT_EQ(RET_OK, player->Seek(durationTime + 1, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(durationTime + 1, SEEK_MODE));
EXPECT_EQ(RET_OK, testCallback->WaitForState(PLAYER_PLAYBACK_COMPLETE));
EXPECT_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
......@@ -785,7 +785,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_2400, Func
EXPECT_TRUE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetDuration(durationTime));
EXPECT_EQ(RET_OK, player->Seek(durationTime - 1, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(durationTime - 1, SEEK_MODE));
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_NEAR(durationTime, time, DELTA_TIME);
EXPECT_EQ(RET_OK, testCallback->errorNum);
......@@ -817,7 +817,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_2500, Func
sleep(PLAYING_TIME);
EXPECT_TRUE(player->IsPlaying());
testObj.mutexFlag_ = false;
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_5_SEC, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_5_SEC, SEEK_MODE));
testObj.mutexFlag_ = true;
EXPECT_EQ(RET_OK, player->Play());
sleep(PLAYING_TIME);
......@@ -852,10 +852,10 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_2600, Func
sleep(PLAYING_TIME);
EXPECT_TRUE(player->IsPlaying());
testObj.mutexFlag_ = false;
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_2_SEC, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_2_SEC, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_2_SEC, SEEK_MODE));
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_2_SEC, SEEK_MODE));
testObj.mutexFlag_ = true;
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_5_SEC, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_5_SEC, SEEK_MODE));
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_NEAR(SEEK_TIME_5_SEC, time, DELTA_TIME);
EXPECT_EQ(RET_OK, testCallback->errorNum);
......@@ -884,7 +884,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_2625, Func
sleep(PLAYING_TIME);
EXPECT_TRUE(player->IsPlaying());
testObj.mutexFlag_ = false;
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_2_SEC, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_2_SEC, SEEK_MODE));
testObj.mutexFlag_ = true;
EXPECT_EQ(RET_OK, player->Pause());
EXPECT_EQ(RET_OK, testCallback->errorNum);
......@@ -914,7 +914,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_2650, Func
sleep(PLAYING_TIME);
EXPECT_TRUE(player->IsPlaying());
testObj.mutexFlag_ = false;
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_2_SEC, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_2_SEC, SEEK_MODE));
EXPECT_EQ(RET_OK, player->GetDuration(durationTime));
EXPECT_EQ(RET_OK, testCallback->errorNum);
}
......@@ -943,7 +943,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_2651, Func
sleep(PLAYING_TIME);
EXPECT_TRUE(player->IsPlaying());
testObj.mutexFlag_ = false;
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_2_SEC, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_2_SEC, SEEK_MODE));
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_NEAR(PLAYING_TIME * 1000, time, DELTA_TIME);
EXPECT_EQ(RET_OK, testCallback->errorNum);
......@@ -973,7 +973,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_2675, Func
sleep(PLAYING_TIME);
EXPECT_TRUE(player->IsPlaying());
testObj.mutexFlag_ = false;
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_2_SEC, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_2_SEC, SEEK_MODE));
testObj.mutexFlag_ = true;
EXPECT_EQ(RET_OK, player->Play());
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
......@@ -1003,12 +1003,12 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_2700, Func
ASSERT_EQ(RET_OK, player->PrepareAsync());
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_2_SEC, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_2_SEC, SEEK_MODE));
EXPECT_EQ(RET_OK, player->GetDuration(durationTime));
EXPECT_EQ(RET_OK, player->Seek(durationTime, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(durationTime, SEEK_MODE));
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_EQ(durationTime, time);
EXPECT_EQ(RET_OK, player->Seek(durationTime, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(durationTime, SEEK_MODE));
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_EQ(durationTime, time);
EXPECT_EQ(RET_OK, player->Play());
......@@ -1046,7 +1046,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_2800, Func
EXPECT_EQ(RET_OK, player->Pause());
EXPECT_EQ(RET_OK, player->GetDuration(durationTime));
EXPECT_EQ(RET_OK, player->Seek(durationTime, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(durationTime, SEEK_MODE));
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_EQ(durationTime, time);
EXPECT_EQ(RET_OK, player->Stop());
......@@ -1085,20 +1085,21 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_2900, Func
ASSERT_EQ(RET_OK, player->PrepareAsync());
EXPECT_EQ(RET_OK, player->SetLooping(true));
EXPECT_EQ(RET_OK, player->GetDuration(durationTime));
EXPECT_EQ(RET_OK, player->Seek(durationTime, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(durationTime, SEEK_MODE));
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_EQ(durationTime, time);
EXPECT_EQ(RET_OK, player->Play());
EXPECT_EQ(RET_OK, testCallback->WaitForState(PLAYER_PLAYBACK_COMPLETE));
EXPECT_EQ(RET_OK, player->Stop());
ASSERT_EQ(RET_OK, player->PrepareAsync());
EXPECT_EQ(RET_OK, player->Seek(durationTime, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(durationTime, SEEK_MODE));
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_EQ(durationTime, time);
sleep(PLAYING_TIME);
EXPECT_EQ(RET_OK, player->GetCurrentTime(time_before));
sleep(PLAYING_TIME);
EXPECT_EQ(RET_OK, player->GetCurrentTime(time_after));
// EXPECT_GE(time_after - time_before, PLAYING_TIME * 1000);
EXPECT_EQ(RET_OK, player->Play());
EXPECT_EQ(RET_OK, testCallback->WaitForState(PLAYER_PLAYBACK_COMPLETE));
EXPECT_EQ(RET_OK, player->Reset());
......@@ -1133,7 +1134,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_3000, Func
EXPECT_EQ(RET_OK, player->Play());
EXPECT_EQ(RET_OK, player->Pause());
EXPECT_EQ(RET_OK, player->GetDuration(durationTime));
EXPECT_EQ(RET_OK, player->Seek(durationTime, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(durationTime, SEEK_MODE));
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_EQ(durationTime, time);
EXPECT_EQ(RET_OK, player->Play());
......@@ -1147,7 +1148,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_3000, Func
ASSERT_EQ(RET_OK, player->PrepareAsync());
EXPECT_EQ(RET_OK, player->Play());
EXPECT_EQ(RET_OK, player->Pause());
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_2_SEC, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_2_SEC, SEEK_MODE));
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_EQ(SEEK_TIME_2_SEC, time);
EXPECT_EQ(RET_OK, player->Stop());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册