提交 fd5c7f8a 编写于 作者: O openharmony_ci 提交者: Gitee

!506 media native 测试用例提交

Merge pull request !506 from bird_j/bird-j-master-patch-96179
......@@ -33,18 +33,7 @@ ohos_moduletest_suite("ActsMediaCppStandardTest") {
"player/src/function/ActsPlayerFuncAsyncTest.cpp",
"player/src/function/ActsPlayerStateTest.cpp",
"player/src/function/ActsPlayerStateAsyncTest.cpp",
"player/src/api/01.SetSource.cpp",
"player/src/api/02.Prepare.cpp",
"player/src/api/03.Play.cpp",
"player/src/api/04.Pause.cpp",
"player/src/api/05.Stop.cpp",
"player/src/api/06.Reset.cpp",
"player/src/api/07.Seek.cpp",
"player/src/api/08.SetVolume.cpp",
"player/src/api/09.SetLooping.cpp",
"player/src/api/10.SetPlaybackSpeed.cpp",
"player/src/api/11.PrepareAsync.cpp",
"player/src/api/12.GetCurrentTime.cpp",
"player/src/api/ActsPlayerAPITest.cpp",
]
include_dirs = [
"include",
......
......@@ -16,6 +16,7 @@
#include "Testplayer.h"
#include "parameter.h"
#include "media_errors.h"
using namespace OHOS;
using namespace OHOS::Media;
......@@ -39,6 +40,7 @@ TestPlayer::~TestPlayer()
}
bool TestPlayer::CreatePlayer()
{
MEDIA_INFO_LOG("%s", __FUNCTION__);
player = PlayerFactory::CreatePlayer();
if (player == nullptr) {
return false;
......@@ -47,11 +49,13 @@ bool TestPlayer::CreatePlayer()
}
int32_t TestPlayer::SetSource(const std::string &uri)
{
MEDIA_INFO_LOG("%s", __FUNCTION__);
return player->SetSource(uri);
}
int32_t TestPlayer::Play()
{
MEDIA_INFO_LOG("%s", __FUNCTION__);
int32_t ret = player->Play();
if (test_->mutexFlag_ == true && test_->state_ != PLAYER_STARTED) {
std::unique_lock<std::mutex> lockPlay(test_->mutexPlay_);
......@@ -65,6 +69,7 @@ int32_t TestPlayer::Play()
int32_t TestPlayer::Prepare()
{
MEDIA_INFO_LOG("%s", __FUNCTION__);
int32_t ret = player->Prepare();
if (test_->mutexFlag_ == true && test_->state_ != PLAYER_PREPARED) {
std::unique_lock<std::mutex> lockPrepare(test_->mutexPrepare_);
......@@ -78,6 +83,7 @@ int32_t TestPlayer::Prepare()
int32_t TestPlayer::PrepareAsync()
{
MEDIA_INFO_LOG("%s", __FUNCTION__);
int32_t ret = player->PrepareAsync();
if (test_->mutexFlag_ == true && test_->state_ != PLAYER_PREPARED) {
std::unique_lock<std::mutex> lockPrepare(test_->mutexPrepare_);
......@@ -91,6 +97,7 @@ int32_t TestPlayer::PrepareAsync()
int32_t TestPlayer::Pause()
{
MEDIA_INFO_LOG("%s", __FUNCTION__);
int32_t ret = player->Pause();
if (test_->mutexFlag_ == true && test_->state_ != PLAYER_PAUSED) {
std::unique_lock<std::mutex> lockPause(test_->mutexPause_);
......@@ -104,6 +111,7 @@ int32_t TestPlayer::Pause()
int32_t TestPlayer::Stop()
{
MEDIA_INFO_LOG("%s", __FUNCTION__);
int32_t ret = player->Stop();
if (test_->mutexFlag_ == true && test_->state_ != PLAYER_STOPPED) {
std::unique_lock<std::mutex> lockStop(test_->mutexStop_);
......@@ -117,6 +125,7 @@ int32_t TestPlayer::Stop()
int32_t TestPlayer::Reset()
{
MEDIA_INFO_LOG("%s", __FUNCTION__);
int32_t ret = player->Reset();
if (test_->mutexFlag_ == true && test_->state_ != PLAYER_IDLE) {
std::unique_lock<std::mutex> lockReset(test_->mutexReset_);
......@@ -130,16 +139,19 @@ int32_t TestPlayer::Reset()
int32_t TestPlayer::Release()
{
MEDIA_INFO_LOG("%s", __FUNCTION__);
return player->Release();
}
int32_t TestPlayer::SetVolume(float leftVolume, float rightVolume)
{
MEDIA_INFO_LOG("%s", __FUNCTION__);
return player->SetVolume(leftVolume, rightVolume);
}
int32_t TestPlayer::Seek(int32_t mseconds, PlayerSeekMode mode)
{
MEDIA_INFO_LOG("%s", __FUNCTION__);
test_->seekDoneFlag_ = false;
test_->seekPositon_ = mseconds;
int32_t ret = player->Seek(mseconds, mode);
......@@ -155,36 +167,40 @@ int32_t TestPlayer::Seek(int32_t mseconds, PlayerSeekMode mode)
int32_t TestPlayer::GetCurrentTime(int32_t &currentTime)
{
MEDIA_INFO_LOG("%s", __FUNCTION__);
return player->GetCurrentTime(currentTime);
}
int32_t TestPlayer::GetDuration(int32_t &duration)
{
MEDIA_INFO_LOG("%s", __FUNCTION__);
return player->GetDuration(duration);
}
int32_t TestPlayer::SetPlaybackSpeed(PlaybackRateMode mode)
{
MEDIA_INFO_LOG("%s", __FUNCTION__);
return player->SetPlaybackSpeed(mode);
}
int32_t TestPlayer::GetPlaybackSpeed(PlaybackRateMode &mode)
{
MEDIA_INFO_LOG("%s", __FUNCTION__);
return player->GetPlaybackSpeed(mode);
}
sptr<Surface> TestPlayer::GetVideoSurface(WindowConfig sub_config)
{
char surface[256] = "null";
GetParameter("sys.media.test.surface", "null", &surface[0], 256);
sptr<Surface> videoSurface = nullptr;
if (strcmp(surface, "null") == 0) {
return videoSurface;
}
mwindow = WindowManager::GetInstance()->CreateWindow(&g_config);
if (mwindow == nullptr) {
MEDIA_ERROR_LOG("Create mwindow failed!!!");
return nullptr;
}
sptr<Surface> videoSurface = nullptr;
if (strcmp(surface, "null") == 0) {
return videoSurface;
}
if (strcmp(surface, "subwindow") == 0) {
InitSubWindow(sub_config);
videoSurface = window->GetSurface();
......@@ -192,12 +208,13 @@ sptr<Surface> TestPlayer::GetVideoSurface(WindowConfig sub_config)
videoSurface = mwindow->GetSurface();
videoSurface->SetUserData(SURFACE_FORMAT, std::to_string(PIXEL_FMT_RGBA_8888));
std::string format = videoSurface->GetUserData(SURFACE_FORMAT);
MEDIA_INFO_LOG("SetUserData SURFACE_FORMAT = %s", format.c_str());
MEDIA_DEBUG_LOG("SetUserData SURFACE_FORMAT = %s", format.c_str());
}
return videoSurface;
}
int32_t TestPlayer::SetVideoSurface(const sptr<Surface> surface)
{
MEDIA_INFO_LOG("%s", __FUNCTION__);
char parameter[256] = "null";
GetParameter("sys.media.test.surface", "null", &parameter[0], 256);
if (strcmp(parameter, "null") == 0) {
......@@ -219,11 +236,13 @@ bool TestPlayer::IsLooping()
int32_t TestPlayer::SetLooping(bool loop)
{
MEDIA_INFO_LOG("%s", __FUNCTION__);
return player->SetLooping(loop);
}
int32_t TestPlayer::SetPlayerCallback(const std::shared_ptr<PlayerCallback> &callback)
{
MEDIA_INFO_LOG("%s", __FUNCTION__);
return player->SetPlayerCallback(callback);
}
......@@ -270,9 +289,12 @@ void TestPlayerCallback::OnError(PlayerErrorType errorType, int32_t errorCode)
errorNum++;
errorType_ = errorType;
errorCode_ = errorCode;
MEDIA_INFO_LOG("TestPlayerCallback: OnError errorType is %d, errorCode is %d", errorType_, errorCode_);
std::string errorTypeMsg = PlayerErrorTypeToString(errorType);
std::string errorCodeMsg = MSErrorToString(static_cast<MediaServiceErrCode>(errorCode));
MEDIA_ERROR_LOG("TestPlayerCallback: OnError errorType is %s, errorCode is %s",
errorTypeMsg.c_str(), errorCodeMsg.c_str());
}
void TestPlayerCallback::OnInfo(PlayerOnInfoType type, int32_t extra, const Format &InfoBody)
void TestPlayerCallback::OnInfo(PlayerOnInfoType type, int32_t extra, const Format &infoBody)
{
switch (type) {
case INFO_TYPE_SEEKDONE:
......@@ -290,7 +312,6 @@ void TestPlayerCallback::OnInfo(PlayerOnInfoType type, int32_t extra, const Form
break;
case INFO_TYPE_STATE_CHANGE:
state_ = static_cast<PlayerStates>(extra);
test_->SetState(state_);
PrintState(state_);
break;
case INFO_TYPE_POSITION_UPDATE:
......@@ -303,7 +324,6 @@ void TestPlayerCallback::OnInfo(PlayerOnInfoType type, int32_t extra, const Form
break;
}
}
int TestPlayerCallback::WaitForSeekDone(int32_t currentPositon)
{
int64_t waitTime = 0;
......@@ -328,7 +348,7 @@ int TestPlayerCallback::WaitForState(PlayerStates state)
waitTime += 1;
}
if (waitTime >= WAITSECOND * 1000) {
MEDIA_INFO_LOG("Failed to wait for state[%d] down", state);
MEDIA_ERROR_LOG("Failed to wait for state[%d] down", state);
return -1;
}
return 0;
......@@ -341,6 +361,7 @@ void TestPlayerCallback::PrintState(PlayerStates state)
break;
case PLAYER_IDLE:
MEDIA_INFO_LOG("State: IDLE");
test_->SetState(state);
test_->condVarReset_.notify_all();
break;
case PLAYER_INITIALIZED:
......@@ -351,18 +372,22 @@ void TestPlayerCallback::PrintState(PlayerStates state)
break;
case PLAYER_PREPARED:
MEDIA_INFO_LOG("State: Prepared");
test_->SetState(state);
test_->condVarPrepare_.notify_all();
break;
case PLAYER_STARTED:
MEDIA_INFO_LOG("State: Started");
test_->SetState(state);
test_->condVarPlay_.notify_all();
break;
case PLAYER_PAUSED:
MEDIA_INFO_LOG("State: Paused");
test_->SetState(state);
test_->condVarPause_.notify_all();
break;
case PLAYER_STOPPED:
MEDIA_INFO_LOG("State: Stopped");
test_->SetState(state);
test_->condVarStop_.notify_all();
break;
case PLAYER_PLAYBACK_COMPLETE:
......
......@@ -15,26 +15,11 @@
#include "securec.h"
#include "common.h"
#include "player.h"
#include "mediatest_log.h"
#include "window_manager.h"
#include "surface_type.h"
#include "display_type.h"
namespace PlayerNameSpace {
static const int MAX_THREADS = 16;
static const int32_t PLAYING_TIME = 3;
static const int32_t PAUSED_TIME = 1;
static const int32_t SEEK_TIME_5_SEC = 5000;
static const int32_t SEEK_TIME_2_SEC = 2000;
static const int DELTA_TIME = 1000;
static const int WAITSECOND = 2;
static const int MAXTIME = 20;
static const int RET_OK = 0;
static const int32_t FILE_BEGIN = 0;
std::string GetUri();
}
namespace OHOS {
namespace Media {
static const std::string SURFACE_STRIDE_ALIGNMENT = "SURFACE_STRIDE_ALIGNMENT";
......@@ -119,7 +104,7 @@ public:
~TestPlayerCallback();
void OnError(PlayerErrorType errorType, int32_t errorCode);
int WaitForSeekDone(int32_t currentPositon);
void OnInfo(PlayerOnInfoType type, int32_t extra, const Format &InfoBody = {});
void OnInfo(PlayerOnInfoType type, int32_t extra, const Format &infoBody = {});
int WaitForState(PlayerStates state);
private:
PlayerErrorType errorType_ = PLAYER_ERROR_UNKNOWN;
......
......@@ -14,7 +14,22 @@
*/
#include "gtest/gtest.h"
#include "player.h"
#define MOUNT_147 "/data/147"
#define MOUNT_189 "/data/189"
namespace PlayerNameSpace {
static std::string MOUNT_147 = "/data/media/audio/147";
static std::string MOUNT_189 = "/data/media/audio/189";
static const int MAX_THREADS = 16;
static const int32_t PLAYING_TIME = 3;
static const int32_t PAUSED_TIME = 1;
static const int32_t SEEK_TIME_5_SEC = 5000;
static const int32_t SEEK_TIME_2_SEC = 2000;
static const int DELTA_TIME = 1000;
static const int WAITSECOND = 2;
static const int MAXTIME = 1000;
static const int RET_OK = 0;
static const int32_t FILE_BEGIN = 0;
static const int32_t BUF_SIZE = 1024 * 1024;
static const OHOS::Media::PlayerSeekMode SEEK_MODE = OHOS::Media::PlayerSeekMode::SEEK_PREVIOUS_SYNC;
std::string GetUri();
}
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "ActsPlayerAPITest.h"
#include "player.h"
using namespace std;
using namespace OHOS;
using namespace OHOS::Media;
using namespace testing::ext;
using namespace PlayerNameSpace;
/**
* @tc.number : SUB_MEDIA_PLAYER_APITest_SetSource_0100
* @tc.name : 01.SetSource操作在new之后
* @tc.desc : test SetSource
*/
HWTEST_F(ActsPlayerAPITest, SUB_MEDIA_PLAYER_APITest_SetSource_0100, Reliability | MediumTest | Level2)
{
PlayerSignal testObj;
std::shared_ptr<TestPlayer> player = std::make_shared<TestPlayer>(&testObj);
ASSERT_NE(nullptr, player);
ASSERT_EQ(true, player->CreatePlayer());
std::string uri = GetUri();
ASSERT_EQ(RET_OK, player->SetSource(uri));
}
/**
* @tc.number : SUB_MEDIA_PLAYER_APITest_Prepare_0100
* @tc.name : 03.Prepare操作在SetSource之后
* @tc.desc : test Prepare
*/
HWTEST_F(ActsPlayerAPITest, SUB_MEDIA_PLAYER_APITest_Prepare_0100, Reliability | MediumTest | Level2)
{
PlayerSignal testObj;
std::shared_ptr<TestPlayer> player = std::make_shared<TestPlayer>(&testObj);
ASSERT_NE(nullptr, player);
ASSERT_EQ(true, player->CreatePlayer());
std::string uri = GetUri();
ASSERT_EQ(RET_OK, player->SetSource(uri));
std::shared_ptr<TestPlayerCallback> testCallback = std::make_shared<TestPlayerCallback>(&testObj);
EXPECT_EQ(RET_OK, player->SetPlayerCallback(testCallback));
ASSERT_EQ(RET_OK, player->Prepare());
EXPECT_EQ(RET_OK, player->Reset());
EXPECT_EQ(RET_OK, testCallback->errorNum);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_APITest_PrepareAsync_0100
* @tc.name : 03.PrepareAsync操作在SetSource之后
* @tc.desc : test PrepareAsync
*/
HWTEST_F(ActsPlayerAPITest, SUB_MEDIA_PLAYER_APITest_PrepareAsync_0100, Reliability | MediumTest | Level2)
{
PlayerSignal testObj;
std::shared_ptr<TestPlayer> player = std::make_shared<TestPlayer>(&testObj);
ASSERT_NE(nullptr, player);
ASSERT_EQ(true, player->CreatePlayer());
std::string uri = GetUri();
ASSERT_EQ(RET_OK, player->SetSource(uri));
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->Reset());
EXPECT_EQ(RET_OK, testCallback->errorNum);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_APITest_Play_0100
* @tc.name : 02.Play操作在PrepareAsync之后
* @tc.desc : test Play
*/
HWTEST_F(ActsPlayerAPITest, SUB_MEDIA_PLAYER_APITest_Play_0100, Reliability | MediumTest | Level2)
{
PlayerSignal testObj;
std::shared_ptr<TestPlayer> player = std::make_shared<TestPlayer>(&testObj);
ASSERT_NE(nullptr, player);
ASSERT_EQ(true, player->CreatePlayer());
std::string uri = GetUri();
ASSERT_EQ(RET_OK, player->SetSource(uri));
sptr<Surface> videoSurface = player->GetVideoSurface(g_sub_config);
EXPECT_EQ(RET_OK, player->SetVideoSurface(videoSurface));
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->Play());
EXPECT_TRUE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->Reset());
EXPECT_EQ(RET_OK, testCallback->errorNum);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_APITest_Stop_0100
* @tc.name : 04.Stop操作在Play之后
* @tc.desc : test Stop
*/
HWTEST_F(ActsPlayerAPITest, SUB_MEDIA_PLAYER_APITest_Stop_0100, Reliability | MediumTest | Level2)
{
PlayerSignal testObj;
std::shared_ptr<TestPlayer> player = std::make_shared<TestPlayer>(&testObj);
ASSERT_NE(nullptr, player);
ASSERT_EQ(true, player->CreatePlayer());
std::string uri = GetUri();
ASSERT_EQ(RET_OK, player->SetSource(uri));
sptr<Surface> videoSurface = player->GetVideoSurface(g_sub_config);
EXPECT_EQ(RET_OK, player->SetVideoSurface(videoSurface));
std::shared_ptr<TestPlayerCallback> testCallback = std::make_shared<TestPlayerCallback>(&testObj);
EXPECT_EQ(RET_OK, player->SetPlayerCallback(testCallback));
ASSERT_EQ(RET_OK, player->Prepare());
EXPECT_EQ(RET_OK, player->Play());
EXPECT_TRUE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->Stop());
EXPECT_EQ(RET_OK, player->Reset());
EXPECT_EQ(RET_OK, testCallback->errorNum);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_APITest_Pause_0100
* @tc.name : 05.Pause操作在Play之后
* @tc.desc : test Pause
*/
HWTEST_F(ActsPlayerAPITest, SUB_MEDIA_PLAYER_APITest_Pause_0100, Reliability | MediumTest | Level2)
{
PlayerSignal testObj;
std::shared_ptr<TestPlayer> player = std::make_shared<TestPlayer>(&testObj);
ASSERT_NE(nullptr, player);
ASSERT_EQ(true, player->CreatePlayer());
std::string uri = GetUri();
ASSERT_EQ(RET_OK, player->SetSource(uri));
sptr<Surface> videoSurface = player->GetVideoSurface(g_sub_config);
EXPECT_EQ(RET_OK, player->SetVideoSurface(videoSurface));
std::shared_ptr<TestPlayerCallback> testCallback = std::make_shared<TestPlayerCallback>(&testObj);
EXPECT_EQ(RET_OK, player->SetPlayerCallback(testCallback));
ASSERT_EQ(RET_OK, player->Prepare());
EXPECT_EQ(RET_OK, player->Play());
EXPECT_TRUE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->Pause());
EXPECT_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->Reset());
EXPECT_EQ(RET_OK, testCallback->errorNum);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_APITest_Reset_0100
* @tc.name : 06.Reset操作在Seek之后
* @tc.desc : test Reset
*/
HWTEST_F(ActsPlayerAPITest, SUB_MEDIA_PLAYER_APITest_Reset_0100, Reliability | MediumTest | Level2)
{
PlayerSignal testObj;
std::shared_ptr<TestPlayer> player = std::make_shared<TestPlayer>(&testObj);
ASSERT_NE(nullptr, player);
ASSERT_EQ(true, player->CreatePlayer());
std::string uri = GetUri();
int32_t time;
ASSERT_EQ(RET_OK, player->SetSource(uri));
sptr<Surface> videoSurface = player->GetVideoSurface(g_sub_config);
EXPECT_EQ(RET_OK, player->SetVideoSurface(videoSurface));
std::shared_ptr<TestPlayerCallback> testCallback = std::make_shared<TestPlayerCallback>(&testObj);
EXPECT_EQ(RET_OK, player->SetPlayerCallback(testCallback));
ASSERT_EQ(RET_OK, player->Prepare());
EXPECT_EQ(RET_OK, player->Play());
EXPECT_TRUE(player->IsPlaying());
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);
EXPECT_EQ(RET_OK, player->Reset());
EXPECT_EQ(RET_OK, testCallback->errorNum);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_APITest_Seek_0100
* @tc.name : 04.Seek操作在Play之后
* @tc.desc : test Seek
*/
HWTEST_F(ActsPlayerAPITest, SUB_MEDIA_PLAYER_APITest_Seek_0100, Reliability | MediumTest | Level2)
{
PlayerSignal testObj;
std::shared_ptr<TestPlayer> player = std::make_shared<TestPlayer>(&testObj);
ASSERT_NE(nullptr, player);
ASSERT_EQ(true, player->CreatePlayer());
std::string uri = GetUri();
int32_t time;
ASSERT_EQ(RET_OK, player->SetSource(uri));
sptr<Surface> videoSurface = player->GetVideoSurface(g_sub_config);
EXPECT_EQ(RET_OK, player->SetVideoSurface(videoSurface));
std::shared_ptr<TestPlayerCallback> testCallback = std::make_shared<TestPlayerCallback>(&testObj);
EXPECT_EQ(RET_OK, player->SetPlayerCallback(testCallback));
ASSERT_EQ(RET_OK, player->Prepare());
EXPECT_EQ(RET_OK, player->Play());
EXPECT_TRUE(player->IsPlaying());
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);
EXPECT_EQ(RET_OK, player->Reset());
EXPECT_EQ(RET_OK, testCallback->errorNum);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_APITest_Seek_0200
* @tc.name : 06.Seek操作在Pause之后
* @tc.desc : test Seek
*/
HWTEST_F(ActsPlayerAPITest, SUB_MEDIA_PLAYER_APITest_Seek_0200, Reliability | MediumTest | Level2)
{
PlayerSignal testObj;
std::shared_ptr<TestPlayer> player = std::make_shared<TestPlayer>(&testObj);
ASSERT_NE(nullptr, player);
ASSERT_EQ(true, player->CreatePlayer());
std::string uri = GetUri();
int32_t time;
ASSERT_EQ(RET_OK, player->SetSource(uri));
sptr<Surface> videoSurface = player->GetVideoSurface(g_sub_config);
EXPECT_EQ(RET_OK, player->SetVideoSurface(videoSurface));
std::shared_ptr<TestPlayerCallback> testCallback = std::make_shared<TestPlayerCallback>(&testObj);
EXPECT_EQ(RET_OK, player->SetPlayerCallback(testCallback));
ASSERT_EQ(RET_OK, player->Prepare());
EXPECT_EQ(RET_OK, player->Play());
EXPECT_TRUE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->Pause());
EXPECT_FALSE(player->IsPlaying());
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);
EXPECT_EQ(RET_OK, player->Reset());
EXPECT_EQ(RET_OK, testCallback->errorNum);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_APITest_Seek_0300
* @tc.name : 10.Seek操作调用3次
* @tc.desc : test Seek
*/
HWTEST_F(ActsPlayerAPITest, SUB_MEDIA_PLAYER_APITest_Seek_0300, Reliability | MediumTest | Level2)
{
PlayerSignal testObj;
std::shared_ptr<TestPlayer> player = std::make_shared<TestPlayer>(&testObj);
ASSERT_NE(nullptr, player);
ASSERT_EQ(true, player->CreatePlayer());
std::string uri = GetUri();
int32_t time;
ASSERT_EQ(RET_OK, player->SetSource(uri));
sptr<Surface> videoSurface = player->GetVideoSurface(g_sub_config);
EXPECT_EQ(RET_OK, player->SetVideoSurface(videoSurface));
std::shared_ptr<TestPlayerCallback> testCallback = std::make_shared<TestPlayerCallback>(&testObj);
EXPECT_EQ(RET_OK, player->SetPlayerCallback(testCallback));
ASSERT_EQ(RET_OK, player->Prepare());
EXPECT_EQ(RET_OK, player->Play());
EXPECT_TRUE(player->IsPlaying());
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);
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);
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);
EXPECT_EQ(RET_OK, player->Pause());
EXPECT_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_2_SEC, SEEK_MODE));
EXPECT_EQ(RET_OK, player->Play());
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_2_SEC, SEEK_MODE));
EXPECT_EQ(RET_OK, player->Stop());
EXPECT_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->Reset());
EXPECT_EQ(RET_OK, testCallback->errorNum);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_APITest_SetVolume_0100
* @tc.name : 01.SetVolume 0.5 0.5
* @tc.desc : test SetVolume
*/
HWTEST_F(ActsPlayerAPITest, SUB_MEDIA_PLAYER_APITest_SetVolume_0100, Reliability | MediumTest | Level2)
{
PlayerSignal testObj;
std::shared_ptr<TestPlayer> player = std::make_shared<TestPlayer>(&testObj);
ASSERT_NE(nullptr, player);
ASSERT_EQ(true, player->CreatePlayer());
std::string uri = GetUri();
int32_t time;
ASSERT_EQ(RET_OK, player->SetSource(uri));
sptr<Surface> videoSurface = player->GetVideoSurface(g_sub_config);
EXPECT_EQ(RET_OK, player->SetVideoSurface(videoSurface));
std::shared_ptr<TestPlayerCallback> testCallback = std::make_shared<TestPlayerCallback>(&testObj);
EXPECT_EQ(RET_OK, player->SetPlayerCallback(testCallback));
ASSERT_EQ(RET_OK, player->Prepare());
EXPECT_EQ(RET_OK, player->Play());
EXPECT_TRUE(player->IsPlaying());
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);
sleep(PLAYING_TIME);
EXPECT_EQ(RET_OK, player->SetVolume(0.5, 0.5));
sleep(PLAYING_TIME);
EXPECT_EQ(RET_OK, player->Stop());
EXPECT_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->Reset());
EXPECT_EQ(RET_OK, testCallback->errorNum);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_APITest_SetPlaybackSpeed_0100
* @tc.name : 02.SetPlaybackSpeed操作在play之后
* @tc.desc :
*/
HWTEST_F(ActsPlayerAPITest, SUB_MEDIA_PLAYER_APITest_SetPlaybackSpeed_0100, Reliability | MediumTest | Level2)
{
PlayerSignal testObj;
std::shared_ptr<TestPlayer> player = std::make_shared<TestPlayer>(&testObj);
ASSERT_NE(nullptr, player);
ASSERT_EQ(true, player->CreatePlayer());
std::string uri = GetUri();
ASSERT_EQ(RET_OK, player->SetSource(uri));
PlaybackRateMode mode;
sptr<Surface> videoSurface = player->GetVideoSurface(g_sub_config);
EXPECT_EQ(RET_OK, player->SetVideoSurface(videoSurface));
std::shared_ptr<TestPlayerCallback> testCallback = std::make_shared<TestPlayerCallback>(&testObj);
EXPECT_EQ(RET_OK, player->SetPlayerCallback(testCallback));
ASSERT_EQ(RET_OK, player->Prepare());
EXPECT_EQ(RET_OK, player->Play());
EXPECT_TRUE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->SetPlaybackSpeed(SPEED_FORWARD_0_75_X));
EXPECT_EQ(RET_OK, player->GetPlaybackSpeed(mode));
EXPECT_EQ(SPEED_FORWARD_0_75_X, mode);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_APITest_Seek_1500
* @tc.name : 15.GET操作在每个可进行的操作后都调用一次
* @tc.desc : test Seek
*/
HWTEST_F(ActsPlayerAPITest, SUB_MEDIA_PLAYER_APITest_GetParameter_0100, Reliability | MediumTest | Level2)
{
PlayerSignal testObj;
std::shared_ptr<TestPlayer> player = std::make_shared<TestPlayer>(&testObj);
ASSERT_NE(nullptr, player);
ASSERT_EQ(true, player->CreatePlayer());
std::string uri = GetUri();
int32_t time;
int32_t duration;
int32_t defaultDuration;
ASSERT_EQ(RET_OK, player->SetSource(uri));
sptr<Surface> videoSurface = player->GetVideoSurface(g_sub_config);
EXPECT_EQ(RET_OK, player->SetVideoSurface(videoSurface));
std::shared_ptr<TestPlayerCallback> testCallback = std::make_shared<TestPlayerCallback>(&testObj);
EXPECT_EQ(RET_OK, player->SetPlayerCallback(testCallback));
// prepare
ASSERT_EQ(RET_OK, player->PrepareAsync());
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_EQ(FILE_BEGIN, time);
EXPECT_EQ(RET_OK, player->GetDuration(defaultDuration));
EXPECT_FALSE(player->IsPlaying());
// play
EXPECT_EQ(RET_OK, player->Play());
EXPECT_TRUE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_NEAR(FILE_BEGIN, time, DELTA_TIME);
EXPECT_EQ(RET_OK, player->GetDuration(duration));
EXPECT_EQ(defaultDuration, duration);
EXPECT_TRUE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->Stop());
EXPECT_EQ(RET_OK, player->Reset());
}
......@@ -423,7 +423,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_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);
EXPECT_EQ(RET_OK, player->Pause());
......@@ -458,7 +458,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_1500, Func
EXPECT_TRUE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->Pause());
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);
......@@ -501,7 +501,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_1600, Func
sleep(PLAYING_TIME);
EXPECT_TRUE(player->IsPlaying());
for (int32_t i = 1; i < 4; i++) {
EXPECT_EQ(RET_OK, player->Seek(i * 1000, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(i * 1000, SEEK_MODE));
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_NEAR(i * 1000, time, DELTA_TIME);
}
......@@ -537,7 +537,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_1700, 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);
......@@ -570,7 +570,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_1800, 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);
......@@ -608,7 +608,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_1900, Func
EXPECT_EQ(RET_OK, player->Stop());
EXPECT_FALSE(player->IsPlaying());
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_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_NEAR(SEEK_TIME_5_SEC, time, DELTA_TIME);
......@@ -647,7 +647,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_2000, Func
EXPECT_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetDuration(durationTime));
for (int32_t i = 0; i < durationTime; i = i + (durationTime / 3) + 1) {
EXPECT_EQ(RET_OK, player->Seek(i, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(i, SEEK_MODE));
EXPECT_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->Play());
EXPECT_TRUE(player->IsPlaying());
......@@ -691,7 +691,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_2100, Func
EXPECT_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetDuration(durationTime));
for (int32_t i = 0; i < durationTime; i = i + (durationTime / 3) + 1) {
EXPECT_EQ(RET_OK, player->Seek(i, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(i, SEEK_MODE));
EXPECT_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_NEAR(i, time, DELTA_TIME);
......@@ -729,7 +729,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_2200, Func
EXPECT_EQ(RET_OK, player->Pause());
EXPECT_FALSE(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_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->Play());
EXPECT_TRUE(player->IsPlaying());
......@@ -771,7 +771,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_2300, 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_TRUE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_NEAR(SEEK_TIME_5_SEC, time, DELTA_TIME);
......@@ -808,7 +808,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_2400, Func
EXPECT_EQ(RET_OK, player->Stop());
EXPECT_FALSE(player->IsPlaying());
EXPECT_NE(RET_OK, player->Seek(SEEK_TIME_5_SEC, SEEK_PREVIOUS_SYNC));
EXPECT_NE(RET_OK, player->Seek(SEEK_TIME_5_SEC, SEEK_MODE));
EXPECT_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_NEAR(FILE_BEGIN, time, DELTA_TIME);
......@@ -845,8 +845,8 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_2500, Func
EXPECT_EQ(RET_OK, player->Play());
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(FILE_BEGIN, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_5_SEC, SEEK_MODE));
EXPECT_EQ(RET_OK, player->Seek(FILE_BEGIN, SEEK_MODE));
EXPECT_TRUE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_NEAR(FILE_BEGIN, time, DELTA_TIME);
......@@ -881,7 +881,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_2600, Func
EXPECT_EQ(RET_OK, player->Stop());
EXPECT_FALSE(player->IsPlaying());
EXPECT_NE(RET_OK, player->Seek(SEEK_TIME_5_SEC, SEEK_PREVIOUS_SYNC));
EXPECT_NE(RET_OK, player->Seek(SEEK_TIME_5_SEC, SEEK_MODE));
EXPECT_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_NEAR(FILE_BEGIN, time, DELTA_TIME);
......@@ -919,7 +919,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_2700, Func
EXPECT_EQ(RET_OK, player->Stop());
EXPECT_FALSE(player->IsPlaying());
EXPECT_NE(RET_OK, player->Seek(SEEK_TIME_5_SEC, SEEK_PREVIOUS_SYNC));
EXPECT_NE(RET_OK, player->Seek(SEEK_TIME_5_SEC, SEEK_MODE));
EXPECT_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
......@@ -960,7 +960,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_2800, Func
EXPECT_TRUE(player->IsPlaying());
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, testCallback->WaitForState(PLAYER_PLAYBACK_COMPLETE));
EXPECT_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
......@@ -995,7 +995,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_2900, 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, testCallback->WaitForState(PLAYER_PLAYBACK_COMPLETE));
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_EQ(durationTime, time);
......@@ -1032,7 +1032,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_3000, Func
EXPECT_TRUE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetDuration(durationTime));
EXPECT_EQ(RET_OK, player->Seek(durationTime / 3, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(durationTime / 3, SEEK_MODE));
EXPECT_TRUE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_NEAR(durationTime / 3, time, DELTA_TIME);
......@@ -1068,7 +1068,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_3100, Func
EXPECT_EQ(RET_OK, player->GetDuration(durationTime));
for (int32_t i = 0; i < durationTime; i = i + (durationTime / 3) + 1) {
EXPECT_EQ(RET_OK, player->Seek(i, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(i, SEEK_MODE));
EXPECT_TRUE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_NEAR(i, time, DELTA_TIME);
......@@ -1108,7 +1108,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_3200, Func
EXPECT_EQ(RET_OK, player->Pause());
EXPECT_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->Seek(FILE_BEGIN, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(FILE_BEGIN, SEEK_MODE));
EXPECT_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_NEAR(FILE_BEGIN, time, DELTA_TIME);
......@@ -1148,7 +1148,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_3300, Func
EXPECT_EQ(RET_OK, player->Pause());
EXPECT_FALSE(player->IsPlaying());
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_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_EQ(durationTime, time);
......@@ -1190,7 +1190,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_3400, Func
EXPECT_EQ(RET_OK, player->Pause());
EXPECT_FALSE(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_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
......@@ -1200,4 +1200,4 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_3400, Func
EXPECT_EQ(RET_OK, player->Reset());
EXPECT_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, testCallback->errorNum);
}
}
\ No newline at end of file
......@@ -12,6 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "ActsPlayerFuncTest.h"
#include "securec.h"
......@@ -428,10 +429,9 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_1400, Function |
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());
EXPECT_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->Stop());
......@@ -465,7 +465,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_1500, Function |
EXPECT_TRUE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->Pause());
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);
......@@ -509,7 +509,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_1600, Function |
sleep(PLAYING_TIME);
EXPECT_TRUE(player->IsPlaying());
for (int32_t i = 1; i < 4; i++) {
EXPECT_EQ(RET_OK, player->Seek(i * 1000, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(i * 1000, SEEK_MODE));
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_NEAR(i * 1000, time, DELTA_TIME);
}
......@@ -546,7 +546,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_1700, Function |
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);
......@@ -580,7 +580,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_1800, Function |
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);
......@@ -619,7 +619,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_1900, Function |
EXPECT_EQ(RET_OK, player->Stop());
EXPECT_FALSE(player->IsPlaying());
ASSERT_EQ(RET_OK, player->Prepare());
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_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_NEAR(SEEK_TIME_5_SEC, time, DELTA_TIME);
......@@ -659,7 +659,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_2000, Function |
EXPECT_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetDuration(durationTime));
for (int32_t i = 0; i < durationTime; i = i + (durationTime / 3) + 1) {
EXPECT_EQ(RET_OK, player->Seek(i, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(i, SEEK_MODE));
EXPECT_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->Play());
EXPECT_TRUE(player->IsPlaying());
......@@ -705,7 +705,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_2100, Function |
EXPECT_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetDuration(durationTime));
for (int32_t i = 0; i < durationTime; i = i + (durationTime / 3) + 1) {
EXPECT_EQ(RET_OK, player->Seek(i, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(i, SEEK_MODE));
EXPECT_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_NEAR(i, time, DELTA_TIME);
......@@ -744,7 +744,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_2200, Function |
EXPECT_EQ(RET_OK, player->Pause());
EXPECT_FALSE(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_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->Play());
EXPECT_TRUE(player->IsPlaying());
......@@ -787,7 +787,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_2300, Function |
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_TRUE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_NEAR(SEEK_TIME_5_SEC, time, DELTA_TIME);
......@@ -825,7 +825,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_2400, Function |
EXPECT_EQ(RET_OK, player->Stop());
EXPECT_FALSE(player->IsPlaying());
EXPECT_NE(RET_OK, player->Seek(SEEK_TIME_5_SEC, SEEK_PREVIOUS_SYNC));
EXPECT_NE(RET_OK, player->Seek(SEEK_TIME_5_SEC, SEEK_MODE));
EXPECT_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_NEAR(FILE_BEGIN, time, DELTA_TIME);
......@@ -863,8 +863,8 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_2500, Function |
EXPECT_EQ(RET_OK, player->Play());
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(FILE_BEGIN, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(SEEK_TIME_5_SEC, SEEK_MODE));
EXPECT_EQ(RET_OK, player->Seek(FILE_BEGIN, SEEK_MODE));
EXPECT_TRUE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_NEAR(FILE_BEGIN, time, DELTA_TIME);
......@@ -900,7 +900,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_2600, Function |
EXPECT_EQ(RET_OK, player->Stop());
EXPECT_FALSE(player->IsPlaying());
EXPECT_NE(RET_OK, player->Seek(SEEK_TIME_5_SEC, SEEK_PREVIOUS_SYNC));
EXPECT_NE(RET_OK, player->Seek(SEEK_TIME_5_SEC, SEEK_MODE));
EXPECT_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_NEAR(FILE_BEGIN, time, DELTA_TIME);
......@@ -939,7 +939,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_2700, Function |
EXPECT_EQ(RET_OK, player->Stop());
EXPECT_FALSE(player->IsPlaying());
EXPECT_NE(RET_OK, player->Seek(SEEK_TIME_5_SEC, SEEK_PREVIOUS_SYNC));
EXPECT_NE(RET_OK, player->Seek(SEEK_TIME_5_SEC, SEEK_MODE));
EXPECT_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
......@@ -981,7 +981,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_2800, Function |
EXPECT_TRUE(player->IsPlaying());
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, testCallback->WaitForState(PLAYER_PLAYBACK_COMPLETE));
EXPECT_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
......@@ -1017,7 +1017,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_2900, Function |
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, testCallback->WaitForState(PLAYER_PLAYBACK_COMPLETE));
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_EQ(durationTime, time);
......@@ -1055,7 +1055,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_3000, Function |
EXPECT_TRUE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetDuration(durationTime));
EXPECT_EQ(RET_OK, player->Seek(durationTime / 3, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(durationTime / 3, SEEK_MODE));
EXPECT_TRUE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_NEAR(durationTime / 3, time, DELTA_TIME);
......@@ -1092,7 +1092,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_3100, Function |
EXPECT_EQ(RET_OK, player->GetDuration(durationTime));
for (int32_t i = 0; i < durationTime; i = i + (durationTime / 3) + 1) {
EXPECT_EQ(RET_OK, player->Seek(i, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(i, SEEK_MODE));
EXPECT_TRUE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_NEAR(i, time, DELTA_TIME);
......@@ -1134,7 +1134,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_3200, Function |
EXPECT_EQ(RET_OK, player->Pause());
EXPECT_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->Seek(FILE_BEGIN, SEEK_PREVIOUS_SYNC));
EXPECT_EQ(RET_OK, player->Seek(FILE_BEGIN, SEEK_MODE));
EXPECT_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
......@@ -1176,7 +1176,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_3300, Function |
EXPECT_EQ(RET_OK, player->Pause());
EXPECT_FALSE(player->IsPlaying());
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_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_EQ(durationTime, time);
......@@ -1219,7 +1219,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_3400, Function |
EXPECT_EQ(RET_OK, player->Pause());
EXPECT_FALSE(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_FALSE(player->IsPlaying());
EXPECT_EQ(RET_OK, player->GetCurrentTime(time));
EXPECT_EQ(durationTime, time);
......
......@@ -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,14 +1085,14 @@ 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);
......@@ -1133,7 +1133,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 +1147,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());
......
......@@ -211,7 +211,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_0800, Function |
EXPECT_EQ(RET_OK, player->SetPlayerCallback(testCallback));
ASSERT_EQ(RET_OK, player->Prepare());
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());
......@@ -248,7 +248,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_0900, Function |
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);
......@@ -282,7 +282,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_1000, Function |
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);
......@@ -315,7 +315,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_1100, Function |
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());
......@@ -349,7 +349,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_1200, Function |
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);
......@@ -386,7 +386,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_1300, Function |
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);
......@@ -424,7 +424,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_1400, Function |
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);
......@@ -590,7 +590,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_1900, Function |
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);
......@@ -631,7 +631,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_2000, Function |
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));
......@@ -668,7 +668,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_2100, Function |
ASSERT_EQ(RET_OK, player->Prepare());
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);
......@@ -710,7 +710,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_2200, Function |
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());
......@@ -753,7 +753,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_2300, Function |
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());
......@@ -793,7 +793,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_2400, Function |
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);
......@@ -825,7 +825,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_2500, Function |
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);
......@@ -860,10 +860,10 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_2600, Function |
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);
......@@ -892,7 +892,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_2625, Function |
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);
......@@ -922,7 +922,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_2650, Function |
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->GetDuration(durationTime));
EXPECT_EQ(RET_OK, testCallback->errorNum);
......@@ -952,7 +952,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_2651, Function |
sleep(PLAYING_TIME);
EXPECT_TRUE(player->IsPlaying());
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);
......@@ -982,7 +982,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_2675, Function |
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));
......@@ -1012,12 +1012,12 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_2700, Function |
ASSERT_EQ(RET_OK, player->Prepare());
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());
......@@ -1055,7 +1055,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_2800, Function |
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());
......@@ -1094,14 +1094,14 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_2900, Function |
ASSERT_EQ(RET_OK, player->Prepare());
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->Prepare());
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));
sleep(PLAYING_TIME);
EXPECT_EQ(RET_OK, player->GetCurrentTime(time_before));
......@@ -1141,7 +1141,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_3000, Function |
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());
......@@ -1155,7 +1155,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_3000, Function |
ASSERT_EQ(RET_OK, player->Prepare());
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.
先完成此消息的编辑!
想要评论请 注册