1fa7767c5Sopenharmony_ci/* 2fa7767c5Sopenharmony_ci * Copyright (c) 2022-2022 Huawei Device Co., Ltd. 3fa7767c5Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4fa7767c5Sopenharmony_ci * you may not use this file except in compliance with the License. 5fa7767c5Sopenharmony_ci * You may obtain a copy of the License at 6fa7767c5Sopenharmony_ci * 7fa7767c5Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8fa7767c5Sopenharmony_ci * 9fa7767c5Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10fa7767c5Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11fa7767c5Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12fa7767c5Sopenharmony_ci * See the License for the specific language governing permissions and 13fa7767c5Sopenharmony_ci * limitations under the License. 14fa7767c5Sopenharmony_ci */ 15fa7767c5Sopenharmony_ci 16fa7767c5Sopenharmony_ci#include "gtest/gtest.h" 17fa7767c5Sopenharmony_ci#include <chrono> 18fa7767c5Sopenharmony_ci#include <fcntl.h> 19fa7767c5Sopenharmony_ci#include <cmath> 20fa7767c5Sopenharmony_ci#include <thread> 21fa7767c5Sopenharmony_ci#include "foundation/log.h" 22fa7767c5Sopenharmony_ci#include "scenetest/helper/test_player.hpp" 23fa7767c5Sopenharmony_ci 24fa7767c5Sopenharmony_ci#ifndef WIN32 25fa7767c5Sopenharmony_ci#include <sys/types.h> 26fa7767c5Sopenharmony_ci#include <unistd.h> 27fa7767c5Sopenharmony_ci#define O_BINARY 0 // which is not defined for Linux 28fa7767c5Sopenharmony_ci#define RESOURCE_DIR "/data/test/media/" 29fa7767c5Sopenharmony_ciusing namespace testing::ext; 30fa7767c5Sopenharmony_ci#endif 31fa7767c5Sopenharmony_ci 32fa7767c5Sopenharmony_ciusing namespace OHOS::Media::Plugin; 33fa7767c5Sopenharmony_ciusing namespace OHOS::Media::Test; 34fa7767c5Sopenharmony_ci 35fa7767c5Sopenharmony_cinamespace OHOS { 36fa7767c5Sopenharmony_cinamespace Media { 37fa7767c5Sopenharmony_cinamespace Test { 38fa7767c5Sopenharmony_ci class UtTestVedioFastPlayer : public ::testing::Test { 39fa7767c5Sopenharmony_ci public: 40fa7767c5Sopenharmony_ci void SetUp() override 41fa7767c5Sopenharmony_ci { 42fa7767c5Sopenharmony_ci } 43fa7767c5Sopenharmony_ci void TearDown() override 44fa7767c5Sopenharmony_ci { 45fa7767c5Sopenharmony_ci } 46fa7767c5Sopenharmony_ci std::vector<std::string> vecSource{std::string(RESOURCE_DIR "/MP4/MPEG2_MP3.mp4")}; 47fa7767c5Sopenharmony_ci }; 48fa7767c5Sopenharmony_ci 49fa7767c5Sopenharmony_ci constexpr int64_t FILE_SIZE = 1894335; 50fa7767c5Sopenharmony_ci 51fa7767c5Sopenharmony_ci std::string FilePathToFd(std::string url, int32_t fileSize) 52fa7767c5Sopenharmony_ci { 53fa7767c5Sopenharmony_ci std::string uri = "fd://?offset=0&size="; 54fa7767c5Sopenharmony_ci uri += std::to_string(fileSize); 55fa7767c5Sopenharmony_ci int32_t fd = open(url.c_str(), O_RDONLY | O_BINARY); 56fa7767c5Sopenharmony_ci std::string fdStr = std::to_string(fd); 57fa7767c5Sopenharmony_ci uri.insert(5, fdStr); // 5 ---fd::// 58fa7767c5Sopenharmony_ci return uri; 59fa7767c5Sopenharmony_ci } 60fa7767c5Sopenharmony_ci 61fa7767c5Sopenharmony_ci void TestPlayerFinishedAutomatically(std::string url) 62fa7767c5Sopenharmony_ci { 63fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 64fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(url))); 65fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 66fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 67fa7767c5Sopenharmony_ci std::vector<OHOS::Media::Format> videoTrack; 68fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->GetVideoTrackInfo(videoTrack)); 69fa7767c5Sopenharmony_ci while (player->IsPlaying()) { 70fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(1000)); // 1000 MS 71fa7767c5Sopenharmony_ci } 72fa7767c5Sopenharmony_ci } 73fa7767c5Sopenharmony_ci 74fa7767c5Sopenharmony_ci void TestSinglePlayerFdSourceFinishedAutomatically(std::string url, int32_t fileSize) 75fa7767c5Sopenharmony_ci { 76fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 77fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 78fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 79fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 80fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 81fa7767c5Sopenharmony_ci while (player->IsPlaying()) { 82fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(1000)); // 1000 MS 83fa7767c5Sopenharmony_ci } 84fa7767c5Sopenharmony_ci } 85fa7767c5Sopenharmony_ci 86fa7767c5Sopenharmony_ci void TestSinglePlayerWrongFd(std::string url, int32_t fileSize) 87fa7767c5Sopenharmony_ci { 88fa7767c5Sopenharmony_ci std::string uri = "fd://?offset=0&size="; 89fa7767c5Sopenharmony_ci uri += std::to_string(fileSize); 90fa7767c5Sopenharmony_ci uri.insert(5, "-1"); // 5 ---fd::// 91fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 92fa7767c5Sopenharmony_ci ASSERT_NE(0, player->SetSource(TestSource(uri))); 93fa7767c5Sopenharmony_ci ASSERT_NE(0, player->Prepare()); 94fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 95fa7767c5Sopenharmony_ci } 96fa7767c5Sopenharmony_ci 97fa7767c5Sopenharmony_ci void TestPreparePlayPauseRelease(std::string url) 98fa7767c5Sopenharmony_ci { 99fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 100fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(url))); 101fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 102fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 103fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Pause()); 104fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 105fa7767c5Sopenharmony_ci } 106fa7767c5Sopenharmony_ci 107fa7767c5Sopenharmony_ci void TestPreparePlayPauseThenRelease(std::string url) 108fa7767c5Sopenharmony_ci { 109fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 110fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(url))); 111fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 112fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 113fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(5000)); // 5000 MS 114fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Pause()); 115fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 116fa7767c5Sopenharmony_ci } 117fa7767c5Sopenharmony_ci 118fa7767c5Sopenharmony_ci void TestPrepareWrongFdThenRelease(std::string url, int32_t fileSize) 119fa7767c5Sopenharmony_ci { 120fa7767c5Sopenharmony_ci std::string uri = "fd://?offset=0&size="; 121fa7767c5Sopenharmony_ci uri += std::to_string(fileSize); 122fa7767c5Sopenharmony_ci uri.insert(5, "-123456789"); // 5 ---fd::// 123fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 124fa7767c5Sopenharmony_ci ASSERT_NE(0, player->SetSource(TestSource(uri))); 125fa7767c5Sopenharmony_ci ASSERT_NE(0, player->Prepare()); 126fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 127fa7767c5Sopenharmony_ci } 128fa7767c5Sopenharmony_ci 129fa7767c5Sopenharmony_ci void TestPrepareThenRelease(std::string url, int32_t fileSize) 130fa7767c5Sopenharmony_ci { 131fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 132fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 133fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 134fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 135fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 136fa7767c5Sopenharmony_ci } 137fa7767c5Sopenharmony_ci 138fa7767c5Sopenharmony_ci void TestPreparePlayPrepareRelease(std::string url, int32_t fileSize) 139fa7767c5Sopenharmony_ci { 140fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 141fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 142fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 143fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 144fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 145fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(5000)); // 5000 MS 146fa7767c5Sopenharmony_ci ASSERT_NE(0, player->Prepare()); 147fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 148fa7767c5Sopenharmony_ci } 149fa7767c5Sopenharmony_ci 150fa7767c5Sopenharmony_ci void TestPreparePlayPausePrepareRelease(std::string url, int32_t fileSize) 151fa7767c5Sopenharmony_ci { 152fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 153fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 154fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 155fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 156fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 157fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(5000)); // 5000 MS 158fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Pause()); 159fa7767c5Sopenharmony_ci ASSERT_NE(0, player->Prepare()); 160fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 161fa7767c5Sopenharmony_ci } 162fa7767c5Sopenharmony_ci 163fa7767c5Sopenharmony_ci void TestPreparePlayStopPrepareRelease(std::string url, int32_t fileSize) 164fa7767c5Sopenharmony_ci { 165fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 166fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 167fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 168fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 169fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 170fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(5000)); // 5000 MS 171fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Stop()); 172fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 173fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 174fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(5000)); // 5000 MS 175fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 176fa7767c5Sopenharmony_ci } 177fa7767c5Sopenharmony_ci 178fa7767c5Sopenharmony_ci void TestPreparePlayResetSetSourcePrepareRelease(std::string url, int32_t fileSize) 179fa7767c5Sopenharmony_ci { 180fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 181fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 182fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 183fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 184fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 185fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(5000)); // 5000 MS 186fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Reset()); 187fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 188fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 189fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 190fa7767c5Sopenharmony_ci } 191fa7767c5Sopenharmony_ci 192fa7767c5Sopenharmony_ci void TestPreparePlaySeekPrepareRelease(std::string url, int32_t fileSize) 193fa7767c5Sopenharmony_ci { 194fa7767c5Sopenharmony_ci int64_t seekPos {5000}; 195fa7767c5Sopenharmony_ci int64_t currentMS {0}; 196fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 197fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 198fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 199fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 200fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 201fa7767c5Sopenharmony_ci ASSERT_TRUE(player->IsPlaying()); 202fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(1000)); // 1000 MS 203fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Seek(seekPos, OHOS::Media::PlayerSeekMode::SEEK_NEXT_SYNC)); 204fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->GetCurrentTime(currentMS)); 205fa7767c5Sopenharmony_ci ASSERT_NE(0, player->Prepare()); 206fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 207fa7767c5Sopenharmony_ci } 208fa7767c5Sopenharmony_ci 209fa7767c5Sopenharmony_ci void TestPreparePlaySetvolumePrepareRelease(std::string url, int32_t fileSize) 210fa7767c5Sopenharmony_ci { 211fa7767c5Sopenharmony_ci float leftVolume {1}; 212fa7767c5Sopenharmony_ci float rightVolume {1}; 213fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 214fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 215fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 216fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 217fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 218fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetVolume(leftVolume, rightVolume)); 219fa7767c5Sopenharmony_ci ASSERT_NE(0, player->Prepare()); 220fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 221fa7767c5Sopenharmony_ci } 222fa7767c5Sopenharmony_ci 223fa7767c5Sopenharmony_ci void TestPrepareRelease(std::string url, int32_t fileSize) 224fa7767c5Sopenharmony_ci { 225fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 226fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 227fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 228fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 229fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 230fa7767c5Sopenharmony_ci } 231fa7767c5Sopenharmony_ci 232fa7767c5Sopenharmony_ci void Test3PrepareRelease(std::string url, int32_t fileSize) 233fa7767c5Sopenharmony_ci { 234fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 235fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 236fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 237fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 238fa7767c5Sopenharmony_ci ASSERT_NE(0, player->Prepare()); 239fa7767c5Sopenharmony_ci ASSERT_NE(0, player->Prepare()); 240fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 241fa7767c5Sopenharmony_ci } 242fa7767c5Sopenharmony_ci 243fa7767c5Sopenharmony_ci void TestPreparePlayRelease(std::string url, int32_t fileSize) 244fa7767c5Sopenharmony_ci { 245fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 246fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 247fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 248fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 249fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 250fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(5000)); // 5000 MS 251fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 252fa7767c5Sopenharmony_ci } 253fa7767c5Sopenharmony_ci 254fa7767c5Sopenharmony_ci void TestPreparePlayPausePlayRelease(std::string url, int32_t fileSize) 255fa7767c5Sopenharmony_ci { 256fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 257fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 258fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 259fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 260fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 261fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(5000)); // 5000 MS 262fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Pause()); 263fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 264fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(3000)); // 3000 MS 265fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 266fa7767c5Sopenharmony_ci } 267fa7767c5Sopenharmony_ci 268fa7767c5Sopenharmony_ci void TestPreparePlayStopPlayRelease(std::string url, int32_t fileSize) 269fa7767c5Sopenharmony_ci { 270fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 271fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 272fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 273fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 274fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 275fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(5000)); // 5000 MS 276fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Stop()); 277fa7767c5Sopenharmony_ci ASSERT_NE(0, player->Play()); 278fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 279fa7767c5Sopenharmony_ci } 280fa7767c5Sopenharmony_ci 281fa7767c5Sopenharmony_ci void TestPreparePlayResetPlayRelease(std::string url, int32_t fileSize) 282fa7767c5Sopenharmony_ci { 283fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 284fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 285fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 286fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 287fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 288fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(5000)); // 5000 MS 289fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Reset()); 290fa7767c5Sopenharmony_ci ASSERT_NE(0, player->Play()); 291fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 292fa7767c5Sopenharmony_ci } 293fa7767c5Sopenharmony_ci 294fa7767c5Sopenharmony_ci void TestPreparePlaySeekRelease(std::string url, int32_t fileSize) 295fa7767c5Sopenharmony_ci { 296fa7767c5Sopenharmony_ci int64_t seekPos {5000}; // 5000 MS 297fa7767c5Sopenharmony_ci int64_t currentMS {0}; 298fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 299fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 300fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 301fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 302fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 303fa7767c5Sopenharmony_ci ASSERT_TRUE(player->IsPlaying()); 304fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(5000)); // 5000 MS 305fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Seek(seekPos, OHOS::Media::PlayerSeekMode::SEEK_NEXT_SYNC)); 306fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->GetCurrentTime(currentMS)); 307fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 308fa7767c5Sopenharmony_ci } 309fa7767c5Sopenharmony_ci 310fa7767c5Sopenharmony_ci void TestPreparePlaySetvolumeRelease(std::string url, int32_t fileSize) 311fa7767c5Sopenharmony_ci { 312fa7767c5Sopenharmony_ci float leftVolume {1}; 313fa7767c5Sopenharmony_ci float rightVolume {1}; 314fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 315fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 316fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 317fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 318fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 319fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetVolume(leftVolume, rightVolume)); 320fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 321fa7767c5Sopenharmony_ci } 322fa7767c5Sopenharmony_ci 323fa7767c5Sopenharmony_ci void TestPlayRelease(std::string url, int32_t fileSize) 324fa7767c5Sopenharmony_ci { 325fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 326fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 327fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 328fa7767c5Sopenharmony_ci ASSERT_NE(0, player->Play()); 329fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 330fa7767c5Sopenharmony_ci } 331fa7767c5Sopenharmony_ci 332fa7767c5Sopenharmony_ci void TestPrepare3PlayRelease(std::string url, int32_t fileSize) 333fa7767c5Sopenharmony_ci { 334fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 335fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 336fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 337fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 338fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 339fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(5000)); // 5000 MS 340fa7767c5Sopenharmony_ci ASSERT_NE(0, player->Play()); 341fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(1000)); // 1000 MS 342fa7767c5Sopenharmony_ci ASSERT_NE(0, player->Play()); 343fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(3000)); // 3000 MS 344fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 345fa7767c5Sopenharmony_ci } 346fa7767c5Sopenharmony_ci // fast2 347fa7767c5Sopenharmony_ci void TestCreatePauseRelease(std::string url, int32_t fileSize) 348fa7767c5Sopenharmony_ci { 349fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 350fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 351fa7767c5Sopenharmony_ci ASSERT_NE(0, player->Pause()); 352fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 353fa7767c5Sopenharmony_ci } 354fa7767c5Sopenharmony_ci 355fa7767c5Sopenharmony_ci void TestPreparePauseRelease(std::string url, int32_t fileSize) 356fa7767c5Sopenharmony_ci { 357fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 358fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 359fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 360fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 361fa7767c5Sopenharmony_ci ASSERT_NE(0, player->Pause()); 362fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 363fa7767c5Sopenharmony_ci } 364fa7767c5Sopenharmony_ci 365fa7767c5Sopenharmony_ci void TestPreparePlayStopPauseRelease(std::string url, int32_t fileSize) 366fa7767c5Sopenharmony_ci { 367fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 368fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 369fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 370fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 371fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 372fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(5000)); // 5000 MS 373fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Stop()); 374fa7767c5Sopenharmony_ci ASSERT_NE(0, player->Pause()); 375fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 376fa7767c5Sopenharmony_ci } 377fa7767c5Sopenharmony_ci 378fa7767c5Sopenharmony_ci void TestPreparePlayResetPauseRelease(std::string url, int32_t fileSize) 379fa7767c5Sopenharmony_ci { 380fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 381fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 382fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 383fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 384fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 385fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(5000)); // 5000 MS 386fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Reset()); 387fa7767c5Sopenharmony_ci ASSERT_NE(0, player->Pause()); 388fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 389fa7767c5Sopenharmony_ci } 390fa7767c5Sopenharmony_ci 391fa7767c5Sopenharmony_ci void TestPreparePlaySeekPauseRelease(std::string url, int32_t fileSize) 392fa7767c5Sopenharmony_ci { 393fa7767c5Sopenharmony_ci int64_t seekPos {5000}; 394fa7767c5Sopenharmony_ci int64_t currentMS {0}; 395fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 396fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 397fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 398fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 399fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 400fa7767c5Sopenharmony_ci ASSERT_TRUE(player->IsPlaying()); 401fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(5000)); // 5000 MS 402fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Seek(seekPos, OHOS::Media::PlayerSeekMode::SEEK_NEXT_SYNC)); 403fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->GetCurrentTime(currentMS)); 404fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Pause()); 405fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 406fa7767c5Sopenharmony_ci } 407fa7767c5Sopenharmony_ci 408fa7767c5Sopenharmony_ci void TestPreparePlaySetvolumePauseRelease(std::string url, int32_t fileSize) 409fa7767c5Sopenharmony_ci { 410fa7767c5Sopenharmony_ci float leftVolume {1}; 411fa7767c5Sopenharmony_ci float rightVolume {1}; 412fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 413fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 414fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 415fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 416fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 417fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(5000)); // 5000 MS 418fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetVolume(leftVolume, rightVolume)); 419fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Pause()); 420fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 421fa7767c5Sopenharmony_ci } 422fa7767c5Sopenharmony_ci 423fa7767c5Sopenharmony_ci void TestCreateSetSourcePauseRelease(std::string url, int32_t fileSize) 424fa7767c5Sopenharmony_ci { 425fa7767c5Sopenharmony_ci float leftVolume {1}; 426fa7767c5Sopenharmony_ci float rightVolume {1}; 427fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 428fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 429fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 430fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 431fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 432fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(5000)); // 5000 MS 433fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetVolume(leftVolume, rightVolume)); 434fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Pause()); 435fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 436fa7767c5Sopenharmony_ci } 437fa7767c5Sopenharmony_ci 438fa7767c5Sopenharmony_ci void TestPreparePlay3PauseRelease(std::string url, int32_t fileSize) 439fa7767c5Sopenharmony_ci { 440fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 441fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 442fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 443fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 444fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 445fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(5000)); // 5000 MS 446fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Pause()); 447fa7767c5Sopenharmony_ci ASSERT_NE(0, player->Pause()); 448fa7767c5Sopenharmony_ci ASSERT_NE(0, player->Pause()); 449fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 450fa7767c5Sopenharmony_ci } 451fa7767c5Sopenharmony_ci 452fa7767c5Sopenharmony_ci void TestCreateStopRelease(std::string url, int32_t fileSize) 453fa7767c5Sopenharmony_ci { 454fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 455fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 456fa7767c5Sopenharmony_ci ASSERT_NE(0, player->Stop()); 457fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 458fa7767c5Sopenharmony_ci } 459fa7767c5Sopenharmony_ci 460fa7767c5Sopenharmony_ci void TestPrepareStopRelease(std::string url, int32_t fileSize) 461fa7767c5Sopenharmony_ci { 462fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 463fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 464fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 465fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 466fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Stop()); 467fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 468fa7767c5Sopenharmony_ci } 469fa7767c5Sopenharmony_ci 470fa7767c5Sopenharmony_ci void TestPreparePlayStopRelease(std::string url, int32_t fileSize) 471fa7767c5Sopenharmony_ci { 472fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 473fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 474fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 475fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 476fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 477fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(5000)); // 5000 MS 478fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Stop()); 479fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 480fa7767c5Sopenharmony_ci } 481fa7767c5Sopenharmony_ci 482fa7767c5Sopenharmony_ci void TestPreparePlayPauseStopRelease(std::string url, int32_t fileSize) 483fa7767c5Sopenharmony_ci { 484fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 485fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 486fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 487fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 488fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 489fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(5000)); // 5000 MS 490fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Pause()); 491fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Stop()); 492fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 493fa7767c5Sopenharmony_ci } 494fa7767c5Sopenharmony_ci 495fa7767c5Sopenharmony_ci void TestPreparePlayResetStopRelease(std::string url, int32_t fileSize) 496fa7767c5Sopenharmony_ci { 497fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 498fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 499fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 500fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 501fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 502fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(5000)); // 5000 MS 503fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Reset()); 504fa7767c5Sopenharmony_ci ASSERT_NE(0, player->Stop()); 505fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 506fa7767c5Sopenharmony_ci } 507fa7767c5Sopenharmony_ci 508fa7767c5Sopenharmony_ci void TestPreparePlaySeekStopRelease(std::string url, int32_t fileSize) 509fa7767c5Sopenharmony_ci { 510fa7767c5Sopenharmony_ci int64_t seekPos {5000}; 511fa7767c5Sopenharmony_ci int64_t currentMS {0}; 512fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 513fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 514fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 515fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 516fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 517fa7767c5Sopenharmony_ci ASSERT_TRUE(player->IsPlaying()); 518fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(5000)); // 5000 MS 519fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Seek(seekPos, OHOS::Media::PlayerSeekMode::SEEK_NEXT_SYNC)); 520fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->GetCurrentTime(currentMS)); 521fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Stop()); 522fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 523fa7767c5Sopenharmony_ci } 524fa7767c5Sopenharmony_ci 525fa7767c5Sopenharmony_ci void TestPreparePlaySetvolumeStopRelease(std::string url, int32_t fileSize) 526fa7767c5Sopenharmony_ci { 527fa7767c5Sopenharmony_ci float leftVolume {1}; 528fa7767c5Sopenharmony_ci float rightVolume {1}; 529fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 530fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 531fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 532fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 533fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 534fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetVolume(leftVolume, rightVolume)); 535fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Stop()); 536fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 537fa7767c5Sopenharmony_ci } 538fa7767c5Sopenharmony_ci 539fa7767c5Sopenharmony_ci void TestPreparePlaySpeedStopRelease(std::string url, int32_t fileSize) 540fa7767c5Sopenharmony_ci { 541fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 542fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 543fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 544fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 545fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 546fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetPlaybackSpeed(OHOS::Media::PlaybackRateMode::SPEED_FORWARD_1_00_X)); 547fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Stop()); 548fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 549fa7767c5Sopenharmony_ci } 550fa7767c5Sopenharmony_ci 551fa7767c5Sopenharmony_ci void TestCreateSetSourceStopRelease(std::string url, int32_t fileSize) 552fa7767c5Sopenharmony_ci { 553fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 554fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 555fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 556fa7767c5Sopenharmony_ci ASSERT_NE(0, player->Stop()); 557fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 558fa7767c5Sopenharmony_ci } 559fa7767c5Sopenharmony_ci 560fa7767c5Sopenharmony_ci void TestPreparePlay3StopRelease(std::string url, int32_t fileSize) 561fa7767c5Sopenharmony_ci { 562fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 563fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 564fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 565fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 566fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 567fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(5000)); // 5000 MS 568fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Stop()); 569fa7767c5Sopenharmony_ci ASSERT_NE(0, player->Stop()); 570fa7767c5Sopenharmony_ci ASSERT_NE(0, player->Stop()); 571fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 572fa7767c5Sopenharmony_ci } 573fa7767c5Sopenharmony_ci 574fa7767c5Sopenharmony_ci void TestPrepareResetRelease(std::string url, int32_t fileSize) 575fa7767c5Sopenharmony_ci { 576fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 577fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 578fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 579fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 580fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Reset()); 581fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 582fa7767c5Sopenharmony_ci } 583fa7767c5Sopenharmony_ci 584fa7767c5Sopenharmony_ci void TestPreparePlayResetRelease(std::string url, int32_t fileSize) 585fa7767c5Sopenharmony_ci { 586fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 587fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 588fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 589fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 590fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 591fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Reset()); 592fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 593fa7767c5Sopenharmony_ci } 594fa7767c5Sopenharmony_ci 595fa7767c5Sopenharmony_ci void TestPreparePlayPauseResetRelease(std::string url, int32_t fileSize) 596fa7767c5Sopenharmony_ci { 597fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 598fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 599fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 600fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 601fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 602fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(5000)); // 5000 MS 603fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Pause()); 604fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Reset()); 605fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 606fa7767c5Sopenharmony_ci } 607fa7767c5Sopenharmony_ci 608fa7767c5Sopenharmony_ci void TestPreparePlayStopResetRelease(std::string url, int32_t fileSize) 609fa7767c5Sopenharmony_ci { 610fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 611fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 612fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 613fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 614fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 615fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(5000)); // 5000 MS 616fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Stop()); 617fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Reset()); 618fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 619fa7767c5Sopenharmony_ci } 620fa7767c5Sopenharmony_ci 621fa7767c5Sopenharmony_ci void TestPreparePlaySeekResetRelease(std::string url, int32_t fileSize) 622fa7767c5Sopenharmony_ci { 623fa7767c5Sopenharmony_ci int64_t seekPos {5000}; // 5000 MS 624fa7767c5Sopenharmony_ci int64_t currentMS {0}; 625fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 626fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 627fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 628fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 629fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 630fa7767c5Sopenharmony_ci ASSERT_TRUE(player->IsPlaying()); 631fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(5000)); // 5000 MS 632fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Seek(seekPos, OHOS::Media::PlayerSeekMode::SEEK_NEXT_SYNC)); 633fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->GetCurrentTime(currentMS)); 634fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Reset()); 635fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 636fa7767c5Sopenharmony_ci } 637fa7767c5Sopenharmony_ci 638fa7767c5Sopenharmony_ci void TestPrepare3ResetRelease(std::string url, int32_t fileSize) 639fa7767c5Sopenharmony_ci { 640fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 641fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 642fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 643fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 644fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Reset()); 645fa7767c5Sopenharmony_ci ASSERT_NE(0, player->Reset()); 646fa7767c5Sopenharmony_ci ASSERT_NE(0, player->Reset()); 647fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 648fa7767c5Sopenharmony_ci } 649fa7767c5Sopenharmony_ci 650fa7767c5Sopenharmony_ci // fast3 651fa7767c5Sopenharmony_ci void TestCreateReset(std::string url, int32_t fileSize) 652fa7767c5Sopenharmony_ci { 653fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 654fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 655fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 656fa7767c5Sopenharmony_ci } 657fa7767c5Sopenharmony_ci 658fa7767c5Sopenharmony_ci void TestCreateSeekRelease(std::string url, int32_t fileSize) 659fa7767c5Sopenharmony_ci { 660fa7767c5Sopenharmony_ci int64_t seekPos {5000}; 661fa7767c5Sopenharmony_ci int64_t currentMS {0}; 662fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 663fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 664fa7767c5Sopenharmony_ci ASSERT_NE(0, player->Seek(seekPos)); 665fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->GetCurrentTime(currentMS)); 666fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 667fa7767c5Sopenharmony_ci } 668fa7767c5Sopenharmony_ci 669fa7767c5Sopenharmony_ci void TestPrepareSeekRelease(std::string url, int32_t fileSize) 670fa7767c5Sopenharmony_ci { 671fa7767c5Sopenharmony_ci int64_t seekPos {5000}; 672fa7767c5Sopenharmony_ci int64_t currentMS {0}; 673fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 674fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 675fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 676fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 677fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Seek(seekPos)); 678fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->GetCurrentTime(currentMS)); 679fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 680fa7767c5Sopenharmony_ci } 681fa7767c5Sopenharmony_ci 682fa7767c5Sopenharmony_ci void TestPreparePlaySeekRelease300(std::string url, int32_t fileSize) 683fa7767c5Sopenharmony_ci { 684fa7767c5Sopenharmony_ci int64_t seekPos {5000}; // 5000 MS 685fa7767c5Sopenharmony_ci int64_t currentMS {0}; 686fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 687fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 688fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 689fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 690fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 691fa7767c5Sopenharmony_ci ASSERT_TRUE(player->IsPlaying()); 692fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(3000)); // 3000 MS 693fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Seek(seekPos, OHOS::Media::PlayerSeekMode::SEEK_NEXT_SYNC)); 694fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->GetCurrentTime(currentMS)); 695fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 696fa7767c5Sopenharmony_ci } 697fa7767c5Sopenharmony_ci 698fa7767c5Sopenharmony_ci void TestPreparePlayPauseSeekRelease(std::string url, int32_t fileSize) 699fa7767c5Sopenharmony_ci { 700fa7767c5Sopenharmony_ci int64_t seekPos {5000}; // 5000 MS 701fa7767c5Sopenharmony_ci int64_t currentMS {0}; 702fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 703fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 704fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 705fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 706fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 707fa7767c5Sopenharmony_ci ASSERT_TRUE(player->IsPlaying()); 708fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(3000)); // 3000 MS 709fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Pause()); 710fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Seek(seekPos)); 711fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->GetCurrentTime(currentMS)); 712fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 713fa7767c5Sopenharmony_ci } 714fa7767c5Sopenharmony_ci 715fa7767c5Sopenharmony_ci void TestPreparePlayStopSeekRelease(std::string url, int32_t fileSize) 716fa7767c5Sopenharmony_ci { 717fa7767c5Sopenharmony_ci int64_t seekPos {5000}; 718fa7767c5Sopenharmony_ci int64_t currentMS {0}; 719fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 720fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 721fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 722fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 723fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 724fa7767c5Sopenharmony_ci ASSERT_TRUE(player->IsPlaying()); 725fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(3000)); // 3000 MS 726fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Stop()); 727fa7767c5Sopenharmony_ci ASSERT_NE(0, player->Seek(seekPos)); 728fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->GetCurrentTime(currentMS)); 729fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 730fa7767c5Sopenharmony_ci } 731fa7767c5Sopenharmony_ci 732fa7767c5Sopenharmony_ci void TestPreparePlayResetSeekRelease(std::string url, int32_t fileSize) 733fa7767c5Sopenharmony_ci { 734fa7767c5Sopenharmony_ci int64_t seekPos {5000}; // 5000 MS 735fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 736fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 737fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 738fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 739fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 740fa7767c5Sopenharmony_ci ASSERT_TRUE(player->IsPlaying()); 741fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(3000)); // 3000 MS 742fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Reset()); 743fa7767c5Sopenharmony_ci ASSERT_NE(0, player->Seek(seekPos)); 744fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 745fa7767c5Sopenharmony_ci } 746fa7767c5Sopenharmony_ci 747fa7767c5Sopenharmony_ci void TestPreparePlaySetvolumeSeekRelease(std::string url, int32_t fileSize) 748fa7767c5Sopenharmony_ci { 749fa7767c5Sopenharmony_ci float leftVolume {1}; 750fa7767c5Sopenharmony_ci float rightVolume {1}; 751fa7767c5Sopenharmony_ci int64_t seekPos {5000}; 752fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 753fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 754fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 755fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 756fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 757fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetVolume(leftVolume, rightVolume)); 758fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Seek(seekPos)); 759fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 760fa7767c5Sopenharmony_ci } 761fa7767c5Sopenharmony_ci 762fa7767c5Sopenharmony_ci void TestSetSourceSeekRelease(std::string url, int32_t fileSize) 763fa7767c5Sopenharmony_ci { 764fa7767c5Sopenharmony_ci int64_t seekPos {5000}; 765fa7767c5Sopenharmony_ci int64_t currentMS {0}; 766fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 767fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 768fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 769fa7767c5Sopenharmony_ci ASSERT_NE(0, player->Seek(seekPos)); 770fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->GetCurrentTime(currentMS)); 771fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 772fa7767c5Sopenharmony_ci } 773fa7767c5Sopenharmony_ci 774fa7767c5Sopenharmony_ci void TestPreparePlay3SeekRelease(std::string url, int32_t fileSize) 775fa7767c5Sopenharmony_ci { 776fa7767c5Sopenharmony_ci int64_t seekPos {5000}; 777fa7767c5Sopenharmony_ci int64_t currentMS {0}; 778fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 779fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 780fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 781fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 782fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 783fa7767c5Sopenharmony_ci ASSERT_TRUE(player->IsPlaying()); 784fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(3000)); // 3000 MS 785fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Seek(seekPos, OHOS::Media::PlayerSeekMode::SEEK_NEXT_SYNC)); 786fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->GetCurrentTime(currentMS)); 787fa7767c5Sopenharmony_ci seekPos = 5000; // 5000 MS 788fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Seek(seekPos, OHOS::Media::PlayerSeekMode::SEEK_PREVIOUS_SYNC)); 789fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->GetCurrentTime(currentMS)); 790fa7767c5Sopenharmony_ci seekPos = 5000; // 5000 MS 791fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Seek(seekPos, OHOS::Media::PlayerSeekMode::SEEK_NEXT_SYNC)); 792fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->GetCurrentTime(currentMS)); 793fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 794fa7767c5Sopenharmony_ci } 795fa7767c5Sopenharmony_ci 796fa7767c5Sopenharmony_ci void TestPreparePlaySeekOutValueRelease(std::string url, int32_t fileSize) 797fa7767c5Sopenharmony_ci { 798fa7767c5Sopenharmony_ci int64_t seekPos {-1}; 799fa7767c5Sopenharmony_ci int64_t currentMS {0}; 800fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 801fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 802fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 803fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 804fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 805fa7767c5Sopenharmony_ci ASSERT_TRUE(player->IsPlaying()); 806fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(3000)); // 3000 MS 807fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Seek(seekPos)); 808fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->GetCurrentTime(currentMS)); 809fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 810fa7767c5Sopenharmony_ci } 811fa7767c5Sopenharmony_ci 812fa7767c5Sopenharmony_ci void TestPreparePlaySeekOutValue2Release(std::string url, int32_t fileSize) 813fa7767c5Sopenharmony_ci { 814fa7767c5Sopenharmony_ci int64_t seekPos {0}; 815fa7767c5Sopenharmony_ci int64_t currentMS {0}; 816fa7767c5Sopenharmony_ci int64_t durationMs {0}; 817fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 818fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 819fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 820fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 821fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 822fa7767c5Sopenharmony_ci ASSERT_TRUE(player->IsPlaying()); 823fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(3000)); // 3000 MS 824fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->GetDuration(durationMs)); 825fa7767c5Sopenharmony_ci seekPos = durationMs + 1000; // 1000 MS 826fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Seek(seekPos, OHOS::Media::PlayerSeekMode::SEEK_PREVIOUS_SYNC)); 827fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->GetCurrentTime(currentMS)); 828fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 829fa7767c5Sopenharmony_ci } 830fa7767c5Sopenharmony_ci //fast4 831fa7767c5Sopenharmony_ci void TestPrepareSetvolumeRelease(std::string url, int32_t fileSize) 832fa7767c5Sopenharmony_ci { 833fa7767c5Sopenharmony_ci float leftVolume {1}; 834fa7767c5Sopenharmony_ci float rightVolume {1}; 835fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 836fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 837fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 838fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 839fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetVolume(leftVolume, rightVolume)); 840fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 841fa7767c5Sopenharmony_ci } 842fa7767c5Sopenharmony_ci 843fa7767c5Sopenharmony_ci void TestPreparePlayPauseSetvolumeRelease(std::string url, int32_t fileSize) 844fa7767c5Sopenharmony_ci { 845fa7767c5Sopenharmony_ci float leftVolume {1}; 846fa7767c5Sopenharmony_ci float rightVolume {1}; 847fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 848fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 849fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 850fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 851fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 852fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Pause()); 853fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetVolume(leftVolume, rightVolume)); 854fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 855fa7767c5Sopenharmony_ci } 856fa7767c5Sopenharmony_ci 857fa7767c5Sopenharmony_ci void TestPreparePlayStopSetvolumeRelease(std::string url, int32_t fileSize) 858fa7767c5Sopenharmony_ci { 859fa7767c5Sopenharmony_ci float leftVolume {1}; 860fa7767c5Sopenharmony_ci float rightVolume {1}; 861fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 862fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 863fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 864fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 865fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 866fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Stop()); 867fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetVolume(leftVolume, rightVolume)); 868fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 869fa7767c5Sopenharmony_ci } 870fa7767c5Sopenharmony_ci 871fa7767c5Sopenharmony_ci void TestPreparePlayResetSetvolumeRelease(std::string url, int32_t fileSize) 872fa7767c5Sopenharmony_ci { 873fa7767c5Sopenharmony_ci float leftVolume {1}; 874fa7767c5Sopenharmony_ci float rightVolume {1}; 875fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 876fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 877fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 878fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 879fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 880fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Reset()); 881fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetVolume(leftVolume, rightVolume)); 882fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 883fa7767c5Sopenharmony_ci } 884fa7767c5Sopenharmony_ci 885fa7767c5Sopenharmony_ci void TestPreparePlaySeekSetvolumeRelease(std::string url, int32_t fileSize) 886fa7767c5Sopenharmony_ci { 887fa7767c5Sopenharmony_ci float leftVolume {1}; 888fa7767c5Sopenharmony_ci float rightVolume {1}; 889fa7767c5Sopenharmony_ci int64_t seekPos {5000}; 890fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 891fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 892fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 893fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 894fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 895fa7767c5Sopenharmony_ci ASSERT_TRUE(player->IsPlaying()); 896fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(1000)); // 1000 MS 897fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Seek(seekPos)); 898fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetVolume(leftVolume, rightVolume)); 899fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 900fa7767c5Sopenharmony_ci } 901fa7767c5Sopenharmony_ci 902fa7767c5Sopenharmony_ci void TestSetSourceSetvolumeRelease(std::string url, int32_t fileSize) 903fa7767c5Sopenharmony_ci { 904fa7767c5Sopenharmony_ci float leftVolume {1}; 905fa7767c5Sopenharmony_ci float rightVolume {1}; 906fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 907fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 908fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 909fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetVolume(leftVolume, rightVolume)); 910fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 911fa7767c5Sopenharmony_ci } 912fa7767c5Sopenharmony_ci 913fa7767c5Sopenharmony_ci void TestPreparePlaySetvolumeErrorValueRelease(std::string url, int32_t fileSize) 914fa7767c5Sopenharmony_ci { 915fa7767c5Sopenharmony_ci float leftVolume {-1}; 916fa7767c5Sopenharmony_ci float rightVolume {-1}; 917fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 918fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 919fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 920fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 921fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 922fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(3000)); // 3000 MS 923fa7767c5Sopenharmony_ci ASSERT_NE(0, player->SetVolume(leftVolume, rightVolume)); 924fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 925fa7767c5Sopenharmony_ci } 926fa7767c5Sopenharmony_ci 927fa7767c5Sopenharmony_ci void TestPreparePlaySetvolumeErrorValue2Release(std::string url, int32_t fileSize) 928fa7767c5Sopenharmony_ci { 929fa7767c5Sopenharmony_ci float leftVolume {2}; 930fa7767c5Sopenharmony_ci float rightVolume {2}; 931fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 932fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 933fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 934fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 935fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 936fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(3000)); // 3000 MS 937fa7767c5Sopenharmony_ci ASSERT_NE(0, player->SetVolume(leftVolume, rightVolume)); 938fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 939fa7767c5Sopenharmony_ci } 940fa7767c5Sopenharmony_ci 941fa7767c5Sopenharmony_ci //prepare, setsingleloop true, play, seek, durationtime 3 times, setsingleloop flase, release 942fa7767c5Sopenharmony_ci void TestSetSingleLoop(std::string url, int32_t fileSize) 943fa7767c5Sopenharmony_ci { 944fa7767c5Sopenharmony_ci int64_t durationMs {0}; 945fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 946fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 947fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 948fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 949fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSingleLoop(true)); 950fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 951fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->GetDuration(durationMs)); 952fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Seek(durationMs, OHOS::Media::PlayerSeekMode::SEEK_PREVIOUS_SYNC)); 953fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(3000)); // 3000 MS 954fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->GetDuration(durationMs)); 955fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Seek(durationMs, OHOS::Media::PlayerSeekMode::SEEK_PREVIOUS_SYNC)); 956fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(5000)); // 5000 MS 957fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->GetDuration(durationMs)); 958fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Seek(durationMs, OHOS::Media::PlayerSeekMode::SEEK_PREVIOUS_SYNC)); 959fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(1000)); // 1000 MS 960fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->GetDuration(durationMs)); 961fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Seek(durationMs, OHOS::Media::PlayerSeekMode::SEEK_PREVIOUS_SYNC)); 962fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(8000)); // 8000 MS 963fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSingleLoop(false)); 964fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 965fa7767c5Sopenharmony_ci } 966fa7767c5Sopenharmony_ci 967fa7767c5Sopenharmony_ci //prepare, setsingleloop true, play, seek, set fd, seek 2 times, setsingleloop false, release 968fa7767c5Sopenharmony_ci void TestSetSingleLoop2(std::string url, int32_t fileSize) 969fa7767c5Sopenharmony_ci { 970fa7767c5Sopenharmony_ci int64_t durationMs {0}; 971fa7767c5Sopenharmony_ci std::unique_ptr<TestPlayer> player = TestPlayer::Create(); 972fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(url))); 973fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 974fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 975fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(3000)); // 3000 MS 976fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Pause()); 977fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 978fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(3000)); // 3000 MS 979fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Stop()); 980fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Reset()); 981fa7767c5Sopenharmony_ci std::string uri = FilePathToFd(url, fileSize); 982fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSource(TestSource(uri))); 983fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Prepare()); 984fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSingleLoop(true)); 985fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Play()); 986fa7767c5Sopenharmony_ci ASSERT_TRUE(player->IsPlaying()); 987fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(3000)); // 3000 MS 988fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->GetDuration(durationMs)); 989fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Seek(durationMs/2)); // 2, half the time 990fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Seek(0)); 991fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(1000)); // 1000 MS 992fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->GetDuration(durationMs)); 993fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Seek(durationMs, OHOS::Media::PlayerSeekMode::SEEK_PREVIOUS_SYNC)); 994fa7767c5Sopenharmony_ci std::this_thread::sleep_for(std::chrono::milliseconds(8000)); // 8000 MS 995fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->SetSingleLoop(false)); 996fa7767c5Sopenharmony_ci ASSERT_EQ(0, player->Release()); 997fa7767c5Sopenharmony_ci } 998fa7767c5Sopenharmony_ci 999fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPlayerFinishedAutomatically, TestSize.Level1) 1000fa7767c5Sopenharmony_ci { 1001fa7767c5Sopenharmony_ci for (auto url : vecSource) 1002fa7767c5Sopenharmony_ci { 1003fa7767c5Sopenharmony_ci TestPlayerFinishedAutomatically(url); 1004fa7767c5Sopenharmony_ci } 1005fa7767c5Sopenharmony_ci } 1006fa7767c5Sopenharmony_ci 1007fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestSinglePlayerFdSourceFinishedAutomatically, TestSize.Level1) 1008fa7767c5Sopenharmony_ci { 1009fa7767c5Sopenharmony_ci for (auto url : vecSource) 1010fa7767c5Sopenharmony_ci { 1011fa7767c5Sopenharmony_ci TestSinglePlayerFdSourceFinishedAutomatically(url, FILE_SIZE); 1012fa7767c5Sopenharmony_ci } 1013fa7767c5Sopenharmony_ci } 1014fa7767c5Sopenharmony_ci 1015fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestSinglePlayerWrongFd, TestSize.Level1) 1016fa7767c5Sopenharmony_ci { 1017fa7767c5Sopenharmony_ci for (auto url : vecSource) 1018fa7767c5Sopenharmony_ci { 1019fa7767c5Sopenharmony_ci TestSinglePlayerWrongFd(url, FILE_SIZE); 1020fa7767c5Sopenharmony_ci } 1021fa7767c5Sopenharmony_ci } 1022fa7767c5Sopenharmony_ci 1023fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlayPauseRelease, TestSize.Level1) 1024fa7767c5Sopenharmony_ci { 1025fa7767c5Sopenharmony_ci for (auto url : vecSource) 1026fa7767c5Sopenharmony_ci { 1027fa7767c5Sopenharmony_ci TestPreparePlayPauseRelease(url); 1028fa7767c5Sopenharmony_ci } 1029fa7767c5Sopenharmony_ci } 1030fa7767c5Sopenharmony_ci 1031fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlayPauseThenRelease, TestSize.Level1) 1032fa7767c5Sopenharmony_ci { 1033fa7767c5Sopenharmony_ci for (auto url : vecSource) 1034fa7767c5Sopenharmony_ci { 1035fa7767c5Sopenharmony_ci TestPreparePlayPauseThenRelease(url); 1036fa7767c5Sopenharmony_ci } 1037fa7767c5Sopenharmony_ci } 1038fa7767c5Sopenharmony_ci 1039fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPrepareWrongFdThenRelease, TestSize.Level1) 1040fa7767c5Sopenharmony_ci { 1041fa7767c5Sopenharmony_ci for (auto url : vecSource) 1042fa7767c5Sopenharmony_ci { 1043fa7767c5Sopenharmony_ci TestPrepareWrongFdThenRelease(url, FILE_SIZE); 1044fa7767c5Sopenharmony_ci } 1045fa7767c5Sopenharmony_ci } 1046fa7767c5Sopenharmony_ci 1047fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPrepareThenRelease, TestSize.Level1) 1048fa7767c5Sopenharmony_ci { 1049fa7767c5Sopenharmony_ci for (auto url : vecSource) 1050fa7767c5Sopenharmony_ci { 1051fa7767c5Sopenharmony_ci TestPrepareThenRelease(url, FILE_SIZE); 1052fa7767c5Sopenharmony_ci } 1053fa7767c5Sopenharmony_ci } 1054fa7767c5Sopenharmony_ci 1055fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlayPrepareRelease, TestSize.Level1) 1056fa7767c5Sopenharmony_ci { 1057fa7767c5Sopenharmony_ci for (auto url : vecSource) 1058fa7767c5Sopenharmony_ci { 1059fa7767c5Sopenharmony_ci TestPreparePlayPrepareRelease(url, FILE_SIZE); 1060fa7767c5Sopenharmony_ci } 1061fa7767c5Sopenharmony_ci } 1062fa7767c5Sopenharmony_ci 1063fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlayPausePrepareRelease, TestSize.Level1) 1064fa7767c5Sopenharmony_ci { 1065fa7767c5Sopenharmony_ci for (auto url : vecSource) 1066fa7767c5Sopenharmony_ci { 1067fa7767c5Sopenharmony_ci TestPreparePlayPausePrepareRelease(url, FILE_SIZE); 1068fa7767c5Sopenharmony_ci } 1069fa7767c5Sopenharmony_ci } 1070fa7767c5Sopenharmony_ci 1071fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlayStopPrepareRelease, TestSize.Level1) 1072fa7767c5Sopenharmony_ci { 1073fa7767c5Sopenharmony_ci for (auto url : vecSource) 1074fa7767c5Sopenharmony_ci { 1075fa7767c5Sopenharmony_ci TestPreparePlayStopPrepareRelease(url, FILE_SIZE); 1076fa7767c5Sopenharmony_ci } 1077fa7767c5Sopenharmony_ci } 1078fa7767c5Sopenharmony_ci 1079fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlayResetSetSourcePrepareRelease, TestSize.Level1) 1080fa7767c5Sopenharmony_ci { 1081fa7767c5Sopenharmony_ci for (auto url : vecSource) 1082fa7767c5Sopenharmony_ci { 1083fa7767c5Sopenharmony_ci TestPreparePlayResetSetSourcePrepareRelease(url, FILE_SIZE); 1084fa7767c5Sopenharmony_ci } 1085fa7767c5Sopenharmony_ci } 1086fa7767c5Sopenharmony_ci 1087fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlaySeekPrepareRelease, TestSize.Level1) 1088fa7767c5Sopenharmony_ci { 1089fa7767c5Sopenharmony_ci for (auto url : vecSource) 1090fa7767c5Sopenharmony_ci { 1091fa7767c5Sopenharmony_ci TestPreparePlaySeekPrepareRelease(url, FILE_SIZE); 1092fa7767c5Sopenharmony_ci } 1093fa7767c5Sopenharmony_ci } 1094fa7767c5Sopenharmony_ci 1095fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlaySetvolumePrepareRelease, TestSize.Level1) 1096fa7767c5Sopenharmony_ci { 1097fa7767c5Sopenharmony_ci for (auto url : vecSource) 1098fa7767c5Sopenharmony_ci { 1099fa7767c5Sopenharmony_ci TestPreparePlaySetvolumePrepareRelease(url, FILE_SIZE); 1100fa7767c5Sopenharmony_ci } 1101fa7767c5Sopenharmony_ci } 1102fa7767c5Sopenharmony_ci 1103fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPrepareRelease, TestSize.Level1) 1104fa7767c5Sopenharmony_ci { 1105fa7767c5Sopenharmony_ci for (auto url : vecSource) 1106fa7767c5Sopenharmony_ci { 1107fa7767c5Sopenharmony_ci TestPrepareRelease(url, FILE_SIZE); 1108fa7767c5Sopenharmony_ci } 1109fa7767c5Sopenharmony_ci } 1110fa7767c5Sopenharmony_ci 1111fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, Test3PrepareRelease, TestSize.Level1) 1112fa7767c5Sopenharmony_ci { 1113fa7767c5Sopenharmony_ci for (auto url : vecSource) 1114fa7767c5Sopenharmony_ci { 1115fa7767c5Sopenharmony_ci Test3PrepareRelease(url, FILE_SIZE); 1116fa7767c5Sopenharmony_ci } 1117fa7767c5Sopenharmony_ci } 1118fa7767c5Sopenharmony_ci 1119fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlayRelease, TestSize.Level1) 1120fa7767c5Sopenharmony_ci { 1121fa7767c5Sopenharmony_ci for (auto url : vecSource) 1122fa7767c5Sopenharmony_ci { 1123fa7767c5Sopenharmony_ci TestPreparePlayRelease(url, FILE_SIZE); 1124fa7767c5Sopenharmony_ci } 1125fa7767c5Sopenharmony_ci } 1126fa7767c5Sopenharmony_ci 1127fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlayPausePlayRelease, TestSize.Level1) 1128fa7767c5Sopenharmony_ci { 1129fa7767c5Sopenharmony_ci for (auto url : vecSource) 1130fa7767c5Sopenharmony_ci { 1131fa7767c5Sopenharmony_ci TestPreparePlayPausePlayRelease(url, FILE_SIZE); 1132fa7767c5Sopenharmony_ci } 1133fa7767c5Sopenharmony_ci } 1134fa7767c5Sopenharmony_ci 1135fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlayStopPlayRelease, TestSize.Level1) 1136fa7767c5Sopenharmony_ci { 1137fa7767c5Sopenharmony_ci for (auto url : vecSource) 1138fa7767c5Sopenharmony_ci { 1139fa7767c5Sopenharmony_ci TestPreparePlayStopPlayRelease(url, FILE_SIZE); 1140fa7767c5Sopenharmony_ci } 1141fa7767c5Sopenharmony_ci } 1142fa7767c5Sopenharmony_ci 1143fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlayResetPlayRelease, TestSize.Level1) 1144fa7767c5Sopenharmony_ci { 1145fa7767c5Sopenharmony_ci for (auto url : vecSource) 1146fa7767c5Sopenharmony_ci { 1147fa7767c5Sopenharmony_ci TestPreparePlayResetPlayRelease(url, FILE_SIZE); 1148fa7767c5Sopenharmony_ci } 1149fa7767c5Sopenharmony_ci } 1150fa7767c5Sopenharmony_ci 1151fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlaySeekRelease, TestSize.Level1) 1152fa7767c5Sopenharmony_ci { 1153fa7767c5Sopenharmony_ci for (auto url : vecSource) 1154fa7767c5Sopenharmony_ci { 1155fa7767c5Sopenharmony_ci TestPreparePlaySeekRelease(url, FILE_SIZE); 1156fa7767c5Sopenharmony_ci } 1157fa7767c5Sopenharmony_ci } 1158fa7767c5Sopenharmony_ci 1159fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlaySetvolumeRelease, TestSize.Level1) 1160fa7767c5Sopenharmony_ci { 1161fa7767c5Sopenharmony_ci for (auto url : vecSource) 1162fa7767c5Sopenharmony_ci { 1163fa7767c5Sopenharmony_ci TestPreparePlaySetvolumeRelease(url, FILE_SIZE); 1164fa7767c5Sopenharmony_ci } 1165fa7767c5Sopenharmony_ci } 1166fa7767c5Sopenharmony_ci 1167fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPlayRelease, TestSize.Level1) 1168fa7767c5Sopenharmony_ci { 1169fa7767c5Sopenharmony_ci for (auto url : vecSource) 1170fa7767c5Sopenharmony_ci { 1171fa7767c5Sopenharmony_ci TestPlayRelease(url, FILE_SIZE); 1172fa7767c5Sopenharmony_ci } 1173fa7767c5Sopenharmony_ci } 1174fa7767c5Sopenharmony_ci 1175fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPrepare3PlayRelease, TestSize.Level1) 1176fa7767c5Sopenharmony_ci { 1177fa7767c5Sopenharmony_ci for (auto url : vecSource) 1178fa7767c5Sopenharmony_ci { 1179fa7767c5Sopenharmony_ci TestPrepare3PlayRelease(url, FILE_SIZE); 1180fa7767c5Sopenharmony_ci } 1181fa7767c5Sopenharmony_ci } 1182fa7767c5Sopenharmony_ci 1183fa7767c5Sopenharmony_ci // fast2 1184fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestCreatePauseRelease, TestSize.Level1) 1185fa7767c5Sopenharmony_ci { 1186fa7767c5Sopenharmony_ci for (auto url : vecSource) 1187fa7767c5Sopenharmony_ci { 1188fa7767c5Sopenharmony_ci TestCreatePauseRelease(url, FILE_SIZE); 1189fa7767c5Sopenharmony_ci } 1190fa7767c5Sopenharmony_ci } 1191fa7767c5Sopenharmony_ci 1192fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePauseRelease, TestSize.Level1) 1193fa7767c5Sopenharmony_ci { 1194fa7767c5Sopenharmony_ci for (auto url : vecSource) 1195fa7767c5Sopenharmony_ci { 1196fa7767c5Sopenharmony_ci TestPreparePauseRelease(url, FILE_SIZE); 1197fa7767c5Sopenharmony_ci } 1198fa7767c5Sopenharmony_ci } 1199fa7767c5Sopenharmony_ci 1200fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlayStopPauseRelease, TestSize.Level1) 1201fa7767c5Sopenharmony_ci { 1202fa7767c5Sopenharmony_ci for (auto url : vecSource) 1203fa7767c5Sopenharmony_ci { 1204fa7767c5Sopenharmony_ci TestPreparePlayStopPauseRelease(url, FILE_SIZE); 1205fa7767c5Sopenharmony_ci } 1206fa7767c5Sopenharmony_ci } 1207fa7767c5Sopenharmony_ci 1208fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlayResetPauseRelease, TestSize.Level1) 1209fa7767c5Sopenharmony_ci { 1210fa7767c5Sopenharmony_ci for (auto url : vecSource) 1211fa7767c5Sopenharmony_ci { 1212fa7767c5Sopenharmony_ci TestPreparePlayResetPauseRelease(url, FILE_SIZE); 1213fa7767c5Sopenharmony_ci } 1214fa7767c5Sopenharmony_ci } 1215fa7767c5Sopenharmony_ci 1216fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlaySeekPauseRelease, TestSize.Level1) 1217fa7767c5Sopenharmony_ci { 1218fa7767c5Sopenharmony_ci for (auto url : vecSource) 1219fa7767c5Sopenharmony_ci { 1220fa7767c5Sopenharmony_ci TestPreparePlaySeekPauseRelease(url, FILE_SIZE); 1221fa7767c5Sopenharmony_ci } 1222fa7767c5Sopenharmony_ci } 1223fa7767c5Sopenharmony_ci 1224fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlaySetvolumePauseRelease, TestSize.Level1) 1225fa7767c5Sopenharmony_ci { 1226fa7767c5Sopenharmony_ci for (auto url : vecSource) 1227fa7767c5Sopenharmony_ci { 1228fa7767c5Sopenharmony_ci TestPreparePlaySetvolumePauseRelease(url, FILE_SIZE); 1229fa7767c5Sopenharmony_ci } 1230fa7767c5Sopenharmony_ci } 1231fa7767c5Sopenharmony_ci 1232fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestCreateSetSourcePauseRelease, TestSize.Level1) 1233fa7767c5Sopenharmony_ci { 1234fa7767c5Sopenharmony_ci for (auto url : vecSource) 1235fa7767c5Sopenharmony_ci { 1236fa7767c5Sopenharmony_ci TestCreateSetSourcePauseRelease(url, FILE_SIZE); 1237fa7767c5Sopenharmony_ci } 1238fa7767c5Sopenharmony_ci } 1239fa7767c5Sopenharmony_ci 1240fa7767c5Sopenharmony_ci 1241fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlay3PauseRelease, TestSize.Level1) 1242fa7767c5Sopenharmony_ci { 1243fa7767c5Sopenharmony_ci for (auto url : vecSource) 1244fa7767c5Sopenharmony_ci { 1245fa7767c5Sopenharmony_ci TestPreparePlay3PauseRelease(url, FILE_SIZE); 1246fa7767c5Sopenharmony_ci } 1247fa7767c5Sopenharmony_ci } 1248fa7767c5Sopenharmony_ci 1249fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestCreateStopRelease, TestSize.Level1) 1250fa7767c5Sopenharmony_ci { 1251fa7767c5Sopenharmony_ci for (auto url : vecSource) 1252fa7767c5Sopenharmony_ci { 1253fa7767c5Sopenharmony_ci TestCreateStopRelease(url, FILE_SIZE); 1254fa7767c5Sopenharmony_ci } 1255fa7767c5Sopenharmony_ci } 1256fa7767c5Sopenharmony_ci 1257fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPrepareStopRelease, TestSize.Level1) 1258fa7767c5Sopenharmony_ci { 1259fa7767c5Sopenharmony_ci for (auto url : vecSource) 1260fa7767c5Sopenharmony_ci { 1261fa7767c5Sopenharmony_ci TestPrepareStopRelease(url, FILE_SIZE); 1262fa7767c5Sopenharmony_ci } 1263fa7767c5Sopenharmony_ci } 1264fa7767c5Sopenharmony_ci 1265fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlayStopRelease, TestSize.Level1) 1266fa7767c5Sopenharmony_ci { 1267fa7767c5Sopenharmony_ci for (auto url : vecSource) 1268fa7767c5Sopenharmony_ci { 1269fa7767c5Sopenharmony_ci TestPreparePlayStopRelease(url, FILE_SIZE); 1270fa7767c5Sopenharmony_ci } 1271fa7767c5Sopenharmony_ci } 1272fa7767c5Sopenharmony_ci 1273fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlayPauseStopRelease, TestSize.Level1) 1274fa7767c5Sopenharmony_ci { 1275fa7767c5Sopenharmony_ci for (auto url : vecSource) 1276fa7767c5Sopenharmony_ci { 1277fa7767c5Sopenharmony_ci TestPreparePlayPauseStopRelease(url, FILE_SIZE); 1278fa7767c5Sopenharmony_ci } 1279fa7767c5Sopenharmony_ci } 1280fa7767c5Sopenharmony_ci 1281fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlayResetStopRelease, TestSize.Level1) 1282fa7767c5Sopenharmony_ci { 1283fa7767c5Sopenharmony_ci for (auto url : vecSource) 1284fa7767c5Sopenharmony_ci { 1285fa7767c5Sopenharmony_ci TestPreparePlayResetStopRelease(url, FILE_SIZE); 1286fa7767c5Sopenharmony_ci } 1287fa7767c5Sopenharmony_ci } 1288fa7767c5Sopenharmony_ci 1289fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlaySeekStopRelease, TestSize.Level1) 1290fa7767c5Sopenharmony_ci { 1291fa7767c5Sopenharmony_ci for (auto url : vecSource) 1292fa7767c5Sopenharmony_ci { 1293fa7767c5Sopenharmony_ci TestPreparePlaySeekStopRelease(url, FILE_SIZE); 1294fa7767c5Sopenharmony_ci } 1295fa7767c5Sopenharmony_ci } 1296fa7767c5Sopenharmony_ci 1297fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlaySetvolumeStopRelease, TestSize.Level1) 1298fa7767c5Sopenharmony_ci { 1299fa7767c5Sopenharmony_ci for (auto url : vecSource) 1300fa7767c5Sopenharmony_ci { 1301fa7767c5Sopenharmony_ci TestPreparePlaySetvolumeStopRelease(url, FILE_SIZE); 1302fa7767c5Sopenharmony_ci } 1303fa7767c5Sopenharmony_ci } 1304fa7767c5Sopenharmony_ci 1305fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlaySpeedStopRelease, TestSize.Level1) 1306fa7767c5Sopenharmony_ci { 1307fa7767c5Sopenharmony_ci for (auto url : vecSource) 1308fa7767c5Sopenharmony_ci { 1309fa7767c5Sopenharmony_ci TestPreparePlaySpeedStopRelease(url, FILE_SIZE); 1310fa7767c5Sopenharmony_ci } 1311fa7767c5Sopenharmony_ci } 1312fa7767c5Sopenharmony_ci 1313fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestCreateSetSourceStopRelease, TestSize.Level1) 1314fa7767c5Sopenharmony_ci { 1315fa7767c5Sopenharmony_ci for (auto url : vecSource) 1316fa7767c5Sopenharmony_ci { 1317fa7767c5Sopenharmony_ci TestCreateSetSourceStopRelease(url, FILE_SIZE); 1318fa7767c5Sopenharmony_ci } 1319fa7767c5Sopenharmony_ci } 1320fa7767c5Sopenharmony_ci 1321fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlay3StopRelease, TestSize.Level1) 1322fa7767c5Sopenharmony_ci { 1323fa7767c5Sopenharmony_ci for (auto url : vecSource) 1324fa7767c5Sopenharmony_ci { 1325fa7767c5Sopenharmony_ci TestPreparePlay3StopRelease(url, FILE_SIZE); 1326fa7767c5Sopenharmony_ci } 1327fa7767c5Sopenharmony_ci } 1328fa7767c5Sopenharmony_ci 1329fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPrepareResetRelease, TestSize.Level1) 1330fa7767c5Sopenharmony_ci { 1331fa7767c5Sopenharmony_ci for (auto url : vecSource) 1332fa7767c5Sopenharmony_ci { 1333fa7767c5Sopenharmony_ci TestPreparePlay3StopRelease(url, FILE_SIZE); 1334fa7767c5Sopenharmony_ci } 1335fa7767c5Sopenharmony_ci } 1336fa7767c5Sopenharmony_ci 1337fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlayResetRelease, TestSize.Level1) 1338fa7767c5Sopenharmony_ci { 1339fa7767c5Sopenharmony_ci for (auto url : vecSource) 1340fa7767c5Sopenharmony_ci { 1341fa7767c5Sopenharmony_ci TestPreparePlayResetRelease(url, FILE_SIZE); 1342fa7767c5Sopenharmony_ci } 1343fa7767c5Sopenharmony_ci } 1344fa7767c5Sopenharmony_ci 1345fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlayPauseResetRelease, TestSize.Level1) 1346fa7767c5Sopenharmony_ci { 1347fa7767c5Sopenharmony_ci for (auto url : vecSource) 1348fa7767c5Sopenharmony_ci { 1349fa7767c5Sopenharmony_ci TestPreparePlayPauseResetRelease(url, FILE_SIZE); 1350fa7767c5Sopenharmony_ci } 1351fa7767c5Sopenharmony_ci } 1352fa7767c5Sopenharmony_ci 1353fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlayStopResetRelease, TestSize.Level1) 1354fa7767c5Sopenharmony_ci { 1355fa7767c5Sopenharmony_ci for (auto url : vecSource) 1356fa7767c5Sopenharmony_ci { 1357fa7767c5Sopenharmony_ci TestPreparePlayStopResetRelease(url, FILE_SIZE); 1358fa7767c5Sopenharmony_ci } 1359fa7767c5Sopenharmony_ci } 1360fa7767c5Sopenharmony_ci 1361fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlaySeekResetRelease, TestSize.Level1) 1362fa7767c5Sopenharmony_ci { 1363fa7767c5Sopenharmony_ci for (auto url : vecSource) 1364fa7767c5Sopenharmony_ci { 1365fa7767c5Sopenharmony_ci TestPreparePlaySeekResetRelease(url, FILE_SIZE); 1366fa7767c5Sopenharmony_ci } 1367fa7767c5Sopenharmony_ci } 1368fa7767c5Sopenharmony_ci 1369fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPrepare3ResetRelease, TestSize.Level1) 1370fa7767c5Sopenharmony_ci { 1371fa7767c5Sopenharmony_ci for (auto url : vecSource) 1372fa7767c5Sopenharmony_ci { 1373fa7767c5Sopenharmony_ci TestPrepare3ResetRelease(url, FILE_SIZE); 1374fa7767c5Sopenharmony_ci } 1375fa7767c5Sopenharmony_ci } 1376fa7767c5Sopenharmony_ci 1377fa7767c5Sopenharmony_ci // fast3 1378fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestCreateReset, TestSize.Level1) 1379fa7767c5Sopenharmony_ci { 1380fa7767c5Sopenharmony_ci for (auto url : vecSource) 1381fa7767c5Sopenharmony_ci { 1382fa7767c5Sopenharmony_ci TestCreateReset(url, FILE_SIZE); 1383fa7767c5Sopenharmony_ci } 1384fa7767c5Sopenharmony_ci } 1385fa7767c5Sopenharmony_ci 1386fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestCreateSeekRelease, TestSize.Level1) 1387fa7767c5Sopenharmony_ci { 1388fa7767c5Sopenharmony_ci for (auto url : vecSource) 1389fa7767c5Sopenharmony_ci { 1390fa7767c5Sopenharmony_ci TestCreateSeekRelease(url, FILE_SIZE); 1391fa7767c5Sopenharmony_ci } 1392fa7767c5Sopenharmony_ci } 1393fa7767c5Sopenharmony_ci 1394fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPrepareSeekRelease, TestSize.Level1) 1395fa7767c5Sopenharmony_ci { 1396fa7767c5Sopenharmony_ci for (auto url : vecSource) 1397fa7767c5Sopenharmony_ci { 1398fa7767c5Sopenharmony_ci TestPrepareSeekRelease(url, FILE_SIZE); 1399fa7767c5Sopenharmony_ci } 1400fa7767c5Sopenharmony_ci } 1401fa7767c5Sopenharmony_ci 1402fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlaySeekRelease300, TestSize.Level1) 1403fa7767c5Sopenharmony_ci { 1404fa7767c5Sopenharmony_ci for (auto url : vecSource) 1405fa7767c5Sopenharmony_ci { 1406fa7767c5Sopenharmony_ci TestPreparePlaySeekRelease300(url, FILE_SIZE); 1407fa7767c5Sopenharmony_ci } 1408fa7767c5Sopenharmony_ci } 1409fa7767c5Sopenharmony_ci 1410fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlayPauseSeekRelease, TestSize.Level1) 1411fa7767c5Sopenharmony_ci { 1412fa7767c5Sopenharmony_ci for (auto url : vecSource) 1413fa7767c5Sopenharmony_ci { 1414fa7767c5Sopenharmony_ci TestPreparePlayPauseSeekRelease(url, FILE_SIZE); 1415fa7767c5Sopenharmony_ci } 1416fa7767c5Sopenharmony_ci } 1417fa7767c5Sopenharmony_ci 1418fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlayStopSeekRelease, TestSize.Level1) 1419fa7767c5Sopenharmony_ci { 1420fa7767c5Sopenharmony_ci for (auto url : vecSource) 1421fa7767c5Sopenharmony_ci { 1422fa7767c5Sopenharmony_ci TestPreparePlayStopSeekRelease(url, FILE_SIZE); 1423fa7767c5Sopenharmony_ci } 1424fa7767c5Sopenharmony_ci } 1425fa7767c5Sopenharmony_ci 1426fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlayResetSeekRelease, TestSize.Level1) 1427fa7767c5Sopenharmony_ci { 1428fa7767c5Sopenharmony_ci for (auto url : vecSource) 1429fa7767c5Sopenharmony_ci { 1430fa7767c5Sopenharmony_ci TestPreparePlayResetSeekRelease(url, FILE_SIZE); 1431fa7767c5Sopenharmony_ci } 1432fa7767c5Sopenharmony_ci } 1433fa7767c5Sopenharmony_ci 1434fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlaySetvolumeSeekRelease, TestSize.Level1) 1435fa7767c5Sopenharmony_ci { 1436fa7767c5Sopenharmony_ci for (auto url : vecSource) 1437fa7767c5Sopenharmony_ci { 1438fa7767c5Sopenharmony_ci TestPreparePlaySetvolumeSeekRelease(url, FILE_SIZE); 1439fa7767c5Sopenharmony_ci } 1440fa7767c5Sopenharmony_ci } 1441fa7767c5Sopenharmony_ci 1442fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestSetSourceSeekRelease, TestSize.Level1) 1443fa7767c5Sopenharmony_ci { 1444fa7767c5Sopenharmony_ci for (auto url : vecSource) 1445fa7767c5Sopenharmony_ci { 1446fa7767c5Sopenharmony_ci TestSetSourceSeekRelease(url, FILE_SIZE); 1447fa7767c5Sopenharmony_ci } 1448fa7767c5Sopenharmony_ci } 1449fa7767c5Sopenharmony_ci 1450fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlay3SeekRelease, TestSize.Level1) 1451fa7767c5Sopenharmony_ci { 1452fa7767c5Sopenharmony_ci for (auto url : vecSource) 1453fa7767c5Sopenharmony_ci { 1454fa7767c5Sopenharmony_ci TestPreparePlay3SeekRelease(url, FILE_SIZE); 1455fa7767c5Sopenharmony_ci } 1456fa7767c5Sopenharmony_ci } 1457fa7767c5Sopenharmony_ci 1458fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlaySeekOutValueRelease, TestSize.Level1) 1459fa7767c5Sopenharmony_ci { 1460fa7767c5Sopenharmony_ci for (auto url : vecSource) 1461fa7767c5Sopenharmony_ci { 1462fa7767c5Sopenharmony_ci TestPreparePlaySeekOutValueRelease(url, FILE_SIZE); 1463fa7767c5Sopenharmony_ci } 1464fa7767c5Sopenharmony_ci } 1465fa7767c5Sopenharmony_ci 1466fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlaySeekOutValue2Release, TestSize.Level1) 1467fa7767c5Sopenharmony_ci { 1468fa7767c5Sopenharmony_ci for (auto url : vecSource) 1469fa7767c5Sopenharmony_ci { 1470fa7767c5Sopenharmony_ci TestPreparePlaySeekOutValue2Release(url, FILE_SIZE); 1471fa7767c5Sopenharmony_ci } 1472fa7767c5Sopenharmony_ci } 1473fa7767c5Sopenharmony_ci //fast4 1474fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPrepareSetvolumeRelease, TestSize.Level1) 1475fa7767c5Sopenharmony_ci { 1476fa7767c5Sopenharmony_ci for (auto url : vecSource) 1477fa7767c5Sopenharmony_ci { 1478fa7767c5Sopenharmony_ci TestPrepareSetvolumeRelease(url, FILE_SIZE); 1479fa7767c5Sopenharmony_ci } 1480fa7767c5Sopenharmony_ci } 1481fa7767c5Sopenharmony_ci 1482fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlayPauseSetvolumeRelease, TestSize.Level1) 1483fa7767c5Sopenharmony_ci { 1484fa7767c5Sopenharmony_ci for (auto url : vecSource) 1485fa7767c5Sopenharmony_ci { 1486fa7767c5Sopenharmony_ci TestPreparePlayPauseSetvolumeRelease(url, FILE_SIZE); 1487fa7767c5Sopenharmony_ci } 1488fa7767c5Sopenharmony_ci } 1489fa7767c5Sopenharmony_ci 1490fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlayStopSetvolumeRelease, TestSize.Level1) 1491fa7767c5Sopenharmony_ci { 1492fa7767c5Sopenharmony_ci for (auto url : vecSource) 1493fa7767c5Sopenharmony_ci { 1494fa7767c5Sopenharmony_ci TestPreparePlayStopSetvolumeRelease(url, FILE_SIZE); 1495fa7767c5Sopenharmony_ci } 1496fa7767c5Sopenharmony_ci } 1497fa7767c5Sopenharmony_ci 1498fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlayResetSetvolumeRelease, TestSize.Level1) 1499fa7767c5Sopenharmony_ci { 1500fa7767c5Sopenharmony_ci for (auto url : vecSource) 1501fa7767c5Sopenharmony_ci { 1502fa7767c5Sopenharmony_ci TestPreparePlayResetSetvolumeRelease(url, FILE_SIZE); 1503fa7767c5Sopenharmony_ci } 1504fa7767c5Sopenharmony_ci } 1505fa7767c5Sopenharmony_ci 1506fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlaySeekSetvolumeRelease, TestSize.Level1) 1507fa7767c5Sopenharmony_ci { 1508fa7767c5Sopenharmony_ci for (auto url : vecSource) 1509fa7767c5Sopenharmony_ci { 1510fa7767c5Sopenharmony_ci TestPreparePlaySeekSetvolumeRelease(url, FILE_SIZE); 1511fa7767c5Sopenharmony_ci } 1512fa7767c5Sopenharmony_ci } 1513fa7767c5Sopenharmony_ci 1514fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestSetSourceSetvolumeRelease, TestSize.Level1) 1515fa7767c5Sopenharmony_ci { 1516fa7767c5Sopenharmony_ci for (auto url : vecSource) 1517fa7767c5Sopenharmony_ci { 1518fa7767c5Sopenharmony_ci TestSetSourceSetvolumeRelease(url, FILE_SIZE); 1519fa7767c5Sopenharmony_ci } 1520fa7767c5Sopenharmony_ci } 1521fa7767c5Sopenharmony_ci 1522fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlaySetvolumeErrorValueRelease, TestSize.Level1) 1523fa7767c5Sopenharmony_ci { 1524fa7767c5Sopenharmony_ci for (auto url : vecSource) 1525fa7767c5Sopenharmony_ci { 1526fa7767c5Sopenharmony_ci TestPreparePlaySetvolumeErrorValueRelease(url, FILE_SIZE); 1527fa7767c5Sopenharmony_ci } 1528fa7767c5Sopenharmony_ci } 1529fa7767c5Sopenharmony_ci 1530fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestPreparePlaySetvolumeErrorValue2Release, TestSize.Level1) 1531fa7767c5Sopenharmony_ci { 1532fa7767c5Sopenharmony_ci for (auto url : vecSource) 1533fa7767c5Sopenharmony_ci { 1534fa7767c5Sopenharmony_ci TestPreparePlaySetvolumeErrorValue2Release(url, FILE_SIZE); 1535fa7767c5Sopenharmony_ci } 1536fa7767c5Sopenharmony_ci } 1537fa7767c5Sopenharmony_ci 1538fa7767c5Sopenharmony_ci //prepare, setsingleloop true, play, seek, durationtime 3 times, setsingleloop flase, release 1539fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestSetSingleLoop, TestSize.Level1) 1540fa7767c5Sopenharmony_ci { 1541fa7767c5Sopenharmony_ci for (auto url : vecSource) 1542fa7767c5Sopenharmony_ci { 1543fa7767c5Sopenharmony_ci TestSetSingleLoop(url, FILE_SIZE); 1544fa7767c5Sopenharmony_ci } 1545fa7767c5Sopenharmony_ci } 1546fa7767c5Sopenharmony_ci 1547fa7767c5Sopenharmony_ci //prepare, setsingleloop true, play, seek, set fd, seek 2 times, setsingleloop false, release 1548fa7767c5Sopenharmony_ci HST_TEST(UtTestVedioFastPlayer, TestSetSingleLoop2, TestSize.Level1) 1549fa7767c5Sopenharmony_ci { 1550fa7767c5Sopenharmony_ci for (auto url : vecSource) 1551fa7767c5Sopenharmony_ci { 1552fa7767c5Sopenharmony_ci TestSetSingleLoop2(url, FILE_SIZE); 1553fa7767c5Sopenharmony_ci } 1554fa7767c5Sopenharmony_ci } 1555fa7767c5Sopenharmony_ci 1556fa7767c5Sopenharmony_ci} // namespace Test 1557fa7767c5Sopenharmony_ci} // namespace Media 1558fa7767c5Sopenharmony_ci} // namespace OHOS 1559