diff --git a/multimedia/audio/audio_js_standard/AudioCapturer/Test.json b/multimedia/audio/audio_js_standard/AudioCapturer/Test.json index 57064b4d909257ba3a676c63f121b470096f4662..a4c6d2c748ab4776321d2633decbc702b2e99dc3 100644 --- a/multimedia/audio/audio_js_standard/AudioCapturer/Test.json +++ b/multimedia/audio/audio_js_standard/AudioCapturer/Test.json @@ -5,7 +5,7 @@ "test-timeout": "1500000", "bundle-name": "ohos.acts.multimedia.audio.audiocapturer", "package-name": "ohos.acts.multimedia.audio.audiocapturer", - "shell-timeout": "60000" + "shell-timeout": "600000" }, "kits": [ { diff --git a/multimedia/media/media_js_standard/MediaTestBase.js b/multimedia/media/media_js_standard/MediaTestBase.js index 0d2cf22d0dfd8239eae96a3549e6ac9992d79d5b..dea260ba7eec488e69bca3a4d5f21a9e65c8a3b6 100644 --- a/multimedia/media/media_js_standard/MediaTestBase.js +++ b/multimedia/media/media_js_standard/MediaTestBase.js @@ -20,7 +20,7 @@ import mediaLibrary from '@ohos.multimedia.mediaLibrary' import fileio from '@ohos.fileio' import featureAbility from '@ohos.ability.featureAbility' import { UiDriver, BY, PointerMatrix } from '@ohos.uitest' - +const CODECMIMEVALUE = ['video/avc', 'audio/mp4a-latm', 'audio/mpeg'] const context = featureAbility.getContext(); export async function getPermission(permissionNames) { @@ -58,7 +58,17 @@ export async function getFileDescriptor(fileName) { }); return fileDescriptor; } - +export async function getStageFileDescriptor(fileName) { + let fileDescriptor = undefined; + let mgr = globalThis.abilityContext.resourceManager + await mgr.getRawFileDescriptor(fileName).then(value => { + fileDescriptor = {fd: value.fd, offset: value.offset, length: value.length}; + console.log('case getRawFileDescriptor success fileName: ' + fileName); + }).catch(error => { + console.log('case getRawFileDescriptor err: ' + error); + }); + return fileDescriptor; +} export async function closeFileDescriptor(fileName) { await resourceManager.getResourceManager().then(async (mgr) => { await mgr.closeRawFileDescriptor(fileName).then(()=> { diff --git a/multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/MainAbility/pages/index/index.ets b/multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/MainAbility/pages/index/index.ets index 2da1ed7b463f8c46284582fe3a36c2af94b3d5a3..4ac93347da054844963bd54fc81ac249164d183d 100644 --- a/multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/MainAbility/pages/index/index.ets +++ b/multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/MainAbility/pages/index/index.ets @@ -12,11 +12,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import file from '@system.file'; -import { Core, ExpectExtend, InstrumentLog, ReportExtend } from "deccjsunit/index" +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import { Hypium } from '@ohos/hypium' import testsuite from "../../../test/List.test.ets" -import featureAbility from "@ohos.ability.featureAbility" -import { UiDriver, BY } from '@ohos.uitest' var mXComponentController: XComponentController = new XComponentController() var surfaceId: any @@ -26,7 +24,7 @@ var surfaceId: any struct Index { aboutToAppear() { console.info("start run testcase!!!!"); -} + } build() { Flex() { XComponent({ @@ -41,23 +39,10 @@ struct Index { surfaceId = mXComponentController.getXComponentSurfaceId() globalThis.value = surfaceId console.info('CameraModuleTest: XComponent onLoad surfaceId: ' + globalThis.value) - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - const reportExtend = new ReportExtend(file) - - core.addService('report', reportExtend) - core.init() - core.subscribeEvent('task', reportExtend) - const configService = core.getDefaultService('config') - globalThis.abilityWant.parameters.timeout = 70000; - configService.setConfig(globalThis.abilityWant.parameters) - console.info('testsuite()---->') - testsuite() - core.execute() - console.info('core.execute()---->') + var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + console.info('start run testcase!!!') + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) }) .width('1920px') .height('1080px') diff --git a/multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AVPlayerHlsFuncTest.test.js b/multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AVPlayerHlsFuncTest.test.js index 843c07d09a8a4fac42c199c93045ec76e7941c83..ca6cb1b7ccbbc94fdc5a9521cc6c0a4b592e0f8f 100644 --- a/multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AVPlayerHlsFuncTest.test.js +++ b/multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AVPlayerHlsFuncTest.test.js @@ -15,7 +15,7 @@ import media from '@ohos.multimedia.media' import * as mediaTestBase from '../../../../../../MediaTestBase'; import * as AVPlayerTestBase from '../../../../../../AVPlayerTestBase.js'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; export default function AVPlayerHlsFuncTest() { describe('AVPlayerHlsFuncTest', function () { diff --git a/multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AVPlayerHttpCompatibilityTest.test.ets b/multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AVPlayerHttpCompatibilityTest.test.ets index a21579719628499480eaa2c7ca82698c21e25959..65d3b573c6766d94cae3a8cdbc174b33ef94f4ee 100644 --- a/multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AVPlayerHttpCompatibilityTest.test.ets +++ b/multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AVPlayerHttpCompatibilityTest.test.ets @@ -15,7 +15,7 @@ import {testAVPlayerFun} from '../../../../../../AVPlayerTestBase.js'; import * as mediaTestBase from '../../../../../../MediaTestBase'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; export default function AVPlayerHttpCompatibilityTest() { describe('AVPlayerHttpCompatibilityTest', function () { diff --git a/multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AVPlayerHttpSeekTest.test.ets b/multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AVPlayerHttpSeekTest.test.ets index 4ef610c57900c654e32a40cdc1a32c27f15f7678..6dbf9008a08db781c8083597d6247bc7c45c3c79 100644 --- a/multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AVPlayerHttpSeekTest.test.ets +++ b/multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AVPlayerHttpSeekTest.test.ets @@ -15,7 +15,7 @@ import {testAVPlayerSeek} from '../../../../../../AVPlayerTestBase.js'; import * as mediaTestBase from '../../../../../../MediaTestBase'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; export default function AVPlayerHttpSeekTest() { describe('AVPlayerHttpSeekTest', function () { diff --git a/multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AVPlayerLocalTest.test.js b/multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AVPlayerLocalTest.test.js index 6c241633c9ae26907040013d60c73c85d7c0ea0e..8ec9d5634e9a81d5665da1af4f833667c8a773cb 100644 --- a/multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AVPlayerLocalTest.test.js +++ b/multimedia/media/media_js_standard/avPlayer/entry/src/main/ets/test/AVPlayerLocalTest.test.js @@ -17,7 +17,7 @@ import * as mediaTestBase from '../../../../../../MediaTestBase'; import media from '@ohos.multimedia.media' import audio from '@ohos.multimedia.audio'; import { testAVPlayerFun, AV_PLAYER_STATE, setSource } from '../../../../../../AVPlayerTestBase.js'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; export default function AVPlayerLocalTest() { describe('AVPlayerLocalTest', function () { @@ -40,13 +40,13 @@ export default function AVPlayerLocalTest() { beforeAll(async function() { console.info('beforeAll case'); - await mediaTestBase.getFileDescriptor(VIDEO_SOURCE).then((res) => { + await mediaTestBase.getStageFileDescriptor(VIDEO_SOURCE).then((res) => { fileDescriptor = res; }); - await mediaTestBase.getFileDescriptor(AUDIO_SOURCE).then((res) => { + await mediaTestBase.getStageFileDescriptor(AUDIO_SOURCE).then((res) => { fileDescriptor2 = res; }); - await mediaTestBase.getFileDescriptor(VIDEO_NOAUDIO).then((res) => { + await mediaTestBase.getStageFileDescriptor(VIDEO_NOAUDIO).then((res) => { fileDescriptor3 = res; }); })