Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
d666ce33
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看板
未验证
提交
d666ce33
编写于
11月 30, 2021
作者:
N
NOBUGGERS
提交者:
Gitee
11月 30, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
media test 同步刷新 Signed-off-by: NOBUGGERS <ruanmeng@huawei.com>
上级
7032902b
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
26 addition
and
14 deletion
+26
-14
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
+7
-1
multimedia/media/media_cpp_test_standard/player/include/TestParamsConfig.h
...media_cpp_test_standard/player/include/TestParamsConfig.h
+3
-2
multimedia/media/media_cpp_test_standard/player/include/TestPlayer.h
...media/media_cpp_test_standard/player/include/TestPlayer.h
+3
-2
未找到文件。
multimedia/media/media_cpp_test_standard/include/mediatest_log.h
浏览文件 @
d666ce33
/*
* 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_LOG_TEST_H
#define MEDIA_LOG_TEST_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
浏览文件 @
d666ce33
...
...
@@ -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
浏览文件 @
d666ce33
...
...
@@ -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,11 @@ public:
MEDIA_DEBUG_LOG
(
"ActsPlayerFuncTest::TearDown:%s"
,
testInfo
->
name
());
};
static
void
LocalPlayFunc
(
const
std
::
string
uri
,
bool
isAsync
,
WindowConfig
config
=
g_sub_config
);
static
void
*
LocalMultiPlayFunc
(
void
*
threadArg
);
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
浏览文件 @
d666ce33
...
...
@@ -16,8 +16,8 @@
#ifndef PLAYER_COMMON_TEST_H
#define PLAYER_COMMON_TEST_H
#include "gtest/gtest.h"
#include "mediatest_log.h"
#include "gtest/gtest.h"
#include "player.h"
namespace
{
...
...
@@ -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
浏览文件 @
d666ce33
...
...
@@ -46,7 +46,6 @@ static WindowConfig g_sub_config = {
class
PlayerSignal
{
public:
PlayerStates
state_
=
PLAYER_IDLE
;
int32_t
seekPositon_
;
bool
seekDoneFlag_
;
bool
mutexFlag_
=
true
;
std
::
mutex
mutexSeek_
;
...
...
@@ -71,6 +70,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 +102,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:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录