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

!666 media 测试用例刷新

Merge pull request !666 from XUXIAOBO/xxb-wzy-master-patch-44210
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
# distributed under the License is distributed on an "AS IS" BASIS, # distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
module_output_path = "hit/ActsMediaCppStandardTest" module_output_path = "hit/ActsMediaCppStandardTest"
...@@ -27,7 +27,7 @@ ohos_moduletest_suite("ActsMediaCppStandardTest") { ...@@ -27,7 +27,7 @@ ohos_moduletest_suite("ActsMediaCppStandardTest") {
module_out_path = module_output_path module_out_path = module_output_path
sources = [ sources = [
"player/src/TestParamsConfig.cpp", "player/src/TestParamsConfig.cpp",
"player/src/Testplayer.cpp", "player/src/TestPlayer.cpp",
"player/src/function/ActsPlayerFuncAsyncTest.cpp", "player/src/function/ActsPlayerFuncAsyncTest.cpp",
"player/src/function/ActsPlayerFuncTest.cpp", "player/src/function/ActsPlayerFuncTest.cpp",
"player/src/function/ActsPlayerStateAsyncTest.cpp", "player/src/function/ActsPlayerStateAsyncTest.cpp",
......
...@@ -45,7 +45,6 @@ public: ...@@ -45,7 +45,6 @@ public:
MEDIA_DEBUG_LOG("ActsPlayerFuncTest::TearDown:%s", testInfo->name()); MEDIA_DEBUG_LOG("ActsPlayerFuncTest::TearDown:%s", testInfo->name());
}; };
static void LocalPlayFunc(const std::string uri, bool isAsync, WindowConfig config = g_sub_config); static void LocalPlayFunc(const std::string uri, bool isAsync, WindowConfig config = g_sub_config);
static void *LocalMulitPlayFunc(void *threadarg);
}; };
} }
} }
......
...@@ -37,7 +37,7 @@ namespace { ...@@ -37,7 +37,7 @@ namespace {
namespace TestPlayerBasic { namespace TestPlayerBasic {
class TestParamsConfig { class TestParamsConfig {
public: public:
static TestParamsConfig& GetInstance() static TestParamsConfig &GetInstance()
{ {
static TestParamsConfig config; static TestParamsConfig config;
return config; return config;
......
...@@ -67,8 +67,8 @@ public: ...@@ -67,8 +67,8 @@ public:
}; };
class TestPlayer { class TestPlayer {
public: public:
std::shared_ptr<Player> player_; std::shared_ptr<Player> player_ = nullptr;
sptr<Window> window_; sptr<Window> window_ = nullptr;
explicit TestPlayer(std::shared_ptr<PlayerSignal> test); explicit TestPlayer(std::shared_ptr<PlayerSignal> test);
virtual ~TestPlayer(); virtual ~TestPlayer();
bool CreatePlayer(); bool CreatePlayer();
...@@ -107,11 +107,12 @@ public: ...@@ -107,11 +107,12 @@ public:
void OnInfo(PlayerOnInfoType type, int32_t extra, const Format &infoBody = {}); void OnInfo(PlayerOnInfoType type, int32_t extra, const Format &infoBody = {});
int WaitForState(PlayerStates state); int WaitForState(PlayerStates state);
private: private:
void PrintState(PlayerStates state);
PlayerErrorType errorType_ = PLAYER_ERROR_UNKNOWN; PlayerErrorType errorType_ = PLAYER_ERROR_UNKNOWN;
int32_t errorCode_ = -1; int32_t errorCode_ = -1;
bool seekDoneFlag_ = false; bool seekDoneFlag_ = false;
int32_t postion_ = 0; int32_t postion_ = 0;
void PrintState(PlayerStates state);
std::shared_ptr<PlayerSignal> test_; std::shared_ptr<PlayerSignal> test_;
}; };
} }
......
...@@ -12,24 +12,3 @@ ...@@ -12,24 +12,3 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include "gtest/gtest.h"
#include "player.h"
namespace PlayerNameSpace {
static std::string MOUNT_147 = "/data/media/audio/147";
static std::string MOUNT_189 = "/data/media/audio/189";
static const int MAX_THREADS = 16;
static const int32_t PLAYING_TIME = 3;
static const int32_t PAUSED_TIME = 1;
static const int32_t SEEK_TIME_5_SEC = 5000;
static const int32_t SEEK_TIME_2_SEC = 2000;
static const int DELTA_TIME = 1000;
static const int WAITSECOND = 2;
static const int MAXTIME = 1000;
static const int RET_OK = 0;
static const int32_t FILE_BEGIN = 0;
static const int32_t BUF_SIZE = 1024 * 1024;
static const OHOS::Media::PlayerSeekMode SEEK_MODE = OHOS::Media::PlayerSeekMode::SEEK_PREVIOUS_SYNC;
std::string GetUri();
}
\ No newline at end of file
...@@ -41,8 +41,7 @@ void TestParamsConfig::InitPlayProtocol() ...@@ -41,8 +41,7 @@ void TestParamsConfig::InitPlayProtocol()
char protocol[PARA_MAX_LEN] = "local"; char protocol[PARA_MAX_LEN] = "local";
GetParameter("sys.media.test.play.protocol", "", &protocol[0], PARA_MAX_LEN); GetParameter("sys.media.test.play.protocol", "", &protocol[0], PARA_MAX_LEN);
if (strcmp(protocol, "local") == 0) { if (strcmp(protocol, "local") == 0) {
TestPlayerBasic::TestParamsConfig::GetInstance().SetMountPath("file://data/media/189"); TestPlayerBasic::TestParamsConfig::GetInstance().SetMountPath("file://data/media");
MEDIA_INFO_LOG("MOUNT_PATH %s", TestPlayerBasic::TestParamsConfig::GetInstance().GetMountPath().c_str()); MEDIA_INFO_LOG("MOUNT_PATH %s", TestPlayerBasic::TestParamsConfig::GetInstance().GetMountPath().c_str());
} }
} }
......
...@@ -24,7 +24,7 @@ using namespace TestPlayerBasic; ...@@ -24,7 +24,7 @@ using namespace TestPlayerBasic;
/** /**
* @tc.number : SUB_MEDIA_PLAYER_Local_Async_Function_04_0100 * @tc.number : SUB_MEDIA_PLAYER_Local_Async_Function_04_0100
* @tc.name : 001.prepare-reset * @tc.name : 001.prepare-reset-release
* @tc.desc : 播控 * @tc.desc : 播控
*/ */
HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_0100, Function | MediumTest | Level0) HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_0100, Function | MediumTest | Level0)
...@@ -73,7 +73,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_0200, Func ...@@ -73,7 +73,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_0200, Func
/** /**
* @tc.number : SUB_MEDIA_PLAYER_Local_Async_Function_04_0300 * @tc.number : SUB_MEDIA_PLAYER_Local_Async_Function_04_0300
* @tc.name : 003.prepare-stop-reset * @tc.name : 003.prepare-stop-reset-release
* @tc.desc : 播控 * @tc.desc : 播控
*/ */
HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_0300, Function | MediumTest | Level0) HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_0300, Function | MediumTest | Level0)
...@@ -156,7 +156,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_0600, Func ...@@ -156,7 +156,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_0600, Func
/** /**
* @tc.number : SUB_MEDIA_PLAYER_Local_Async_Function_04_0700 * @tc.number : SUB_MEDIA_PLAYER_Local_Async_Function_04_0700
* @tc.name : 007.prepare-seek-play-reset * @tc.name : 007.prepare-seek-play-reset-release
* @tc.desc : * @tc.desc :
*/ */
HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_0700, Function | MediumTest | Level0) HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_0700, Function | MediumTest | Level0)
...@@ -220,7 +220,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_0800, Func ...@@ -220,7 +220,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_0800, Func
/** /**
* @tc.number : SUB_MEDIA_PLAYER_Local_Async_Function_04_0900 * @tc.number : SUB_MEDIA_PLAYER_Local_Async_Function_04_0900
* @tc.name : 009.prepare-play-seek-reset * @tc.name : 009.prepare-play-seek-reset-release
* @tc.desc : * @tc.desc :
*/ */
HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_0900, Function | MediumTest | Level0) HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_0900, Function | MediumTest | Level0)
...@@ -322,7 +322,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_1100, Func ...@@ -322,7 +322,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_1100, Func
/** /**
* @tc.number : SUB_MEDIA_PLAYER_Local_Async_Function_04_1200 * @tc.number : SUB_MEDIA_PLAYER_Local_Async_Function_04_1200
* @tc.name : 012.prepare-play-seek-pause-reset * @tc.name : 012.prepare-play-seek-pause-reset-release
* @tc.desc : * @tc.desc :
*/ */
HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_1200, Function | MediumTest | Level0) HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_1200, Function | MediumTest | Level0)
...@@ -396,7 +396,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_1300, Func ...@@ -396,7 +396,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_1300, Func
/** /**
* @tc.number : SUB_MEDIA_PLAYER_Local_Async_Function_04_1400 * @tc.number : SUB_MEDIA_PLAYER_Local_Async_Function_04_1400
* @tc.name : 014.prepare-play-seek-pause-stop-reset * @tc.name : 014.prepare-play-seek-pause-stop-reset-release
* @tc.desc : * @tc.desc :
*/ */
HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_1400, Function | MediumTest | Level0) HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_1400, Function | MediumTest | Level0)
...@@ -464,7 +464,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_1500, Func ...@@ -464,7 +464,7 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_1500, Func
/** /**
* @tc.number : SUB_MEDIA_PLAYER_Local_Async_Function_04_1600 * @tc.number : SUB_MEDIA_PLAYER_Local_Async_Function_04_1600
* @tc.name : 016.prepare-play-stop-reset * @tc.name : 016.prepare-play-stop-reset-release
* @tc.desc : * @tc.desc :
*/ */
HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_1600, Function | MediumTest | Level0) HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Async_Function_04_1600, Function | MediumTest | Level0)
......
...@@ -1158,3 +1158,4 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_3000, Function | ...@@ -1158,3 +1158,4 @@ HWTEST_F(ActsPlayerFuncTest, SUB_MEDIA_PLAYER_Local_Function_04_3000, Function |
EXPECT_EQ(RET_OK, player->Reset()); 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.
先完成此消息的编辑!
想要评论请 注册