Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
bca7c391
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
bca7c391
编写于
12月 01, 2021
作者:
O
openharmony_ci
提交者:
Gitee
12月 01, 2021
浏览文件
操作
浏览文件
下载
差异文件
!1247 media test case 同步刷新
Merge pull request !1247 from NOBUGGERS/nobuggers-master-patch-98871
上级
3bbf927e
0b919eed
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
807 addition
and
1908 deletion
+807
-1908
multimedia/media/media_cpp_test_standard/include/mediatest_log.h
...dia/media/media_cpp_test_standard/include/mediatest_log.h
+12
-9
multimedia/media/media_cpp_test_standard/player/include/ActsPlayerAPITest.h
...edia_cpp_test_standard/player/include/ActsPlayerAPITest.h
+1
-0
multimedia/media/media_cpp_test_standard/player/include/ActsPlayerFuncTest.h
...dia_cpp_test_standard/player/include/ActsPlayerFuncTest.h
+6
-1
multimedia/media/media_cpp_test_standard/player/include/TestParamsConfig.h
...media_cpp_test_standard/player/include/TestParamsConfig.h
+2
-1
multimedia/media/media_cpp_test_standard/player/include/TestPlayer.h
...media/media_cpp_test_standard/player/include/TestPlayer.h
+4
-2
multimedia/media/media_cpp_test_standard/player/src/TestParamsConfig.cpp
...a/media_cpp_test_standard/player/src/TestParamsConfig.cpp
+23
-8
multimedia/media/media_cpp_test_standard/player/src/TestPlayer.cpp
...a/media/media_cpp_test_standard/player/src/TestPlayer.cpp
+18
-11
multimedia/media/media_cpp_test_standard/player/src/function/ActsPlayerFuncAsyncTest.cpp
..._standard/player/src/function/ActsPlayerFuncAsyncTest.cpp
+177
-471
multimedia/media/media_cpp_test_standard/player/src/function/ActsPlayerFuncTest.cpp
..._test_standard/player/src/function/ActsPlayerFuncTest.cpp
+190
-473
multimedia/media/media_cpp_test_standard/player/src/function/ActsPlayerStateAsyncTest.cpp
...standard/player/src/function/ActsPlayerStateAsyncTest.cpp
+187
-467
multimedia/media/media_cpp_test_standard/player/src/function/ActsPlayerStateTest.cpp
...test_standard/player/src/function/ActsPlayerStateTest.cpp
+187
-465
未找到文件。
multimedia/media/media_cpp_test_standard/include/mediatest_log.h
浏览文件 @
bca7c391
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
...
...
@@ -14,14 +13,17 @@
* limitations under the License.
*/
#ifndef MEDIA_TEST_LOG_H
#define MEDIA_TEST_LOG_H
#include "media_log.h"
#include "securec.h"
#define LOG
MAX
SIZE 200
#define LOG
_MAX_
SIZE 200
#define MEDIA_INFO_LOG(fmt, ...) \
do
{
\
char
ch
[
LOG
MAX
SIZE
];
\
(
void
)
sprintf_s
(
ch
,
LOG
MAX
SIZE
,
fmt
,
##
__VA_ARGS__
);
\
char
ch
[
LOG
_MAX_
SIZE
];
\
(
void
)
sprintf_s
(
ch
,
LOG
_MAX_
SIZE
,
fmt
,
##
__VA_ARGS__
);
\
(
void
)
printf
(
"%s"
,
ch
);
\
(
void
)
printf
(
"
\n
"
);
\
__MEDIA_LOG
(
::
OHOS
::
HiviewDFX
::
HiLog
::
Info
,
"%{public}s"
,
ch
);
\
...
...
@@ -29,15 +31,15 @@ do { \
#define MEDIA_DEBUG_LOG(fmt, ...) \
do
{
\
char
ch
[
LOG
MAX
SIZE
];
\
(
void
)
sprintf_s
(
ch
,
LOG
MAX
SIZE
,
fmt
,
##
__VA_ARGS__
);
\
char
ch
[
LOG
_MAX_
SIZE
];
\
(
void
)
sprintf_s
(
ch
,
LOG
_MAX_
SIZE
,
fmt
,
##
__VA_ARGS__
);
\
__MEDIA_LOG
(
::
OHOS
::
HiviewDFX
::
HiLog
::
Debug
,
"%{public}s"
,
ch
);
\
}
while
(
0
)
#define MEDIA_ERROR_LOG(fmt, ...) \
do
{
\
char
ch
[
LOG
MAX
SIZE
];
\
(
void
)
sprintf_s
(
ch
,
LOG
MAX
SIZE
,
fmt
,
##
__VA_ARGS__
);
\
char
ch
[
LOG
_MAX_
SIZE
];
\
(
void
)
sprintf_s
(
ch
,
LOG
_MAX_
SIZE
,
fmt
,
##
__VA_ARGS__
);
\
(
void
)
printf
(
"%s"
,
ch
);
\
(
void
)
printf
(
"
\n
"
);
\
__MEDIA_LOG
(
::
OHOS
::
HiviewDFX
::
HiLog
::
Error
,
"%{public}s"
,
ch
);
\
...
...
@@ -55,4 +57,5 @@ namespace MediaTest {
const
int
THIRD_ARG
=
3
;
const
int
HEIGHT
=
720
;
const
int
WIDTH
=
1280
;
}
\ No newline at end of file
}
#endif
multimedia/media/media_cpp_test_standard/player/include/ActsPlayerAPITest.h
浏览文件 @
bca7c391
...
...
@@ -25,6 +25,7 @@ public:
static
void
SetUpTestCase
(
void
)
{
MEDIA_DEBUG_LOG
(
"ActsPlayerAPITest::SetUpTestCase"
);
TestPlayerBasic
::
TestParamsConfig
::
GetInstance
().
InitMountPath
();
};
// TearDownTestCase: after all testcases
static
void
TearDownTestCase
(
void
)
...
...
multimedia/media/media_cpp_test_standard/player/include/ActsPlayerFuncTest.h
浏览文件 @
bca7c391
...
...
@@ -25,7 +25,7 @@ public:
static
void
SetUpTestCase
(
void
)
{
MEDIA_DEBUG_LOG
(
"ActsPlayerFuncTest::SetUpTestCase"
);
TestPlayerBasic
::
TestParamsConfig
::
GetInstance
().
Init
PlayProtocol
();
TestPlayerBasic
::
TestParamsConfig
::
GetInstance
().
Init
MountPath
();
};
// TearDownTestCase: after all testcases
static
void
TearDownTestCase
(
void
)
...
...
@@ -35,6 +35,7 @@ public:
// SetUp
void
SetUp
(
void
)
{
uri_
=
TestPlayerBasic
::
TestParamsConfig
::
GetInstance
().
GetUri
();
const
::
testing
::
TestInfo
*
const
testInfo
=
::
testing
::
UnitTest
::
GetInstance
()
->
current_test_info
();
MEDIA_DEBUG_LOG
(
"ActsPlayerFuncTest::SetUp:%s"
,
testInfo
->
name
());
};
...
...
@@ -45,6 +46,10 @@ public:
MEDIA_DEBUG_LOG
(
"ActsPlayerFuncTest::TearDown:%s"
,
testInfo
->
name
());
};
static
void
LocalPlayFunc
(
const
std
::
string
uri
,
bool
isAsync
,
WindowConfig
config
=
g_sub_config
);
void
PreparePlayEnv
(
std
::
shared_ptr
<
TestPlayer
>
&
player
);
std
::
string
uri_
=
""
;
std
::
shared_ptr
<
TestPlayerCallback
>
testCallback_
;
std
::
shared_ptr
<
PlayerSignal
>
testObj_
;
};
}
}
...
...
multimedia/media/media_cpp_test_standard/player/include/TestParamsConfig.h
浏览文件 @
bca7c391
...
...
@@ -37,6 +37,7 @@ namespace {
namespace
TestPlayerBasic
{
class
TestParamsConfig
{
public:
DISALLOW_COPY_AND_MOVE
(
TestParamsConfig
);
static
TestParamsConfig
&
GetInstance
()
{
static
TestParamsConfig
config
;
...
...
@@ -54,7 +55,7 @@ public:
}
bool
CompareTime
(
int32_t
expectTime
,
int32_t
realTme
,
OHOS
::
Media
::
PlayerSeekMode
seekMode
);
std
::
string
GetUri
();
void
Init
PlayProtocol
();
void
Init
MountPath
();
private:
TestParamsConfig
();
...
...
multimedia/media/media_cpp_test_standard/player/include/TestPlayer.h
浏览文件 @
bca7c391
...
...
@@ -46,7 +46,7 @@ static WindowConfig g_sub_config = {
class
PlayerSignal
{
public:
PlayerStates
state_
=
PLAYER_IDLE
;
int32_t
seekPositon_
;
int32_t
seekPosit
i
on_
;
bool
seekDoneFlag_
;
bool
mutexFlag_
=
true
;
std
::
mutex
mutexSeek_
;
...
...
@@ -71,6 +71,7 @@ public:
sptr
<
Window
>
window_
=
nullptr
;
explicit
TestPlayer
(
std
::
shared_ptr
<
PlayerSignal
>
test
);
virtual
~
TestPlayer
();
DISALLOW_COPY_AND_MOVE
(
TestPlayer
);
bool
CreatePlayer
();
int32_t
SetSource
(
const
std
::
string
&
uri
);
int32_t
SetDataSrc
(
const
std
::
string
&
uri
,
bool
seekable
);
...
...
@@ -102,8 +103,9 @@ public:
PlayerStates
state_
=
PLAYER_STATE_ERROR
;
explicit
TestPlayerCallback
(
std
::
shared_ptr
<
PlayerSignal
>
test
);
virtual
~
TestPlayerCallback
();
DISALLOW_COPY_AND_MOVE
(
TestPlayerCallback
);
void
OnError
(
PlayerErrorType
errorType
,
int32_t
errorCode
);
int
WaitForSeekDone
(
int32_t
currentPositon
);
int
WaitForSeekDone
(
int32_t
currentPosit
i
on
);
void
OnInfo
(
PlayerOnInfoType
type
,
int32_t
extra
,
const
Format
&
infoBody
=
{});
int
WaitForState
(
PlayerStates
state
);
private:
...
...
multimedia/media/media_cpp_test_standard/player/src/TestParamsConfig.cpp
浏览文件 @
bca7c391
...
...
@@ -35,28 +35,43 @@ std::string TestParamsConfig::GetUri()
MEDIA_INFO_LOG
(
"PATH : %s"
,
path
);
return
path
;
}
void
TestParamsConfig
::
Init
PlayProtocol
()
void
TestParamsConfig
::
Init
MountPath
()
{
MEDIA_INFO_LOG
(
"%s"
,
__FUNCTION__
);
char
protocol
[
PARA_MAX_LEN
]
=
"loca
l"
;
GetParameter
(
"sys.media.test.
play.protocol"
,
"local"
,
&
protocol
[
0
],
PARA_MAX_LEN
);
if
(
strcmp
(
protocol
,
"local"
)
=
=
0
)
{
TestPlayerBasic
::
TestParamsConfig
::
GetInstance
().
SetMountPath
(
"file://data/media/"
);
MEDIA_INFO_LOG
(
"MOUNT_PATH %s"
,
TestPlayerBasic
::
TestParamsConfig
::
GetInstance
().
GetMountPath
().
c_str
()
);
char
mountPath
[
PARA_MAX_LEN
]
=
"nul
l"
;
GetParameter
(
"sys.media.test.
mount.path"
,
"null"
,
&
mountPath
[
0
],
PARA_MAX_LEN
);
if
(
strcmp
(
mountPath
,
"null"
)
!
=
0
)
{
TestPlayerBasic
::
TestParamsConfig
::
GetInstance
().
SetMountPath
(
mountPath
);
}
else
{
TestPlayerBasic
::
TestParamsConfig
::
GetInstance
().
SetMountPath
(
"file:///data/media/"
);
}
MEDIA_INFO_LOG
(
"MOUNT_PATH %s"
,
TestPlayerBasic
::
TestParamsConfig
::
GetInstance
().
GetMountPath
().
c_str
());
}
bool
TestParamsConfig
::
CompareTime
(
int32_t
expectTime
,
int32_t
realTime
,
OHOS
::
Media
::
PlayerSeekMode
seekMode
)
{
MEDIA_INFO_LOG
(
"CompareTime: expectTime %d, realTime %d"
,
expectTime
,
realTime
);
if
(
seekMode
==
OHOS
::
Media
::
PlayerSeekMode
::
SEEK_CLOSEST
)
{
if
(
seekMode
==
PlayerSeekMode
::
SEEK_CLOSEST
)
{
if
(
std
::
abs
(
expectTime
-
realTime
)
<
CLOSEST_DELTA_TIME
)
{
return
true
;
}
else
{
return
false
;
}
}
if
(
seekMode
==
PlayerSeekMode
::
SEEK_NEXT_SYNC
)
{
if
(
realTime
-
expectTime
<
DELTA_TIME
&&
realTime
-
expectTime
>=
0
)
{
return
true
;
}
else
{
return
false
;
}
}
if
(
seekMode
==
PlayerSeekMode
::
SEEK_PREVIOUS_SYNC
)
{
if
(
expectTime
-
realTime
<
DELTA_TIME
&&
expectTime
-
realTime
>
-
CLOSEST_DELTA_TIME
)
{
return
true
;
}
else
{
return
false
;
}
}
if
(
std
::
abs
(
expectTime
-
realTime
)
<
DELTA_TIME
)
{
return
true
;
}
...
...
multimedia/media/media_cpp_test_standard/player/src/TestPlayer.cpp
浏览文件 @
bca7c391
...
...
@@ -146,7 +146,7 @@ int32_t TestPlayer::Seek(int32_t mseconds, PlayerSeekMode mode)
{
MEDIA_DEBUG_LOG
(
"%s"
,
__FUNCTION__
);
test_
->
seekDoneFlag_
=
false
;
test_
->
seekPositon_
=
mseconds
;
test_
->
seekPosit
i
on_
=
mseconds
;
int32_t
ret
=
player_
->
Seek
(
mseconds
,
mode
);
if
(
ret
==
RET_OK
&&
test_
->
mutexFlag_
==
true
&&
test_
->
seekDoneFlag_
==
false
)
{
std
::
unique_lock
<
std
::
mutex
>
lockSeek
(
test_
->
mutexSeek_
);
...
...
@@ -274,8 +274,8 @@ void TestPlayerCallback::OnInfo(PlayerOnInfoType type, int32_t extra, const Form
case
INFO_TYPE_SEEKDONE
:
seekDoneFlag_
=
true
;
test_
->
SetSeekResult
(
true
);
MEDIA_INFO_LOG
(
"TestPlayerCallback: OnSeekDone currentPositon is %d"
,
extra
);
if
(
abs
(
test_
->
seekPositon_
-
extra
)
<=
DELTA_TIME
)
{
MEDIA_INFO_LOG
(
"TestPlayerCallback: OnSeekDone currentPosit
i
on is %d"
,
extra
);
if
(
abs
(
test_
->
seekPosit
i
on_
-
extra
)
<=
DELTA_TIME
)
{
test_
->
condVarSeek_
.
notify_all
();
}
else
{
test_
->
SetSeekResult
(
false
);
...
...
@@ -299,17 +299,20 @@ void TestPlayerCallback::OnInfo(PlayerOnInfoType type, int32_t extra, const Form
}
}
int
TestPlayerCallback
::
WaitForSeekDone
(
int32_t
currentPositon
)
int
TestPlayerCallback
::
WaitForSeekDone
(
int32_t
currentPosit
i
on
)
{
int64_t
waitTime
=
0
;
auto
start
=
std
::
chrono
::
system_clock
::
now
();
auto
end
=
std
::
chrono
::
system_clock
::
now
();
uint64_t
waitTime
=
std
::
chrono
::
duration_cast
<
std
::
chrono
::
milliseconds
>
(
end
-
start
).
count
();
seekDoneFlag_
=
false
;
while
(
seekDoneFlag_
!=
true
&&
waitTime
<
WAITSECOND
*
TIME_SEC2MS
)
{
(
void
)
usleep
(
WAIT_TIME
);
waitTime
+=
1
;
end
=
std
::
chrono
::
system_clock
::
now
();
waitTime
=
std
::
chrono
::
duration_cast
<
std
::
chrono
::
milliseconds
>
(
end
-
start
).
count
();
}
seekDoneFlag_
=
false
;
if
(
waitTime
>=
WAITSECOND
*
TIME_SEC2MS
)
{
MEDIA_ERROR_LOG
(
"Failed to seek [%d]
s "
,
currentPosit
on
);
MEDIA_ERROR_LOG
(
"Failed to seek [%d]
ms "
,
currentPositi
on
);
return
-
1
;
}
return
0
;
...
...
@@ -317,12 +320,16 @@ int TestPlayerCallback::WaitForSeekDone(int32_t currentPositon)
int
TestPlayerCallback
::
WaitForState
(
PlayerStates
state
)
{
int64_t
waitTime
=
0
;
while
(
state_
!=
state
&&
waitTime
<
WAITSECOND
*
TIME_SEC2MS
)
{
auto
start
=
std
::
chrono
::
system_clock
::
now
();
auto
end
=
std
::
chrono
::
system_clock
::
now
();
uint64_t
waitTime
=
std
::
chrono
::
duration_cast
<
std
::
chrono
::
milliseconds
>
(
end
-
start
).
count
();
const
uint64_t
waitTimeMax
=
4000
;
while
(
state_
!=
state
&&
waitTime
<
waitTimeMax
)
{
(
void
)
usleep
(
WAIT_TIME
);
waitTime
+=
1
;
end
=
std
::
chrono
::
system_clock
::
now
();
waitTime
=
std
::
chrono
::
duration_cast
<
std
::
chrono
::
milliseconds
>
(
end
-
start
).
count
();
}
if
(
waitTime
>=
WAITSECOND
*
TIME_SEC2MS
)
{
if
(
waitTime
>=
waitTimeMax
)
{
MEDIA_ERROR_LOG
(
"Failed to wait for state[%d] down"
,
state
);
return
-
1
;
}
...
...
multimedia/media/media_cpp_test_standard/player/src/function/ActsPlayerFuncAsyncTest.cpp
浏览文件 @
bca7c391
...
...
@@ -23,22 +23,14 @@ using namespace testing::ext;
using
namespace
TestPlayerBasic
;
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_03_0100
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_0100
* @tc.name : 001.进行播放
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_03_0100
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_0100
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
sptr
<
Surface
>
videoSurface
=
player
->
GetVideoSurface
(
g_sub_config
);
EXPECT_EQ
(
RET_OK
,
player
->
SetVideoSurface
(
videoSurface
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -46,27 +38,18 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_0100, Func
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_EQ
(
RET_OK
,
player
->
Release
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_03_0200
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_0200
* @tc.name : 002.进行暂停
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_03_0200
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_0200
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -78,27 +61,18 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_0200, Func
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_03_0300
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_0300
* @tc.name : 003.进行恢复播放
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_03_0300
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_0300
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -114,27 +88,18 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_0300, Func
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_03_0400
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_0400
* @tc.name : 004.进行停止播放
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_03_0400
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_0400
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -142,27 +107,18 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_0400, Func
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_03_0500
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_0500
* @tc.name : 005.进行结束播放
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_03_0500
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_0500
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -170,27 +126,18 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_0500, Func
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_03_0600
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_0600
* @tc.name : 006.暂停后恢复播放,再次暂停
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_03_0600
,
Function
|
MediumTest
|
Level1
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_0600
,
Function
|
MediumTest
|
Level1
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -208,27 +155,18 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_0600, Func
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_03_0700
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_0700
* @tc.name : 007.暂停后结束播放
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_03_0700
,
Function
|
MediumTest
|
Level1
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_0700
,
Function
|
MediumTest
|
Level1
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -236,27 +174,18 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_0700, Func
EXPECT_EQ
(
RET_OK
,
player
->
Pause
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_03_0800
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_0800
* @tc.name : 008.暂停后恢复播放,再结束播放
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_03_0800
,
Function
|
MediumTest
|
Level1
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_0800
,
Function
|
MediumTest
|
Level1
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -268,27 +197,18 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_0800, Func
(
void
)
sleep
(
PLAYING_TIME
);
EXPECT_TRUE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_03_0900
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_0900
* @tc.name : 009.停止播放后重新开始播放,暂停后恢复播放,再结束播放
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_03_0900
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_0900
,
Function
|
MediumTest
|
Level2
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -306,27 +226,18 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_0900, Func
(
void
)
sleep
(
PLAYING_TIME
);
EXPECT_TRUE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_03_1000
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_1000
* @tc.name : 010.停止播放后重新开始播放,暂停后结束播放
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_03_1000
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_1000
,
Function
|
MediumTest
|
Level2
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -340,54 +251,35 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_1000, Func
EXPECT_EQ
(
RET_OK
,
player
->
Pause
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_03_1100
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_1100
* @tc.name : 011.停止播放后重新开始播放,再次结束播放
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_03_1100
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_1100
,
Function
|
MediumTest
|
Level2
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
EXPECT_TRUE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_03_1300
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_1300
* @tc.name : 013.停止播放后暂停
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_03_1300
,
Function
|
MediumTest
|
Level1
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_1300
,
Function
|
MediumTest
|
Level1
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -396,28 +288,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_1300, Func
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_NE
(
RET_OK
,
player
->
Pause
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_03_1400
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_1400
* @tc.name : 014.开始播放,进行Seek,再暂停
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_03_1400
,
Function
|
MediumTest
|
Level1
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_1400
,
Function
|
MediumTest
|
Level1
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -430,28 +313,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_1400, Func
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_03_1500
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_1500
* @tc.name : 015.开始播放,暂停后进行Seek,再恢复播放
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_03_1500
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_1500
,
Function
|
MediumTest
|
Level2
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -468,28 +342,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_1500, Func
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_03_1600
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_1600
* @tc.name : 016.开始播放,暂停后恢复播放,进行Seek,再暂停
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_03_1600
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_1600
,
Function
|
MediumTest
|
Level2
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -510,28 +375,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_1600, Func
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_03_1700
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_1700
* @tc.name : 017.开始播放,进行Seek
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_03_1700
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_1700
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -543,28 +399,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_1700, Func
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_03_1800
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_1800
* @tc.name : 018.开始播放,进行Seek,停止播放,
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_03_1800
,
Function
|
MediumTest
|
Level1
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_1800
,
Function
|
MediumTest
|
Level1
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -578,28 +425,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_1800, Func
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_03_1900
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_1900
* @tc.name : 019.开始播放,停止播放,进行Seek
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_03_1900
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_1900
,
Function
|
MediumTest
|
Level2
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -615,29 +453,20 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_1900, Func
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_03_2000
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_2000
* @tc.name : 020.开始播放,暂停后进行Seek
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_03_2000
,
Function
|
MediumTest
|
Level1
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_2000
,
Function
|
MediumTest
|
Level1
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -659,29 +488,20 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_2000, Func
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_03_2100
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_2100
* @tc.name : 021.开始播放,暂停后进行Seek,停止播放
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_03_2100
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_2100
,
Function
|
MediumTest
|
Level2
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -700,28 +520,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_2100, Func
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_03_2200
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_2200
* @tc.name : 022.开始播放,暂停后恢复播放,进行Seek
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_03_2200
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_2200
,
Function
|
MediumTest
|
Level2
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -738,28 +549,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_2200, Func
EXPECT_NEAR
(
PLAYING_TIME
*
TIME_SEC2MS
+
SEEK_TIME_5_SEC
,
time
,
DELTA_TIME
);
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_03_2300
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_2300
* @tc.name : 023.开始播放,暂停后恢复播放,进行Seek,停止播放
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_03_2300
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_2300
,
Function
|
MediumTest
|
Level2
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -779,28 +581,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_2300, Func
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_03_2400
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_2400
* @tc.name : 024.开始播放,停止播放,进行Seek,重新播放
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_03_2400
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_2400
,
Function
|
MediumTest
|
Level2
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -819,28 +612,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_2400, Func
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_03_2500
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_2500
* @tc.name : 025.进行Seek,Seek到文件开始的位置
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_03_2500
,
Function
|
MediumTest
|
Level1
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_2500
,
Function
|
MediumTest
|
Level1
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -852,28 +636,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_2500, Func
EXPECT_TRUE
(
TestParamsConfig
::
GetInstance
().
CompareTime
(
FILE_BEGIN
,
time
,
SEEK_MODE
));
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_03_2600
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_2600
* @tc.name : 026.开始播放,停止播放,进行Seek,再暂停
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_03_2600
,
Function
|
MediumTest
|
Level3
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_2600
,
Function
|
MediumTest
|
Level3
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -890,28 +665,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_2600, Func
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_03_2700
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_2700
* @tc.name : 027.开始播放,停止播放,进行Seek,再进行恢复播放操作
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_03_2700
,
Function
|
MediumTest
|
Level3
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_2700
,
Function
|
MediumTest
|
Level3
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -931,29 +697,20 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_2700, Func
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_03_2800
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_2800
* @tc.name : 028.进行Seek,Seek到文件结尾的位置
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_03_2800
,
Function
|
MediumTest
|
Level1
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_2800
,
Function
|
MediumTest
|
Level1
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -961,34 +718,25 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_2800, Func
EXPECT_EQ
(
RET_OK
,
player
->
GetDuration
(
durationTime
));
EXPECT_EQ
(
RET_OK
,
player
->
Seek
(
durationTime
,
SEEK_MODE
));
EXPECT_EQ
(
RET_OK
,
testCallback
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_TRUE
(
TestParamsConfig
::
GetInstance
().
CompareTime
(
durationTime
,
time
,
SEEK_MODE
));
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_03_2900
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_2900
* @tc.name : 029.进行Seek,Seek到超过文件结尾的位置
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_03_2900
,
Function
|
MediumTest
|
Level3
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_2900
,
Function
|
MediumTest
|
Level3
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -996,36 +744,27 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_2900, Func
EXPECT_EQ
(
RET_OK
,
player
->
GetDuration
(
durationTime
));
EXPECT_EQ
(
RET_OK
,
player
->
Seek
(
durationTime
+
1
,
SEEK_MODE
));
EXPECT_EQ
(
RET_OK
,
testCallback
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_TRUE
(
TestParamsConfig
::
GetInstance
().
CompareTime
(
durationTime
,
time
,
SEEK_MODE
));
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_03_3000
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_3000
* @tc.name : 030.进行Seek,Seek到文件随机的位置
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_03_3000
,
Function
|
MediumTest
|
Level1
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_3000
,
Function
|
MediumTest
|
Level1
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -1038,29 +777,20 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_3000, Func
EXPECT_TRUE
(
TestParamsConfig
::
GetInstance
().
CompareTime
(
durationTime
/
3
,
time
,
SEEK_MODE
));
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_03_3100
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_3100
* @tc.name : 031.进行Seek,seek后开始进行基本播控操作
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_03_3100
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_3100
,
Function
|
MediumTest
|
Level2
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -1079,28 +809,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_3100, Func
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_03_3200
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_3200
* @tc.name : 032.暂停时Seek到文件开始,恢复播放
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_03_3200
,
Function
|
MediumTest
|
Level1
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_3200
,
Function
|
MediumTest
|
Level1
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -1117,29 +838,20 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_3200, Func
EXPECT_TRUE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_03_3300
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_3300
* @tc.name : 033.暂停时Seek到文件结尾,恢复播放
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_03_3300
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_3300
,
Function
|
MediumTest
|
Level2
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -1153,35 +865,26 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_3300, Func
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_TRUE
(
TestParamsConfig
::
GetInstance
().
CompareTime
(
durationTime
,
time
,
SEEK_MODE
));
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
(
void
)
sleep
(
PLAYING_TIME
);
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_
FALS
E
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
EXPECT_
TRU
E
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_03_3400
* @tc.name : 034.暂停时Seek到超过文件结尾的位置,
恢复播放
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_3400
* @tc.name : 034.暂停时Seek到超过文件结尾的位置,
Seek
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_03_3400
,
Function
|
MediumTest
|
Level3
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_03_3400
,
Function
|
MediumTest
|
Level3
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -1196,8 +899,11 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_03_3400, Func
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_TRUE
(
TestParamsConfig
::
GetInstance
().
CompareTime
(
durationTime
,
time
,
SEEK_MODE
));
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_EQ
(
RET_OK
,
testCallback_
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_EQ
(
RET_OK
,
player
->
Seek
(
SEEK_TIME_5_SEC
,
SEEK_MODE
));
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_TRUE
(
TestParamsConfig
::
GetInstance
().
CompareTime
(
SEEK_TIME_5_SEC
,
time
,
SEEK_MODE
));
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
}
\ No newline at end of file
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_EQ
(
RET_OK
,
testCallback_
->
errorNum_
);
}
multimedia/media/media_cpp_test_standard/player/src/function/ActsPlayerFuncTest.cpp
浏览文件 @
bca7c391
...
...
@@ -22,23 +22,29 @@ using namespace OHOS::Media;
using
namespace
testing
::
ext
;
using
namespace
TestPlayerBasic
;
/**
* @tc.number : SUB_MEDIA_PLAYER_Local_Function_03_0100
* @tc.name : 001.进行播放
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_Local_Function_03_0100
,
Function
|
MediumTest
|
Level0
)
void
ActsPlayerFuncTest
::
PreparePlayEnv
(
std
::
shared_ptr
<
TestPlayer
>
&
player
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
testObj_
=
std
::
make_shared
<
PlayerSignal
>
();
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj_
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
printf
(
"PreparePlayEnv source is %s"
,
uri_
.
c_str
()
);
ASSERT_EQ
(
RET_OK
,
player
->
SetSource
(
uri
_
));
testCallback_
=
std
::
make_shared
<
TestPlayerCallback
>
(
testObj_
);
EXPECT_EQ
(
RET_OK
,
player
->
SetPlayerCallback
(
testCallback
_
));
sptr
<
Surface
>
videoSurface
=
player
->
GetVideoSurface
(
g_sub_config
);
EXPECT_EQ
(
RET_OK
,
player
->
SetVideoSurface
(
videoSurface
));
}
/**
* @tc.number : SUB_MEDIA_PLAYER_FUNCTION_03_0100
* @tc.name : 001.进行播放
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_FUNCTION_03_0100
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -46,30 +52,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_0100, Function |
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_EQ
(
RET_OK
,
player
->
Release
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_03_0200
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_03_0200
* @tc.name : 002.进行暂停
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_03_0200
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_03_0200
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
EXPECT_TRUE
(
player
->
IsPlaying
());
...
...
@@ -79,28 +74,18 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_0200, Function |
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_03_0300
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_03_0300
* @tc.name : 003.进行恢复播放
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_03_0300
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_03_0300
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -116,27 +101,18 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_0300, Function |
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_03_0400
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_03_0400
* @tc.name : 004.进行停止播放
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_03_0400
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_03_0400
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -144,27 +120,18 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_0400, Function |
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_03_0500
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_03_0500
* @tc.name : 005.进行结束播放
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_03_0500
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_03_0500
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -172,27 +139,18 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_0500, Function |
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_03_0600
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_03_0600
* @tc.name : 006.暂停后恢复播放,再次暂停
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_03_0600
,
Function
|
MediumTest
|
Level1
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_03_0600
,
Function
|
MediumTest
|
Level1
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -210,27 +168,18 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_0600, Function |
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_03_0700
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_03_0700
* @tc.name : 007.暂停后结束播放
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_03_0700
,
Function
|
MediumTest
|
Level1
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_03_0700
,
Function
|
MediumTest
|
Level1
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -239,27 +188,18 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_0700, Function |
EXPECT_EQ
(
RET_OK
,
player
->
Pause
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_03_0800
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_03_0800
* @tc.name : 008.暂停后恢复播放,再结束播放
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_03_0800
,
Function
|
MediumTest
|
Level1
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_03_0800
,
Function
|
MediumTest
|
Level1
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -271,27 +211,18 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_0800, Function |
(
void
)
sleep
(
PLAYING_TIME
);
EXPECT_TRUE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_03_0900
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_03_0900
* @tc.name : 009.停止播放后重新开始播放,暂停后恢复播放,再结束播放
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_03_0900
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_03_0900
,
Function
|
MediumTest
|
Level2
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -309,27 +240,18 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_0900, Function |
(
void
)
sleep
(
PLAYING_TIME
);
EXPECT_TRUE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_03_1000
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_03_1000
* @tc.name : 010.停止播放后重新开始播放,暂停后结束播放
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_03_1000
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_03_1000
,
Function
|
MediumTest
|
Level2
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -344,54 +266,35 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_1000, Function |
EXPECT_EQ
(
RET_OK
,
player
->
Pause
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_03_1100
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_03_1100
* @tc.name : 011.停止播放后重新开始播放,再次结束播放
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_03_1100
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_03_1100
,
Function
|
MediumTest
|
Level2
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
EXPECT_TRUE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_03_1300
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_03_1300
* @tc.name : 013.停止播放后暂停
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_03_1300
,
Function
|
MediumTest
|
Level1
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_03_1300
,
Function
|
MediumTest
|
Level1
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -401,28 +304,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_1300, Function |
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_NE
(
RET_OK
,
player
->
Pause
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_03_1400
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_03_1400
* @tc.name : 014.开始播放,进行Seek,再暂停
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_03_1400
,
Function
|
MediumTest
|
Level1
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_03_1400
,
Function
|
MediumTest
|
Level1
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -436,28 +330,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_1400, Function |
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_03_1500
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_03_1500
* @tc.name : 015.开始播放,暂停后进行Seek,再恢复播放
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_03_1500
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_03_1500
,
Function
|
MediumTest
|
Level2
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -475,28 +360,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_1500, Function |
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_03_1600
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_03_1600
* @tc.name : 016.开始播放,暂停后恢复播放,进行Seek,再暂停
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_03_1600
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_03_1600
,
Function
|
MediumTest
|
Level2
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -518,28 +394,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_1600, Function |
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_03_1700
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_03_1700
* @tc.name : 017.开始播放,进行Seek
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_03_1700
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_03_1700
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -552,28 +419,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_1700, Function |
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_03_1800
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_03_1800
* @tc.name : 018.开始播放,进行Seek,停止播放,
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_03_1800
,
Function
|
MediumTest
|
Level1
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_03_1800
,
Function
|
MediumTest
|
Level1
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -588,28 +446,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_1800, Function |
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_03_1900
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_03_1900
* @tc.name : 019.开始播放,停止播放,进行Seek
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_03_1900
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_03_1900
,
Function
|
MediumTest
|
Level2
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -626,29 +475,20 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_1900, Function |
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_03_2000
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_03_2000
* @tc.name : 020.开始播放,暂停后进行Seek
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_03_2000
,
Function
|
MediumTest
|
Level1
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_03_2000
,
Function
|
MediumTest
|
Level1
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -672,29 +512,20 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_2000, Function |
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_03_2100
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_03_2100
* @tc.name : 021.开始播放,暂停后进行Seek,停止播放
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_03_2100
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_03_2100
,
Function
|
MediumTest
|
Level2
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -714,28 +545,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_2100, Function |
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_03_2200
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_03_2200
* @tc.name : 022.开始播放,暂停后恢复播放,进行Seek
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_03_2200
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_03_2200
,
Function
|
MediumTest
|
Level2
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -753,28 +575,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_2200, Function |
EXPECT_NEAR
(
PLAYING_TIME
*
TIME_SEC2MS
+
SEEK_TIME_5_SEC
,
time
,
DELTA_TIME
);
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_03_2300
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_03_2300
* @tc.name : 023.开始播放,暂停后恢复播放,进行Seek,停止播放
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_03_2300
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_03_2300
,
Function
|
MediumTest
|
Level2
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -795,28 +608,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_2300, Function |
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_03_2400
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_03_2400
* @tc.name : 024.开始播放,停止播放,进行Seek,重新播放
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_03_2400
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_03_2400
,
Function
|
MediumTest
|
Level2
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -836,28 +640,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_2400, Function |
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_03_2500
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_03_2500
* @tc.name : 025.进行Seek,Seek到文件开始的位置
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_03_2500
,
Function
|
MediumTest
|
Level1
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_03_2500
,
Function
|
MediumTest
|
Level1
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -870,28 +665,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_2500, Function |
EXPECT_TRUE
(
TestParamsConfig
::
GetInstance
().
CompareTime
(
FILE_BEGIN
,
time
,
SEEK_MODE
));
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_03_2600
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_03_2600
* @tc.name : 026.开始播放,停止播放,进行Seek,再暂停
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_03_2600
,
Function
|
MediumTest
|
Level3
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_03_2600
,
Function
|
MediumTest
|
Level3
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -909,28 +695,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_2600, Function |
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_03_2700
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_03_2700
* @tc.name : 027.开始播放,停止播放,进行Seek,再进行恢复播放操作
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_03_2700
,
Function
|
MediumTest
|
Level3
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_03_2700
,
Function
|
MediumTest
|
Level3
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -951,29 +728,20 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_2700, Function |
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_03_2800
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_03_2800
* @tc.name : 028.进行Seek,Seek到文件结尾的位置
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_03_2800
,
Function
|
MediumTest
|
Level1
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_03_2800
,
Function
|
MediumTest
|
Level1
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -982,34 +750,25 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_2800, Function |
EXPECT_EQ
(
RET_OK
,
player
->
GetDuration
(
durationTime
));
EXPECT_EQ
(
RET_OK
,
player
->
Seek
(
durationTime
,
SEEK_MODE
));
EXPECT_EQ
(
RET_OK
,
testCallback
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_TRUE
(
TestParamsConfig
::
GetInstance
().
CompareTime
(
durationTime
,
time
,
SEEK_MODE
));
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_03_2900
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_03_2900
* @tc.name : 029.进行Seek,Seek到超过文件结尾的位置
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_03_2900
,
Function
|
MediumTest
|
Level3
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_03_2900
,
Function
|
MediumTest
|
Level3
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -1018,36 +777,27 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_2900, Function |
EXPECT_EQ
(
RET_OK
,
player
->
GetDuration
(
durationTime
));
EXPECT_EQ
(
RET_OK
,
player
->
Seek
(
durationTime
+
1
,
SEEK_MODE
));
EXPECT_EQ
(
RET_OK
,
testCallback
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_TRUE
(
TestParamsConfig
::
GetInstance
().
CompareTime
(
durationTime
,
time
,
SEEK_MODE
));
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_03_3000
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_03_3000
* @tc.name : 030.进行Seek,Seek到文件随机的位置
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_03_3000
,
Function
|
MediumTest
|
Level1
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_03_3000
,
Function
|
MediumTest
|
Level1
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -1061,29 +811,20 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_3000, Function |
EXPECT_TRUE
(
TestParamsConfig
::
GetInstance
().
CompareTime
(
durationTime
/
3
,
time
,
SEEK_MODE
));
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_03_3100
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_03_3100
* @tc.name : 031.进行Seek,seek后开始进行基本播控操作
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_03_3100
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_03_3100
,
Function
|
MediumTest
|
Level2
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -1104,28 +845,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_3100, Function |
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_03_3200
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_03_3200
* @tc.name : 032.暂停时Seek到文件开始,恢复播放
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_03_3200
,
Function
|
MediumTest
|
Level1
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_03_3200
,
Function
|
MediumTest
|
Level1
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -1144,29 +876,20 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_3200, Function |
EXPECT_TRUE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_03_3300
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_03_3300
* @tc.name : 033.暂停时Seek到文件结尾,恢复播放
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_03_3300
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_03_3300
,
Function
|
MediumTest
|
Level2
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -1181,35 +904,26 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_3300, Function |
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_TRUE
(
TestParamsConfig
::
GetInstance
().
CompareTime
(
durationTime
,
time
,
SEEK_MODE
));
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
(
void
)
sleep
(
PLAYING_TIME
);
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_
FALS
E
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
EXPECT_
TRU
E
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_03_3400
* @tc.name : 034.暂停时Seek到超过文件结尾的位置,
恢复播放
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_03_3400
* @tc.name : 034.暂停时Seek到超过文件结尾的位置,
Seek
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_03_3400
,
Function
|
MediumTest
|
Level3
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_03_3400
,
Function
|
MediumTest
|
Level3
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -1224,8 +938,11 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_03_3400, Function |
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_TRUE
(
TestParamsConfig
::
GetInstance
().
CompareTime
(
durationTime
,
time
,
SEEK_MODE
));
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_EQ
(
RET_OK
,
testCallback_
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_EQ
(
RET_OK
,
player
->
Seek
(
SEEK_TIME_5_SEC
,
SEEK_MODE
));
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_TRUE
(
TestParamsConfig
::
GetInstance
().
CompareTime
(
SEEK_TIME_5_SEC
,
time
,
SEEK_MODE
));
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_EQ
(
RET_OK
,
testCallback_
->
errorNum_
);
}
\ No newline at end of file
multimedia/media/media_cpp_test_standard/player/src/function/ActsPlayerStateAsyncTest.cpp
浏览文件 @
bca7c391
...
...
@@ -23,125 +23,79 @@ using namespace testing::ext;
using
namespace
TestPlayerBasic
;
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_04_0100
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_0100
* @tc.name : 001.prepare-reset-release
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_04_0100
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_0100
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Release
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_04_0200
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_0200
* @tc.name : 002.prepare-reset
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_04_0200
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_0200
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_04_0300
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_0300
* @tc.name : 003.prepare-stop-reset-release
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_04_0300
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_0300
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Release
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_04_0400
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_0400
* @tc.name : 004.prepare-stop-reset
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_04_0400
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_0400
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_04_0600
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_0600
* @tc.name : 006.prepare-play-reset
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_04_0600
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_0600
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
EXPECT_TRUE
(
player
->
IsPlaying
());
...
...
@@ -151,27 +105,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_0600, Func
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_04_0700
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_0700
* @tc.name : 007.prepare-seek-play-reset-release
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_04_0700
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_0700
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -183,27 +129,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_0700, Func
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Release
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_04_0800
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_0800
* @tc.name : 008.prepare-seek-play-reset
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_04_0800
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_0800
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Seek
(
SEEK_TIME_5_SEC
,
SEEK_MODE
));
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -215,27 +153,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_0800, Func
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_04_0900
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_0900
* @tc.name : 009.prepare-play-seek-reset-release
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_04_0900
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_0900
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -249,27 +179,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_0900, Func
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Release
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_04_1000
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_1000
* @tc.name : 010.prepare-play-seek-reset
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_04_1000
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_1000
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -282,27 +204,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_1000, Func
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_04_1100
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_1100
* @tc.name : 011.prepare-play-seek-pause-reset
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_04_1100
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_1100
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -317,27 +231,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_1100, Func
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_04_1200
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_1200
* @tc.name : 012.prepare-play-seek-pause-reset-release
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_04_1200
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_1200
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -354,27 +260,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_1200, Func
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Release
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_04_1300
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_1300
* @tc.name : 013.prepare-play-seek-pause-stop-reset
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_04_1300
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_1300
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -391,30 +289,21 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_1300, Func
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_04_1400
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_1400
* @tc.name : 014.prepare-play-seek-pause-stop-reset-release
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_04_1400
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_1400
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
EXPECT_TRUE
(
player
->
IsPlaying
());
...
...
@@ -430,26 +319,18 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_1400, Func
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Release
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_04_1500
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_1500
* @tc.name : 015.prepare-play-stop-reset
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_04_1500
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_1500
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -459,26 +340,18 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_1500, Func
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_04_1600
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_1600
* @tc.name : 016.prepare-play-stop-reset-release
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_04_1600
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_1600
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -489,52 +362,36 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_1600, Func
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Release
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_04_1700
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_1700
* @tc.name : 017.prepare-stop
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_04_1700
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_1700
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_04_1800
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_1800
* @tc.name : 018.pause-GetCurrentTime-play-GetCurrentTime
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_04_1800
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_1800
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
...
...
@@ -552,27 +409,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_1800, Func
EXPECT_TRUE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_NEAR
(
PLAYING_TIME
*
TIME_SEC2MS
+
PLAYING_TIME
*
TIME_SEC2MS
,
time
,
DELTA_TIME
);
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_04_1900
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_1900
* @tc.name : 019.pause-GetCurrentTime-seek-play-GetCurrentTime
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_04_1900
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_1900
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
...
...
@@ -594,29 +443,20 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_1900, Func
EXPECT_TRUE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_NEAR
(
SEEK_TIME_2_SEC
+
PLAYING_TIME
*
TIME_SEC2MS
,
time
,
DELTA_TIME
);
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_04_2000
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_2000
* @tc.name : 020.play-seek EOS-GetCurrentTime-进入PlaybackCompleted,loop=0
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_04_2000
,
Function
|
MediumTest
|
Level1
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_2000
,
Function
|
MediumTest
|
Level1
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
...
...
@@ -627,7 +467,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_MODE
));
EXPECT_EQ
(
RET_OK
,
testCallback
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_TRUE
(
TestParamsConfig
::
GetInstance
().
CompareTime
(
durationTime
,
time
,
SEEK_MODE
));
EXPECT_FALSE
(
player
->
IsLooping
());
...
...
@@ -635,29 +475,20 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_2000, Func
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_EQ
(
FILE_BEGIN
,
time
);
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_04_2100
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_2100
* @tc.name : 021.seek EOS-GetCurrentTime-进入PlaybackCompleted,loop=0
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_04_2100
,
Function
|
MediumTest
|
Level1
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_2100
,
Function
|
MediumTest
|
Level1
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
SetLooping
(
false
));
...
...
@@ -670,31 +501,22 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_2100, Func
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_EQ
(
FILE_BEGIN
,
time
);
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_04_2200
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_2200
* @tc.name : 022.play-seek EOS-GetCurrentTime,loop=1
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_04_2200
,
Function
|
MediumTest
|
Level1
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_2200
,
Function
|
MediumTest
|
Level1
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time_before
;
int32_t
time_after
;
int32_t
time
;
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
...
...
@@ -715,29 +537,20 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_2200, Func
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_EQ
(
FILE_BEGIN
,
time
);
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_04_2300
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_2300
* @tc.name : 023.prepare-play-seek EOS-GetCurrentTime-进入PlaybackCompleted-stop,loop=0
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_04_2300
,
Function
|
MediumTest
|
Level1
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_2300
,
Function
|
MediumTest
|
Level1
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -747,36 +560,27 @@ 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_MODE
));
EXPECT_EQ
(
RET_OK
,
testCallback
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_TRUE
(
TestParamsConfig
::
GetInstance
().
CompareTime
(
durationTime
,
time
,
SEEK_MODE
));
EXPECT_FALSE
(
player
->
IsLooping
());
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_04_2400
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_2400
* @tc.name : 024.seek,seek随机+EOS附近
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_04_2400
,
Function
|
MediumTest
|
Level1
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_2400
,
Function
|
MediumTest
|
Level1
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
...
...
@@ -788,218 +592,160 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_2400, Func
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_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_04_2500
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_2500
* @tc.name : 025.pause-seek-resume,不等seek完成
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_04_2500
,
Function
|
MediumTest
|
Level3
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_2500
,
Function
|
MediumTest
|
Level3
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
EXPECT_TRUE
(
player
->
IsPlaying
());
testObj
->
mutexFlag_
=
false
;
testObj
_
->
mutexFlag_
=
false
;
EXPECT_EQ
(
RET_OK
,
player
->
Seek
(
SEEK_TIME_5_SEC
,
SEEK_MODE
));
testObj
->
mutexFlag_
=
true
;
testObj
_
->
mutexFlag_
=
true
;
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
EXPECT_TRUE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_NEAR
(
SEEK_TIME_5_SEC
+
PLAYING_TIME
*
TIME_SEC2MS
,
time
,
DELTA_TIME
);
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_04_2600
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_2600
* @tc.name : 026.seek,不等seek完成,seek
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_04_2600
,
Function
|
MediumTest
|
Level3
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_2600
,
Function
|
MediumTest
|
Level3
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
EXPECT_TRUE
(
player
->
IsPlaying
());
testObj
->
mutexFlag_
=
false
;
testObj
_
->
mutexFlag_
=
false
;
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
;
testObj
_
->
mutexFlag_
=
true
;
EXPECT_EQ
(
RET_OK
,
player
->
Seek
(
SEEK_TIME_5_SEC
,
SEEK_MODE
));
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_TRUE
(
TestParamsConfig
::
GetInstance
().
CompareTime
(
SEEK_TIME_5_SEC
,
time
,
SEEK_MODE
));
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_04_2625
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_2625
* @tc.name : 026.seek,不等seek完成,pause
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_04_2625
,
Function
|
MediumTest
|
Level3
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_2625
,
Function
|
MediumTest
|
Level3
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
EXPECT_TRUE
(
player
->
IsPlaying
());
testObj
->
mutexFlag_
=
false
;
testObj
_
->
mutexFlag_
=
false
;
EXPECT_EQ
(
RET_OK
,
player
->
Seek
(
SEEK_TIME_2_SEC
,
SEEK_MODE
));
testObj
->
mutexFlag_
=
true
;
testObj
_
->
mutexFlag_
=
true
;
EXPECT_EQ
(
RET_OK
,
player
->
Pause
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_04_2650
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_2650
* @tc.name : 026.seek,不等seek完成,GetDuration
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_04_2650
,
Function
|
MediumTest
|
Level3
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_2650
,
Function
|
MediumTest
|
Level3
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
EXPECT_TRUE
(
player
->
IsPlaying
());
testObj
->
mutexFlag_
=
false
;
testObj
_
->
mutexFlag_
=
false
;
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_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_04_2651
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_2651
* @tc.name : 026.seek,不等seek完成,GetCurrentTime
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_04_2651
,
Function
|
MediumTest
|
Level3
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_2651
,
Function
|
MediumTest
|
Level3
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
EXPECT_TRUE
(
player
->
IsPlaying
());
testObj
->
mutexFlag_
=
false
;
testObj
_
->
mutexFlag_
=
false
;
EXPECT_EQ
(
RET_OK
,
player
->
Seek
(
SEEK_TIME_2_SEC
,
SEEK_MODE
));
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_NEAR
(
PLAYING_TIME
*
TIME_SEC2MS
,
time
,
DELTA_TIME
);
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_04_2675
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_2675
* @tc.name : 026.seek,不等seek完成,play
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_04_2675
,
Function
|
MediumTest
|
Level3
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_2675
,
Function
|
MediumTest
|
Level3
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
EXPECT_TRUE
(
player
->
IsPlaying
());
testObj
->
mutexFlag_
=
false
;
testObj
_
->
mutexFlag_
=
false
;
EXPECT_EQ
(
RET_OK
,
player
->
Seek
(
SEEK_TIME_2_SEC
,
SEEK_MODE
));
testObj
->
mutexFlag_
=
true
;
testObj
_
->
mutexFlag_
=
true
;
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_NEAR
(
PLAYING_TIME
*
TIME_SEC2MS
,
time
,
DELTA_TIME
);
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_04_2700
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_2700
* @tc.name : 027.prepare-seek未完成-seek eos-start-seek eos-start-stop
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_04_2700
,
Function
|
MediumTest
|
Level3
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_2700
,
Function
|
MediumTest
|
Level3
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
...
...
@@ -1012,32 +758,23 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_2700, Func
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_TRUE
(
TestParamsConfig
::
GetInstance
().
CompareTime
(
durationTime
,
time
,
SEEK_MODE
));
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_04_2800
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_2800
* @tc.name : 028.prepare-start-pause-seek eos-stop-prepare-start-stop
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_04_2800
,
Function
|
MediumTest
|
Level3
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_2800
,
Function
|
MediumTest
|
Level3
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -1056,29 +793,20 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_2800, Func
EXPECT_TRUE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_04_2900
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_2900
* @tc.name : 029.prepare-seek eos-start-stop-prepare-seek eos-start-stop,loop=1
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_04_2900
,
Function
|
MediumTest
|
Level3
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_2900
,
Function
|
MediumTest
|
Level3
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
SetLooping
(
true
));
...
...
@@ -1087,40 +815,32 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_2900, Func
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_TRUE
(
TestParamsConfig
::
GetInstance
().
CompareTime
(
durationTime
,
time
,
SEEK_MODE
));
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
EXPECT_NE
(
RET_OK
,
testCallback
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_NE
(
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_MODE
));
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_TRUE
(
TestParamsConfig
::
GetInstance
().
CompareTime
(
durationTime
,
time
,
SEEK_MODE
));
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
EXPECT_NE
(
RET_OK
,
testCallback
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_NE
(
RET_OK
,
testCallback_
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_TRUE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Async_Function
_04_3000
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_3000
* @tc.name : 030.prepare-start-pause-seek eos-start-stop-prepare-start-pause-seek-start-stop,loop=1
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Async_Function
_04_3000
,
Function
|
MediumTest
|
Level3
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION_ASYNC
_04_3000
,
Function
|
MediumTest
|
Level3
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
int32_t
time_before
;
int32_t
time_after
;
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
PrepareAsync
());
EXPECT_EQ
(
RET_OK
,
player
->
SetLooping
(
true
));
...
...
@@ -1131,7 +851,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_3000, Func
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_TRUE
(
TestParamsConfig
::
GetInstance
().
CompareTime
(
durationTime
,
time
,
SEEK_MODE
));
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
EXPECT_NE
(
RET_OK
,
testCallback
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_NE
(
RET_OK
,
testCallback
_
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time_before
));
(
void
)
sleep
(
PLAYING_TIME
);
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time_after
));
...
...
@@ -1147,6 +867,6 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_3000, Func
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_EQ
(
FILE_BEGIN
,
time
);
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
multimedia/media/media_cpp_test_standard/player/src/function/ActsPlayerStateTest.cpp
浏览文件 @
bca7c391
...
...
@@ -23,128 +23,83 @@ using namespace testing::ext;
using
namespace
TestPlayerBasic
;
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_04_0100
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_04_0100
* @tc.name : 001.prepare-reset-release
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_04_0100
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_04_0100
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Release
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_04_0200
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_04_0200
* @tc.name : 002.prepare-reset
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_04_0200
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_04_0200
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_04_0300
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_04_0300
* @tc.name : 003.prepare-stop-reset-release
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_04_0300
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_04_0300
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Release
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_04_0400
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_04_0400
* @tc.name : 004.prepare-stop-reset
* @tc.desc : 播控
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_04_0400
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_04_0400
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_04_0600
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_04_0600
* @tc.name : 006.prepare-play-reset
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_04_0600
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_04_0600
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -155,27 +110,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_0600, Function |
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_04_0700
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_04_0700
* @tc.name : 007.prepare-seek-play-reset-release
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_04_0700
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_04_0700
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -188,27 +135,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_0700, Function |
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Release
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_04_0800
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_04_0800
* @tc.name : 008.prepare-seek-play-reset
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_04_0800
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_04_0800
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Seek
(
SEEK_TIME_5_SEC
,
SEEK_MODE
));
...
...
@@ -221,27 +160,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_0800, Function |
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_04_0900
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_04_0900
* @tc.name : 009.prepare-play-seek-reset-release
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_04_0900
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_04_0900
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -255,27 +186,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_0900, Function |
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Release
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_04_1000
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_04_1000
* @tc.name : 010.prepare-play-seek-reset
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_04_1000
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_04_1000
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -288,27 +211,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_1000, Function |
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_04_1100
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_04_1100
* @tc.name : 011.prepare-play-seek-pause-reset
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_04_1100
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_04_1100
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -323,27 +238,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_1100, Function |
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_04_1200
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_04_1200
* @tc.name : 012.prepare-play-seek-pause-reset-release
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_04_1200
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_04_1200
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
...
...
@@ -359,27 +266,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_1200, Function |
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Release
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_04_1300
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_04_1300
* @tc.name : 013.prepare-play-seek-pause-stop-reset
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_04_1300
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_04_1300
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -396,27 +295,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_1300, Function |
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_04_1400
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_04_1400
* @tc.name : 014.prepare-play-seek-pause-stop-reset-release
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_04_1400
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_04_1400
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
...
...
@@ -435,26 +326,18 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_1400, Function |
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Release
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_04_1500
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_04_1500
* @tc.name : 015.prepare-play-stop-reset
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_04_1500
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_04_1500
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -464,26 +347,18 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_1500, Function |
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_04_1600
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_04_1600
* @tc.name : 016.prepare-play-stop-reset-release
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_04_1600
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_04_1600
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -494,52 +369,36 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_1600, Function |
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Release
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_04_1700
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_04_1700
* @tc.name : 017.prepare-stop
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_04_1700
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_04_1700
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_04_1800
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_04_1800
* @tc.name : 018.pause-GetCurrentTime-play-GetCurrentTime
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_04_1800
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_04_1800
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
...
...
@@ -557,27 +416,19 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_1800, Function |
EXPECT_TRUE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_NEAR
(
PLAYING_TIME
*
TIME_SEC2MS
+
PLAYING_TIME
*
TIME_SEC2MS
,
time
,
DELTA_TIME
);
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_04_1900
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_04_1900
* @tc.name : 019.pause-GetCurrentTime-seek-play-GetCurrentTime
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_04_1900
,
Function
|
MediumTest
|
Level0
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_04_1900
,
Function
|
MediumTest
|
Level0
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
...
...
@@ -599,29 +450,20 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_1900, Function |
EXPECT_TRUE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_NEAR
(
SEEK_TIME_2_SEC
+
PLAYING_TIME
*
TIME_SEC2MS
,
time
,
DELTA_TIME
);
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_04_2000
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_04_2000
* @tc.name : 020.play-seek EOS-GetCurrentTime-进入PlaybackCompleted,loop=0
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_04_2000
,
Function
|
MediumTest
|
Level1
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_04_2000
,
Function
|
MediumTest
|
Level1
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
...
...
@@ -633,7 +475,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_2000, Function |
EXPECT_EQ
(
RET_OK
,
player
->
GetDuration
(
durationTime
));
EXPECT_EQ
(
RET_OK
,
player
->
Seek
(
durationTime
+
1
,
SEEK_MODE
));
EXPECT_EQ
(
RET_OK
,
testCallback
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_TRUE
(
TestParamsConfig
::
GetInstance
().
CompareTime
(
durationTime
,
time
,
SEEK_MODE
));
EXPECT_FALSE
(
player
->
IsLooping
());
...
...
@@ -641,29 +483,20 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_2000, Function |
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_EQ
(
FILE_BEGIN
,
time
);
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_04_2100
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_04_2100
* @tc.name : 021.seek EOS-GetCurrentTime-进入PlaybackCompleted,loop=0
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_04_2100
,
Function
|
MediumTest
|
Level1
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_04_2100
,
Function
|
MediumTest
|
Level1
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
SetLooping
(
false
));
...
...
@@ -677,31 +510,22 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_2100, Function |
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_EQ
(
FILE_BEGIN
,
time
);
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_04_2200
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_04_2200
* @tc.name : 022.play-seek EOS-GetCurrentTime,loop=1
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_04_2200
,
Function
|
MediumTest
|
Level1
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_04_2200
,
Function
|
MediumTest
|
Level1
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time_before
;
int32_t
time_after
;
int32_t
time
;
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -722,29 +546,20 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_2200, Function |
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_EQ
(
FILE_BEGIN
,
time
);
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_04_2300
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_04_2300
* @tc.name : 023.prepare-play-seek EOS-GetCurrentTime-进入PlaybackCompleted-stop,loop=0
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_04_2300
,
Function
|
MediumTest
|
Level1
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_04_2300
,
Function
|
MediumTest
|
Level1
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -755,36 +570,27 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_2300, Function |
EXPECT_EQ
(
RET_OK
,
player
->
GetDuration
(
durationTime
));
EXPECT_EQ
(
RET_OK
,
player
->
Seek
(
durationTime
+
1
,
SEEK_MODE
));
EXPECT_EQ
(
RET_OK
,
testCallback
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_TRUE
(
TestParamsConfig
::
GetInstance
().
CompareTime
(
durationTime
,
time
,
SEEK_MODE
));
EXPECT_FALSE
(
player
->
IsLooping
());
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_04_2400
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_04_2400
* @tc.name : 024.seek,seek随机+EOS附近
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_04_2400
,
Function
|
MediumTest
|
Level1
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_04_2400
,
Function
|
MediumTest
|
Level1
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
...
...
@@ -796,156 +602,114 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_2400, Function |
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_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_04_2500
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_04_2500
* @tc.name : 025.pause-seek-resume,不等seek完成
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_04_2500
,
Function
|
MediumTest
|
Level3
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_04_2500
,
Function
|
MediumTest
|
Level3
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
EXPECT_TRUE
(
player
->
IsPlaying
());
testObj
->
mutexFlag_
=
false
;
testObj
_
->
mutexFlag_
=
false
;
EXPECT_EQ
(
RET_OK
,
player
->
Seek
(
SEEK_TIME_5_SEC
,
SEEK_MODE
));
testObj
->
mutexFlag_
=
true
;
testObj
_
->
mutexFlag_
=
true
;
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
EXPECT_TRUE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_GE
(
time
,
SEEK_TIME_5_SEC
);
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_04_2600
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_04_2600
* @tc.name : 026.seek,不等seek完成,seek
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_04_2600
,
Function
|
MediumTest
|
Level3
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_04_2600
,
Function
|
MediumTest
|
Level3
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
EXPECT_TRUE
(
player
->
IsPlaying
());
testObj
->
mutexFlag_
=
false
;
testObj
_
->
mutexFlag_
=
false
;
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
;
testObj
_
->
mutexFlag_
=
true
;
EXPECT_EQ
(
RET_OK
,
player
->
Seek
(
SEEK_TIME_5_SEC
,
SEEK_MODE
));
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_TRUE
(
TestParamsConfig
::
GetInstance
().
CompareTime
(
SEEK_TIME_5_SEC
,
time
,
SEEK_MODE
));
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_04_2625
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_04_2625
* @tc.name : 026.seek,不等seek完成,pause
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_04_2625
,
Function
|
MediumTest
|
Level3
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_04_2625
,
Function
|
MediumTest
|
Level3
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
EXPECT_TRUE
(
player
->
IsPlaying
());
testObj
->
mutexFlag_
=
false
;
testObj
_
->
mutexFlag_
=
false
;
EXPECT_EQ
(
RET_OK
,
player
->
Seek
(
SEEK_TIME_2_SEC
,
SEEK_MODE
));
testObj
->
mutexFlag_
=
true
;
testObj
_
->
mutexFlag_
=
true
;
EXPECT_EQ
(
RET_OK
,
player
->
Pause
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_04_2650
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_04_2650
* @tc.name : 026.seek,不等seek完成,GetDuration
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_04_2650
,
Function
|
MediumTest
|
Level3
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_04_2650
,
Function
|
MediumTest
|
Level3
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
EXPECT_TRUE
(
player
->
IsPlaying
());
testObj
->
mutexFlag_
=
false
;
testObj
_
->
mutexFlag_
=
false
;
EXPECT_EQ
(
RET_OK
,
player
->
Seek
(
SEEK_TIME_2_SEC
,
SEEK_MODE
));
testObj
->
mutexFlag_
=
true
;
testObj
_
->
mutexFlag_
=
true
;
EXPECT_EQ
(
RET_OK
,
player
->
GetDuration
(
durationTime
));
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_04_2651
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_04_2651
* @tc.name : 026.seek,不等seek完成,GetCurrentTime
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_04_2651
,
Function
|
MediumTest
|
Level3
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_04_2651
,
Function
|
MediumTest
|
Level3
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -955,60 +719,44 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_2651, Function |
EXPECT_EQ
(
RET_OK
,
player
->
Seek
(
SEEK_TIME_2_SEC
,
SEEK_MODE
));
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_NEAR
(
PLAYING_TIME
*
TIME_SEC2MS
,
time
,
DELTA_TIME
);
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_04_2675
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_04_2675
* @tc.name : 026.seek,不等seek完成,play
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_04_2675
,
Function
|
MediumTest
|
Level3
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_04_2675
,
Function
|
MediumTest
|
Level3
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
(
void
)
sleep
(
PLAYING_TIME
);
EXPECT_TRUE
(
player
->
IsPlaying
());
testObj
->
mutexFlag_
=
false
;
testObj
_
->
mutexFlag_
=
false
;
EXPECT_EQ
(
RET_OK
,
player
->
Seek
(
SEEK_TIME_2_SEC
,
SEEK_MODE
));
testObj
->
mutexFlag_
=
true
;
testObj
_
->
mutexFlag_
=
true
;
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_NEAR
(
PLAYING_TIME
*
TIME_SEC2MS
,
time
,
DELTA_TIME
);
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_04_2700
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_04_2700
* @tc.name : 027.prepare-seek未完成-seek eos-start-seek eos-start-stop
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_04_2700
,
Function
|
MediumTest
|
Level3
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_04_2700
,
Function
|
MediumTest
|
Level3
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
...
...
@@ -1021,32 +769,23 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_2700, Function |
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_TRUE
(
TestParamsConfig
::
GetInstance
().
CompareTime
(
durationTime
,
time
,
SEEK_MODE
));
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_FALSE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_04_2800
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_04_2800
* @tc.name : 028.prepare-start-pause-seek eos-stop-prepare-start-stop
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_04_2800
,
Function
|
MediumTest
|
Level3
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_04_2800
,
Function
|
MediumTest
|
Level3
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
...
...
@@ -1065,29 +804,20 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_2800, Function |
EXPECT_TRUE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Stop
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_04_2900
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_04_2900
* @tc.name : 029.prepare-seek eos-start-stop-prepare-seek eos-start-stop,loop=1
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_04_2900
,
Function
|
MediumTest
|
Level3
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_04_2900
,
Function
|
MediumTest
|
Level3
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
SetLooping
(
true
));
...
...
@@ -1096,39 +826,31 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_2900, Function |
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_TRUE
(
TestParamsConfig
::
GetInstance
().
CompareTime
(
durationTime
,
time
,
SEEK_MODE
));
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
EXPECT_NE
(
RET_OK
,
testCallback
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_NE
(
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_MODE
));
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
EXPECT_NE
(
RET_OK
,
testCallback
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_NE
(
RET_OK
,
testCallback_
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_TRUE
(
player
->
IsPlaying
());
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
/**
* @tc.number : SUB_MEDIA_PLAYER_
Local_Function
_04_3000
* @tc.number : SUB_MEDIA_PLAYER_
FUNCTION
_04_3000
* @tc.name : 030.prepare-start-pause-seek eos-start-stop-prepare-start-pause-seek-start-stop,loop=1
* @tc.desc :
*/
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
Local_Function
_04_3000
,
Function
|
MediumTest
|
Level3
)
HWTEST_F
(
ActsPlayerFuncTest
,
SUB_MEDIA_PLAYER_
FUNCTION
_04_3000
,
Function
|
MediumTest
|
Level3
)
{
std
::
shared_ptr
<
PlayerSignal
>
testObj
=
std
::
make_shared
<
PlayerSignal
>
();
std
::
shared_ptr
<
TestPlayer
>
player
=
std
::
make_shared
<
TestPlayer
>
(
testObj
);
ASSERT_NE
(
nullptr
,
player
);
ASSERT_EQ
(
true
,
player
->
CreatePlayer
());
int32_t
time
;
int32_t
time_before
;
int32_t
time_after
;
int32_t
durationTime
;
std
::
string
uri
=
TestParamsConfig
::
GetInstance
().
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
));
std
::
shared_ptr
<
TestPlayer
>
player
;
PreparePlayEnv
(
player
);
ASSERT_EQ
(
RET_OK
,
player
->
Prepare
());
EXPECT_EQ
(
RET_OK
,
player
->
SetLooping
(
true
));
...
...
@@ -1139,7 +861,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_3000, Function |
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_TRUE
(
TestParamsConfig
::
GetInstance
().
CompareTime
(
durationTime
,
time
,
SEEK_MODE
));
EXPECT_EQ
(
RET_OK
,
player
->
Play
());
EXPECT_NE
(
RET_OK
,
testCallback
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_NE
(
RET_OK
,
testCallback
_
->
WaitForState
(
PLAYER_PLAYBACK_COMPLETE
));
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time_before
));
(
void
)
sleep
(
PLAYING_TIME
);
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time_after
));
...
...
@@ -1155,6 +877,6 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_3000, Function |
EXPECT_EQ
(
RET_OK
,
player
->
GetCurrentTime
(
time
));
EXPECT_EQ
(
FILE_BEGIN
,
time
);
EXPECT_EQ
(
RET_OK
,
player
->
Reset
());
EXPECT_EQ
(
RET_OK
,
testCallback
->
errorNum_
);
EXPECT_EQ
(
RET_OK
,
testCallback
_
->
errorNum_
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录