未验证 提交 941426b0 编写于 作者: O openharmony_ci 提交者: Gitee

!7361 【媒体子系统】取资源方法修改

Merge pull request !7361 from 秦莉文/master
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"test-timeout": "1500000", "test-timeout": "1500000",
"bundle-name": "ohos.acts.multimedia.audio.audiocapturer", "bundle-name": "ohos.acts.multimedia.audio.audiocapturer",
"package-name": "ohos.acts.multimedia.audio.audiocapturer", "package-name": "ohos.acts.multimedia.audio.audiocapturer",
"shell-timeout": "60000" "shell-timeout": "600000"
}, },
"kits": [ "kits": [
{ {
......
...@@ -20,7 +20,7 @@ import mediaLibrary from '@ohos.multimedia.mediaLibrary' ...@@ -20,7 +20,7 @@ import mediaLibrary from '@ohos.multimedia.mediaLibrary'
import fileio from '@ohos.fileio' import fileio from '@ohos.fileio'
import featureAbility from '@ohos.ability.featureAbility' import featureAbility from '@ohos.ability.featureAbility'
import { UiDriver, BY, PointerMatrix } from '@ohos.uitest' import { UiDriver, BY, PointerMatrix } from '@ohos.uitest'
const CODECMIMEVALUE = ['video/avc', 'audio/mp4a-latm', 'audio/mpeg']
const context = featureAbility.getContext(); const context = featureAbility.getContext();
export async function getPermission(permissionNames) { export async function getPermission(permissionNames) {
...@@ -58,7 +58,17 @@ export async function getFileDescriptor(fileName) { ...@@ -58,7 +58,17 @@ export async function getFileDescriptor(fileName) {
}); });
return fileDescriptor; 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) { export async function closeFileDescriptor(fileName) {
await resourceManager.getResourceManager().then(async (mgr) => { await resourceManager.getResourceManager().then(async (mgr) => {
await mgr.closeRawFileDescriptor(fileName).then(()=> { await mgr.closeRawFileDescriptor(fileName).then(()=> {
......
...@@ -12,11 +12,9 @@ ...@@ -12,11 +12,9 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import file from '@system.file'; import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Core, ExpectExtend, InstrumentLog, ReportExtend } from "deccjsunit/index" import { Hypium } from '@ohos/hypium'
import testsuite from "../../../test/List.test.ets" 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 mXComponentController: XComponentController = new XComponentController()
var surfaceId: any var surfaceId: any
...@@ -26,7 +24,7 @@ var surfaceId: any ...@@ -26,7 +24,7 @@ var surfaceId: any
struct Index { struct Index {
aboutToAppear() { aboutToAppear() {
console.info("start run testcase!!!!"); console.info("start run testcase!!!!");
} }
build() { build() {
Flex() { Flex() {
XComponent({ XComponent({
...@@ -41,23 +39,10 @@ struct Index { ...@@ -41,23 +39,10 @@ struct Index {
surfaceId = mXComponentController.getXComponentSurfaceId() surfaceId = mXComponentController.getXComponentSurfaceId()
globalThis.value = surfaceId globalThis.value = surfaceId
console.info('CameraModuleTest: XComponent onLoad surfaceId: ' + globalThis.value) console.info('CameraModuleTest: XComponent onLoad surfaceId: ' + globalThis.value)
const core = Core.getInstance() var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
const expectExtend = new ExpectExtend({ var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
'id': 'extend' console.info('start run testcase!!!')
}) Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
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()---->')
}) })
.width('1920px') .width('1920px')
.height('1080px') .height('1080px')
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import media from '@ohos.multimedia.media' import media from '@ohos.multimedia.media'
import * as mediaTestBase from '../../../../../../MediaTestBase'; import * as mediaTestBase from '../../../../../../MediaTestBase';
import * as AVPlayerTestBase from '../../../../../../AVPlayerTestBase.js'; 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() { export default function AVPlayerHlsFuncTest() {
describe('AVPlayerHlsFuncTest', function () { describe('AVPlayerHlsFuncTest', function () {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import {testAVPlayerFun} from '../../../../../../AVPlayerTestBase.js'; import {testAVPlayerFun} from '../../../../../../AVPlayerTestBase.js';
import * as mediaTestBase from '../../../../../../MediaTestBase'; 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() { export default function AVPlayerHttpCompatibilityTest() {
describe('AVPlayerHttpCompatibilityTest', function () { describe('AVPlayerHttpCompatibilityTest', function () {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import {testAVPlayerSeek} from '../../../../../../AVPlayerTestBase.js'; import {testAVPlayerSeek} from '../../../../../../AVPlayerTestBase.js';
import * as mediaTestBase from '../../../../../../MediaTestBase'; 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() { export default function AVPlayerHttpSeekTest() {
describe('AVPlayerHttpSeekTest', function () { describe('AVPlayerHttpSeekTest', function () {
......
...@@ -17,7 +17,7 @@ import * as mediaTestBase from '../../../../../../MediaTestBase'; ...@@ -17,7 +17,7 @@ import * as mediaTestBase from '../../../../../../MediaTestBase';
import media from '@ohos.multimedia.media' import media from '@ohos.multimedia.media'
import audio from '@ohos.multimedia.audio'; import audio from '@ohos.multimedia.audio';
import { testAVPlayerFun, AV_PLAYER_STATE, setSource } from '../../../../../../AVPlayerTestBase.js'; 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() { export default function AVPlayerLocalTest() {
describe('AVPlayerLocalTest', function () { describe('AVPlayerLocalTest', function () {
...@@ -40,13 +40,13 @@ export default function AVPlayerLocalTest() { ...@@ -40,13 +40,13 @@ export default function AVPlayerLocalTest() {
beforeAll(async function() { beforeAll(async function() {
console.info('beforeAll case'); console.info('beforeAll case');
await mediaTestBase.getFileDescriptor(VIDEO_SOURCE).then((res) => { await mediaTestBase.getStageFileDescriptor(VIDEO_SOURCE).then((res) => {
fileDescriptor = res; fileDescriptor = res;
}); });
await mediaTestBase.getFileDescriptor(AUDIO_SOURCE).then((res) => { await mediaTestBase.getStageFileDescriptor(AUDIO_SOURCE).then((res) => {
fileDescriptor2 = res; fileDescriptor2 = res;
}); });
await mediaTestBase.getFileDescriptor(VIDEO_NOAUDIO).then((res) => { await mediaTestBase.getStageFileDescriptor(VIDEO_NOAUDIO).then((res) => {
fileDescriptor3 = res; fileDescriptor3 = res;
}); });
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册