diff --git a/multimedia/BUILD.gn b/multimedia/BUILD.gn
index aeb53e3ef790eba04a9c4724234d4faf901804d0..1712948c3f527952691d87668cf20036e308ac93 100644
--- a/multimedia/BUILD.gn
+++ b/multimedia/BUILD.gn
@@ -47,7 +47,6 @@ group("multimedia") {
"media/media_js_standard/audioRecorder:audio_recorder_js_hap",
"media/media_js_standard/recorderFormat:recorder_format_js_hap",
"media/media_js_standard/videoPlayer:video_player_js_hap",
- "media/media_js_standard/videoRecorder:video_recorder_js_hap",
"medialibrary/mediaLibrary_album:mediaLibrary_album_hap",
"medialibrary/mediaLibrary_base:mediaLibrary_base_hap",
"medialibrary/mediaLibrary_favorite:mediaLibrary_favorite_hap",
diff --git a/multimedia/media/media_js_standard/videoRecorder/BUILD.gn b/multimedia/media/media_js_standard/videoRecorder/BUILD.gn
deleted file mode 100644
index da902ce473f0a262297837a33f68ba45f989e026..0000000000000000000000000000000000000000
--- a/multimedia/media/media_js_standard/videoRecorder/BUILD.gn
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (C) 2022 Huawei Device Co., Ltd.
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import("//test/xts/tools/build/suite.gni")
-
-ohos_js_hap_suite("video_recorder_js_hap") {
- hap_profile = "./src/main/config.json"
- js2abc = true
- deps = [
- ":video_recorder_js_assets",
- ":video_recorder_resources",
- ]
-
- # shared_libraries = [
- # "//third_party/giflib:libgif",
- # "//third_party/libpng:libpng",
- # ]
- certificate_profile = "./signature/openharmony_sx.p7b"
- hap_name = "ActsVideoRecorderJsTest"
- subsystem_name = "multimedia"
- part_name = "multimedia_player_framework"
-
- # part_name = "prebuilt_hap"
- # subsystem_name = "xts"
-}
-ohos_js_assets("video_recorder_js_assets") {
- js2abc = true
- hap_profile = "./src/main/config.json"
- source_dir = "./src/main/js"
-}
-ohos_resources("video_recorder_resources") {
- sources = [ "./src/main/resources" ]
- hap_profile = "./src/main/config.json"
-}
diff --git a/multimedia/media/media_js_standard/videoRecorder/Test.json b/multimedia/media/media_js_standard/videoRecorder/Test.json
deleted file mode 100644
index 06c299bf8ee2970ca4ff8c1ba7ef88b01a5854a7..0000000000000000000000000000000000000000
--- a/multimedia/media/media_js_standard/videoRecorder/Test.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "description": "Configuration for videoRecorder Tests",
- "driver": {
- "type": "OHJSUnitTest",
- "test-timeout": "1000000",
- "shell-timeout": "1000000",
- "testcase-timeout": 60000,
- "bundle-name": "ohos.acts.multimedia.video.videorecorder",
- "package-name": "ohos.acts.multimedia.video.videorecorder"
- },
- "kits": [
- {
- "test-file-name": [
- "ActsVideoRecorderJsTest.hap"
- ],
- "type": "AppInstallKit",
- "cleanup-apps": true
- },
- {
- "type": "ShellKit",
- "run-command": [
- "rm -rf /storage/media/100/local/files/Videos/*",
- "param set persist.ace.testmode.enabled 1",
- "power-shell wakeup",
- "uinput -T -d 300 600 -m 300 600 300 100 -u 300 100",
- "power-shell setmode 602"
- ],
- "teardown-command":[
- "power-shell setmode 600"
- ],
- "cleanup-apps": true
- }
- ]
-}
\ No newline at end of file
diff --git a/multimedia/media/media_js_standard/videoRecorder/signature/openharmony_sx.p7b b/multimedia/media/media_js_standard/videoRecorder/signature/openharmony_sx.p7b
deleted file mode 100644
index bd3a0757e1438db0c69ff25f9f22ffe1de7cecb6..0000000000000000000000000000000000000000
Binary files a/multimedia/media/media_js_standard/videoRecorder/signature/openharmony_sx.p7b and /dev/null differ
diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/config.json b/multimedia/media/media_js_standard/videoRecorder/src/main/config.json
deleted file mode 100644
index 264cb538687ec9c2dde30c587f52149e3cbb3e7a..0000000000000000000000000000000000000000
--- a/multimedia/media/media_js_standard/videoRecorder/src/main/config.json
+++ /dev/null
@@ -1,132 +0,0 @@
-{
- "app": {
- "apiVersion": {
- "compatible": 6,
- "releaseType": "Beta1",
- "target": 7
- },
- "vendor": "acts",
- "bundleName": "ohos.acts.multimedia.video.videorecorder",
- "version": {
- "code": 1000000,
- "name": "1.0.0"
- }
- },
- "deviceConfig": {
- "default": {
- "debug": true
- }
- },
- "module": {
- "abilities": [
- {
- "skills": [
- {
- "entities": [
- "entity.system.home"
- ],
- "actions": [
- "action.system.home"
- ]
- }
- ],
- "orientation": "unspecified",
- "formsEnabled": false,
- "name": ".MainAbility",
- "srcLanguage": "js",
- "srcPath": "MainAbility",
- "icon": "$media:icon",
- "description": "$string:MainAbility_desc",
- "label": "$string:MainAbility_label",
- "type": "page",
- "visible": true,
- "launchType": "standard"
- },
- {
- "orientation": "unspecified",
- "formsEnabled": false,
- "name": ".TestAbility",
- "srcLanguage": "js",
- "srcPath": "TestAbility",
- "icon": "$media:icon",
- "description": "$string:TestAbility_desc",
- "label": "$string:TestAbility_label",
- "type": "page",
- "visible": true,
- "launchType": "standard"
- }
- ],
- "deviceType": [
- "tablet",
- "default",
- "default",
- "tablet",
- "tv",
- "wearable"
- ],
- "mainAbility": ".MainAbility",
- "distro": {
- "moduleType": "entry",
- "installationFree": false,
- "deliveryWithInstall": true,
- "moduleName": "entry"
- },
- "reqPermissions": [
- {
- "name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS",
- "reason": "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
- },
- {
- "name" : "ohos.permission.CAMERA",
- "reason" : "use ohos.permission.CAMERA"
- },
- {
- "name" : "ohos.permission.MICROPHONE",
- "reason" : "use ohos.permission.MICROPHONE"
- },
- {
- "name" : "ohos.permission.MEDIA_LOCATION",
- "reason" : "use ohos.permission.MEDIA_LOCATION"
- },
- {
- "name" : "ohos.permission.READ_MEDIA",
- "reason" : "use ohos.permission.READ_MEDIA"
- },
- {
- "name" : "ohos.permission.WRITE_MEDIA",
- "reason" : "use ohos.permission.WRITE_MEDIA"
- }
- ],
- "package": "ohos.acts.multimedia.video.videorecorder",
- "name": ".entry",
- "js": [
- {
- "pages": [
- "pages/index/index",
- "pages/surfaceTest/surfaceTest",
- "pages/surfaceTest2/surfaceTest2"
- ],
- "name": "default",
- "window": {
- "designWidth": 720,
- "autoDesignWidth": true
- }
- },
- {
- "pages": [
- "pages/index/index"
- ],
- "name": ".TestAbility",
- "window": {
- "designWidth": 720,
- "autoDesignWidth": false
- }
- }
- ],
- "testRunner": {
- "name": "OpenHarmonyTestRunner",
- "srcPath": "TestRunner"
- },
- "srcPath": ""
- }
-}
\ No newline at end of file
diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/app.js b/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/app.js
deleted file mode 100644
index d52c15124a7ccba9ee44a8f7ef2add29baf4b2d2..0000000000000000000000000000000000000000
--- a/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/app.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2022 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
-import { Hypium } from '@ohos/hypium'
-import testsuite from '../test/List.test'
-
-export default {
- onCreate() {
- console.info('TestApplication onCreate')
- setTimeout(()=>{
- var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
- var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
- console.info('start run testcase!!!')
- Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
- },100)
- },
- onDestroy() {
- console.info("TestApplication onDestroy");
- }
-};
-
diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/i18n/en-US.json b/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/i18n/en-US.json
deleted file mode 100644
index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000
--- a/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/i18n/en-US.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "strings": {
- "hello": "Hello",
- "world": "World"
- }
-}
\ No newline at end of file
diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/i18n/zh-CN.json b/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/i18n/zh-CN.json
deleted file mode 100644
index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000
--- a/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/i18n/zh-CN.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "strings": {
- "hello": "您好",
- "world": "世界"
- }
-}
\ No newline at end of file
diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/pages/index/index.css b/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/pages/index/index.css
deleted file mode 100644
index a80eb6e2bd8ebee08149820f7eb31e2cdaa0077e..0000000000000000000000000000000000000000
--- a/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/pages/index/index.css
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2022 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-.container {
- flex-direction: column;
- justify-content: center;
- align-items: center;
- width: 100%;
- height: 100%;
-}
-
-.title {
- font-size: 40px;
- color: #000000;
- opacity: 0.9;
-}
-
-@media screen and (device-type: tablet) and (orientation: landscape) {
- .title {
- font-size: 100px;
- }
-}
-
-@media screen and (device-type: wearable) {
- .title {
- font-size: 28px;
- color: #FFFFFF;
- }
-}
-
-@media screen and (device-type: tv) {
- .container {
- background-image: url("/common/images/Wallpaper.png");
- background-size: cover;
- background-repeat: no-repeat;
- background-position: center;
- }
-
- .title {
- font-size: 100px;
- color: #FFFFFF;
- }
-}
-
-@media screen and (device-type: phone) and (orientation: landscape) {
- .title {
- font-size: 60px;
- }
-}
diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/pages/index/index.hml b/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/pages/index/index.hml
deleted file mode 100644
index 992653a1e597ed9216a711ead5671df909cd45cd..0000000000000000000000000000000000000000
--- a/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/pages/index/index.hml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
- {{ $t('strings.hello') }} {{ title }}
-
-
diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/pages/index/index.js b/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/pages/index/index.js
deleted file mode 100644
index 9f776a29eacf91263bacf9ddf404b13e8607bd60..0000000000000000000000000000000000000000
--- a/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/pages/index/index.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2022 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-export default {
- data: {
- title: ""
- },
- onInit() {
- this.title = this.$t('strings.world');
- },
- onShow() {
- console.info('onShow finish')
- },
- onReady() {
- },
-}
\ No newline at end of file
diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/pages/surfaceTest/surfaceTest.css b/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/pages/surfaceTest/surfaceTest.css
deleted file mode 100644
index a80eb6e2bd8ebee08149820f7eb31e2cdaa0077e..0000000000000000000000000000000000000000
--- a/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/pages/surfaceTest/surfaceTest.css
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2022 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-.container {
- flex-direction: column;
- justify-content: center;
- align-items: center;
- width: 100%;
- height: 100%;
-}
-
-.title {
- font-size: 40px;
- color: #000000;
- opacity: 0.9;
-}
-
-@media screen and (device-type: tablet) and (orientation: landscape) {
- .title {
- font-size: 100px;
- }
-}
-
-@media screen and (device-type: wearable) {
- .title {
- font-size: 28px;
- color: #FFFFFF;
- }
-}
-
-@media screen and (device-type: tv) {
- .container {
- background-image: url("/common/images/Wallpaper.png");
- background-size: cover;
- background-repeat: no-repeat;
- background-position: center;
- }
-
- .title {
- font-size: 100px;
- color: #FFFFFF;
- }
-}
-
-@media screen and (device-type: phone) and (orientation: landscape) {
- .title {
- font-size: 60px;
- }
-}
diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/pages/surfaceTest/surfaceTest.hml b/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/pages/surfaceTest/surfaceTest.hml
deleted file mode 100644
index 1300c79ad95286856acd61cd9583ebd01ae0d7d1..0000000000000000000000000000000000000000
--- a/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/pages/surfaceTest/surfaceTest.hml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
- VideoRecorder Test
-
-
-
-
-
diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/pages/surfaceTest/surfaceTest.js b/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/pages/surfaceTest/surfaceTest.js
deleted file mode 100644
index 7492ac996c41db35508275b70ea92abc5216154c..0000000000000000000000000000000000000000
--- a/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/pages/surfaceTest/surfaceTest.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2022 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import {Core, ExpectExtend} from 'deccjsunit/index'
-import Fileio from '@ohos.fileio'
-
-export default {
- data: {
- title: ""
- },
- onInit() {
- this.title = this.$t('strings.world');
- },
- onShow() {
- },
- onReady() {
- },
- LoadXcomponent2() {
- globalThis.value = this.$element('XcomponentId2').getXComponentSurfaceId()
- },
-}
\ No newline at end of file
diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/pages/surfaceTest2/surfaceTest2.css b/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/pages/surfaceTest2/surfaceTest2.css
deleted file mode 100644
index a80eb6e2bd8ebee08149820f7eb31e2cdaa0077e..0000000000000000000000000000000000000000
--- a/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/pages/surfaceTest2/surfaceTest2.css
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2022 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-.container {
- flex-direction: column;
- justify-content: center;
- align-items: center;
- width: 100%;
- height: 100%;
-}
-
-.title {
- font-size: 40px;
- color: #000000;
- opacity: 0.9;
-}
-
-@media screen and (device-type: tablet) and (orientation: landscape) {
- .title {
- font-size: 100px;
- }
-}
-
-@media screen and (device-type: wearable) {
- .title {
- font-size: 28px;
- color: #FFFFFF;
- }
-}
-
-@media screen and (device-type: tv) {
- .container {
- background-image: url("/common/images/Wallpaper.png");
- background-size: cover;
- background-repeat: no-repeat;
- background-position: center;
- }
-
- .title {
- font-size: 100px;
- color: #FFFFFF;
- }
-}
-
-@media screen and (device-type: phone) and (orientation: landscape) {
- .title {
- font-size: 60px;
- }
-}
diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/pages/surfaceTest2/surfaceTest2.hml b/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/pages/surfaceTest2/surfaceTest2.hml
deleted file mode 100644
index cb71cc3cc5d2a151a95e0316e30ab5df61008f0d..0000000000000000000000000000000000000000
--- a/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/pages/surfaceTest2/surfaceTest2.hml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
- VideoRecorder Test
-
-
-
-
-
diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/pages/surfaceTest2/surfaceTest2.js b/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/pages/surfaceTest2/surfaceTest2.js
deleted file mode 100644
index b5e87e41ddca2e25b783ca84e8a4d2ba60e88dde..0000000000000000000000000000000000000000
--- a/multimedia/media/media_js_standard/videoRecorder/src/main/js/MainAbility/pages/surfaceTest2/surfaceTest2.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2022 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import {Core, ExpectExtend} from 'deccjsunit/index'
-import Fileio from '@ohos.fileio'
-
-export default {
- data: {
- title: ""
- },
- onInit() {
- this.title = this.$t('strings.world');
- },
- onShow() {
- },
- onReady() {
- },
- LoadXcomponent3() {
- globalThis.value = this.$element('XcomponentId3').getXComponentSurfaceId()
- },
-}
\ No newline at end of file
diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/js/TestAbility/app.js b/multimedia/media/media_js_standard/videoRecorder/src/main/js/TestAbility/app.js
deleted file mode 100644
index 875191631733a62e2bdff76d6b5a2e2f1b130937..0000000000000000000000000000000000000000
--- a/multimedia/media/media_js_standard/videoRecorder/src/main/js/TestAbility/app.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (c) 2022 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export default {
- onCreate() {
- console.info('AceApplication onCreate');
- },
- onDestroy() {
- console.info('AceApplication onDestroy');
- }
-};
diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/js/TestAbility/i18n/en-US.json b/multimedia/media/media_js_standard/videoRecorder/src/main/js/TestAbility/i18n/en-US.json
deleted file mode 100644
index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000
--- a/multimedia/media/media_js_standard/videoRecorder/src/main/js/TestAbility/i18n/en-US.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "strings": {
- "hello": "Hello",
- "world": "World"
- },
- "Files": {
- }
-}
\ No newline at end of file
diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/js/TestAbility/i18n/zh-CN.json b/multimedia/media/media_js_standard/videoRecorder/src/main/js/TestAbility/i18n/zh-CN.json
deleted file mode 100644
index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000
--- a/multimedia/media/media_js_standard/videoRecorder/src/main/js/TestAbility/i18n/zh-CN.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "strings": {
- "hello": "您好",
- "world": "世界"
- },
- "Files": {
- }
-}
\ No newline at end of file
diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/js/TestAbility/pages/index/index.css b/multimedia/media/media_js_standard/videoRecorder/src/main/js/TestAbility/pages/index/index.css
deleted file mode 100644
index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000
--- a/multimedia/media/media_js_standard/videoRecorder/src/main/js/TestAbility/pages/index/index.css
+++ /dev/null
@@ -1,30 +0,0 @@
-.container {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- left: 0px;
- top: 0px;
- width: 100%;
- height: 100%;
-}
-
-.title {
- font-size: 60px;
- text-align: center;
- width: 100%;
- height: 40%;
- margin: 10px;
-}
-
-@media screen and (device-type: phone) and (orientation: landscape) {
- .title {
- font-size: 60px;
- }
-}
-
-@media screen and (device-type: tablet) and (orientation: landscape) {
- .title {
- font-size: 100px;
- }
-}
\ No newline at end of file
diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/js/TestAbility/pages/index/index.hml b/multimedia/media/media_js_standard/videoRecorder/src/main/js/TestAbility/pages/index/index.hml
deleted file mode 100644
index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000
--- a/multimedia/media/media_js_standard/videoRecorder/src/main/js/TestAbility/pages/index/index.hml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
- {{ $t('strings.hello') }} {{ title }}
-
-
diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/js/TestAbility/pages/index/index.js b/multimedia/media/media_js_standard/videoRecorder/src/main/js/TestAbility/pages/index/index.js
deleted file mode 100644
index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000
--- a/multimedia/media/media_js_standard/videoRecorder/src/main/js/TestAbility/pages/index/index.js
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (c) 2022 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export default {
- data: {
- title: ""
- },
- onInit() {
- this.title = this.$t('strings.world');
- }
-}
-
-
-
diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/multimedia/media/media_js_standard/videoRecorder/src/main/js/TestRunner/OpenHarmonyTestRunner.js
deleted file mode 100644
index 05ba5782592890d16fe15add4421c6187bae9511..0000000000000000000000000000000000000000
--- a/multimedia/media/media_js_standard/videoRecorder/src/main/js/TestRunner/OpenHarmonyTestRunner.js
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2022 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
-
-function translateParamsToString(parameters) {
- const keySet = new Set([
- '-s class', '-s notClass', '-s suite', '-s itName',
- '-s level', '-s testType', '-s size', '-s timeout',
- '-s package', '-s dryRun'
- ])
- let targetParams = '';
- for (const key in parameters) {
- if (keySet.has(key)) {
- targetParams += ' ' + key + ' ' + parameters[key]
- }
- }
- return targetParams.trim()
-}
-
- export default {
- onPrepare() {
- console.info('OpenHarmonyTestRunner OnPrepare')
- },
- onRun() {
- console.log('OpenHarmonyTestRunner onRun run')
- var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
- var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
-
- var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.MainAbility'
-
- var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName
- cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters)
- var debug = abilityDelegatorArguments.parameters["-D"]
- console.info('debug value : '+debug)
- if (debug == 'true')
- {
- cmd += ' -D'
- }
- console.info('cmd : '+cmd)
- abilityDelegator.executeShellCommand(cmd, (err, data) => {
- console.info('executeShellCommand : err : ' + JSON.stringify(err));
- console.info('executeShellCommand : data : ' + data.stdResult);
- console.info('executeShellCommand : data : ' + data.exitCode);
- })
- }
-};
diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/List.test.js b/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/List.test.js
deleted file mode 100644
index a2fa95d9e780af3ee43f75b13503bb23fd81bde3..0000000000000000000000000000000000000000
--- a/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/List.test.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright (C) 2022 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import VideoRecorderFuncPromiseTest from './VideoRecorderFuncPromiseTest.test.js'
-import VideoRecorderFuncCallbackTest from './VideoRecorderFuncCallbackTest.test.js'
-import VideoRecorderAPICallbackTest from './VideoRecorderAPICallbackTest.test.js'
-import VideoRecorderEnumTest from './VideoRecorderEnumTest.test.js'
-export default function testsuite() {
- VideoRecorderFuncPromiseTest()
- VideoRecorderFuncCallbackTest()
- VideoRecorderAPICallbackTest()
- VideoRecorderEnumTest()
-}
diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderAPICallbackTest.test.js b/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderAPICallbackTest.test.js
deleted file mode 100644
index ca4e1891e9057f0c5c8a36089dc9222bbf061308..0000000000000000000000000000000000000000
--- a/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderAPICallbackTest.test.js
+++ /dev/null
@@ -1,1178 +0,0 @@
-/*
- * Copyright (C) 2022 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the 'License');
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an 'AS IS' BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import media from '@ohos.multimedia.media'
-import camera from '@ohos.multimedia.camera'
-import * as mediaTestBase from '../../../../../MediaTestBase.js';
-import * as videoRecorderBase from '../../../../../VideoRecorderTestBase.js';
-import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
-
-export default function VideoRecorderAPICallbackTest() {
- describe('VideoRecorderAPICallbackTest', function () {
- const RECORDER_TIME = 3000;
- const PAUSE_TIME = 1000;
- const END_EVENT = 'end';
- const CREATE_EVENT = 'create';
- const PREPARE_EVENT = 'prepare';
- const GETSURFACE_EVENT = 'getInputSurface';
- const START_EVENT = 'start';
- const PAUSE_EVENT = 'pause';
- const RESUME_EVENT = 'resume';
- const STOP_EVENT = 'stop';
- const RESET_EVENT = 'reset';
- const RELEASE_EVENT = 'release';
- const START_STREEAM = 'start_stream';
- const CLOSE_STREAM = 'close_stream';
- const ERROR_EVENT = 'error';
- let cameraManager;
- let cameras;
- let captureSession;
- let videoOutput;
- let surfaceID;
- let fdPath;
- let fdObject;
- let cameraID = 0;
- let playerSurfaceId = '';
- let pageId = 0;
- let videoProfiles;
- let previewProfiles;
- let previewOutput;
- const pagePath1 = 'pages/surfaceTest/surfaceTest';
- const pagePath2 = 'pages/surfaceTest2/surfaceTest2';
- let events = require('events');
- let eventEmitter = new events.EventEmitter();
-
- let configFile = {
- audioBitrate : 48000,
- audioChannels : 2,
- audioCodec : media.CodecMimeType.AUDIO_AAC,
- audioSampleRate : 48000,
- durationTime : 1000,
- fileFormat : media.ContainerFormatType.CFT_MPEG_4,
- videoBitrate : 48000,
- videoCodec : media.CodecMimeType.VIDEO_MPEG4,
- videoFrameWidth : 640,
- videoFrameHeight : 480,
- videoFrameRate : 10
- }
- // rotation 0, 90, 180, 270
- let videoConfig = {
- audioSourceType : media.AudioSourceType.AUDIO_SOURCE_TYPE_MIC,
- videoSourceType : media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_YUV,
- profile : configFile,
- url : 'fd://',
- rotation : 0,
- location : { latitude : 30, longitude : 130 },
- maxSize : 100,
- maxDuration : 500
- }
-
- beforeAll(async function () {
- cameraManager = await camera.getCameraManager(null);
- if (cameraManager != null) {
- console.info('[camera] case getCameraManager success');
- } else {
- console.info('[camera] case getCameraManager failed');
- return;
- }
- await cameraManager.getSupportedCameras().then((cameraDevices)=> {
- cameras = cameraDevices;
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- if (cameras != null) {
- console.info('[camera] case getCameras success');
- } else {
- console.info('[camera] case getCameras failed');
- }
- await cameraManager.getSupportedOutputCapability(cameras[0]).then((cameraoutputcapability) => {
- console.info('[camera] case getSupportedOutputCapability success');
- videoProfiles = cameraoutputcapability.videoProfiles;
- videoProfiles[0].size.height = 480;
- videoProfiles[0].size.width = 640;
- previewProfiles = cameraoutputcapability.previewProfiles;
- previewProfiles[0].size.height = 480;
- previewProfiles[0].size.width = 640;
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback)
- if (previewProfiles[0].format == camera.CameraFormat.CAMERA_FORMAT_YUV_420_SP) {
- console.info('[camera] case format is VIDEO_SOURCE_TYPE_SURFACE_YUV');
- videoConfig.videoSourceType = media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_YUV;
- } else {
- console.info('[camera] case format is VIDEO_SOURCE_TYPE_SURFACE_ES');
- videoConfig.videoSourceType = media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_ES;
- }
- fdObject = await mediaTestBase.getFd('recorder_callback_api.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- console.info('beforeAll case');
- })
-
- beforeEach(async function () {
- await mediaTestBase.toNewPage(pagePath1, pagePath2, pageId);
- pageId = (pageId + 1) % 2;
- await mediaTestBase.msleepAsync(1000).then(
- () => {}, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- playerSurfaceId = globalThis.value;
- surfaceID = null;
- console.info('beforeEach case');
- })
-
- afterEach(function () {
- console.info('afterEach case');
- })
-
- afterAll(async function () {
- await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
- console.info('afterAll case');
- })
-
-
- function printfError(error, done) {
- expect().assertFail();
- console.info(`case error called,errMessage is ${error.message}`);
- done();
- }
-
- function toNextStep(videoRecorder, steps, done) {
- if (steps[0] == END_EVENT) {
- console.info('case success!!');
- done();
- } else {
- eventEmitter.emit(steps[0], videoRecorder, steps, done);
- }
- }
-
- eventEmitter.on(START_STREEAM, async (videoRecorder, steps, done) => {
- steps.shift();
- videoOutput = await cameraManager.createVideoOutput(videoProfiles[0], surfaceID);
- if (videoOutput == null) {
- console.info('[camera] case createVideoOutput failed');
- } else {
- console.info('[camera] case createVideoOutput success');
- }
- previewOutput = await cameraManager.createPreviewOutput(previewProfiles[0], playerSurfaceId)
- captureSession = await videoRecorderBase.initCaptureSession(videoOutput, cameraManager,
- cameras[0], previewOutput);
- await videoOutput.start().then(() => {
- console.info('[camera] case videoOutput start success');
- });
- toNextStep(videoRecorder, steps, done);
- });
-
- eventEmitter.on(CLOSE_STREAM, async (videoRecorder, steps, done) => {
- steps.shift();
- await videoOutput.stop().then(() => {
- console.info('[camera] case videoOutput stop success');
- });
- await videoRecorderBase.stopCaptureSession(captureSession);
- toNextStep(videoRecorder, steps, done);
- });
-
- eventEmitter.on(CREATE_EVENT, async (videoRecorder, steps, done) => {
- steps.shift();
- media.createVideoRecorder((err, recorder) => {
- if (typeof (err) == 'undefined') {
- console.info('case createVideoRecorder success ');
- videoRecorder = recorder;
- expect(videoRecorder.state).assertEqual('idle');
- toNextStep(videoRecorder, steps, done);
- } else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) {
- steps.shift();
- console.info('case createVideoRecorder error hanpped');
- toNextStep(videoRecorder, steps, done);
- } else {
- printfError(err, done);
- }
- });
- });
-
- eventEmitter.on(PREPARE_EVENT, async (videoRecorder, steps, done) => {
- steps.shift();
- videoRecorder.prepare(videoConfig, (err) => {
- if (typeof (err) == 'undefined') {
- console.info('case prepare success');
- expect(videoRecorder.state).assertEqual('prepared');
- toNextStep(videoRecorder, steps, done);
- } else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) {
- steps.shift();
- console.info('case prepare error hanpped');
- toNextStep(videoRecorder, steps, done);
- } else {
- printfError(err, done);
- }
- });
- });
-
- eventEmitter.on(GETSURFACE_EVENT, async (videoRecorder, steps, done) => {
- steps.shift();
- videoRecorder.getInputSurface((err, outPutSurface) => {
- if (typeof (err) == 'undefined') {
- console.info('case getInputSurface success');
- surfaceID = outPutSurface;
- toNextStep(videoRecorder, steps, done);
- } else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) {
- steps.shift();
- console.info('case getInputSurface error hanpped');
- toNextStep(videoRecorder, steps, done);
- } else {
- printfError(err, done);
- }
- });
- });
-
- eventEmitter.on(START_EVENT, async (videoRecorder, steps, done) => {
- steps.shift();
- videoRecorder.start((err) => {
- if (typeof (err) == 'undefined') {
- console.info('case start success');
- expect(videoRecorder.state).assertEqual('playing');
- mediaTestBase.msleep(RECORDER_TIME);
- toNextStep(videoRecorder, steps, done);
- } else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) {
- steps.shift();
- console.info('case start error hanpped');
- toNextStep(videoRecorder, steps, done);
- } else {
- printfError(err, done);
- }
- });
- });
-
- eventEmitter.on(PAUSE_EVENT, async (videoRecorder, steps, done) => {
- steps.shift();
- videoRecorder.pause((err) => {
- if (typeof (err) == 'undefined') {
- console.info('case pause success');
- mediaTestBase.msleep(PAUSE_TIME);
- expect(videoRecorder.state).assertEqual('paused');
- toNextStep(videoRecorder, steps, done);
- } else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) {
- steps.shift();
- console.info('case pause error hanpped');
- toNextStep(videoRecorder, steps, done);
- } else {
- printfError(err, done);
- }
- });
- });
-
- eventEmitter.on(RESUME_EVENT, async (videoRecorder, steps, done) => {
- steps.shift();
- videoRecorder.resume((err) => {
- if (typeof (err) == 'undefined') {
- console.info('case resume success');
- mediaTestBase.msleep(RECORDER_TIME);
- expect(videoRecorder.state).assertEqual('playing');
- toNextStep(videoRecorder, steps, done);
- } else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) {
- steps.shift();
- console.info('case resume error hanpped');
- toNextStep(videoRecorder, steps, done);
- } else {
- printfError(err, done);
- }
- });
- });
-
- eventEmitter.on(STOP_EVENT, async (videoRecorder, steps, done) => {
- steps.shift();
- videoRecorder.stop((err) => {
- if (typeof (err) == 'undefined') {
- console.info('case stop success');
- expect(videoRecorder.state).assertEqual('stopped');
- toNextStep(videoRecorder, steps, done);
- } else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) {
- steps.shift();
- console.info('case stop error hanpped');
- toNextStep(videoRecorder, steps, done);
- } else {
- printfError(err, done);
- }
- });
- });
-
- eventEmitter.on(RESET_EVENT, async (videoRecorder, steps, done) => {
- steps.shift();
- videoRecorder.reset((err) => {
- if (typeof (err) == 'undefined') {
- console.info('case reset success');
- expect(videoRecorder.state).assertEqual('idle');
- toNextStep(videoRecorder, steps, done);
- } else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) {
- steps.shift();
- console.info('case reset error hanpped');
- toNextStep(videoRecorder, steps, done);
- } else {
- printfError(err, done);
- }
- });
- });
-
- eventEmitter.on(RELEASE_EVENT, async (videoRecorder, steps, done) => {
- steps.shift();
- videoRecorder.release((err) => {
- if (typeof (err) == 'undefined') {
- expect(videoRecorder.state).assertEqual('idle');
- console.info('case release success');
- toNextStep(videoRecorder, steps, done);
- } else if ((typeof (err) != 'undefined') && (steps[0] == ERROR_EVENT)) {
- steps.shift();
- console.info('case release error hanpped');
- toNextStep(videoRecorder, steps, done);
- } else {
- printfError(err, done);
- }
- });
- });
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0100
- * @tc.name : 01.create->prepare
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0100', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0200
- * @tc.name : 02.start->prepare
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0200', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
- START_EVENT, PREPARE_EVENT, ERROR_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0300
- * @tc.name : 03.pause->prepare
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0300', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
- START_EVENT, PAUSE_EVENT, CLOSE_STREAM, PREPARE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0400
- * @tc.name : 04.resume->prepare
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0400', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
- START_EVENT, PAUSE_EVENT, RESUME_EVENT,
- PREPARE_EVENT, ERROR_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0500
- * @tc.name : 05.stop->prepare
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0500', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
- START_EVENT, STOP_EVENT, CLOSE_STREAM, PREPARE_EVENT, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0600
- * @tc.name : 06.reset->prepare
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0600', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
- START_EVENT, CLOSE_STREAM, RESET_EVENT, PREPARE_EVENT, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0700
- * @tc.name : 07.getInputSurface->prepare
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0700', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, PREPARE_EVENT,
- ERROR_EVENT, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0800
- * @tc.name : 08.prepare 3 times
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PREPARE_CALLBACK_0800', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, PREPARE_EVENT, ERROR_EVENT,
- PREPARE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0100
- * @tc.name : 01.create->start
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0100', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, START_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0200
- * @tc.name : 02.prepare->start
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0200', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
- START_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0300
- * @tc.name : 03.pause->start
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0300', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
- START_EVENT, PAUSE_EVENT, START_EVENT, ERROR_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0400
- * @tc.name : 04.resume->start
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0400', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
- START_EVENT, PAUSE_EVENT, RESUME_EVENT,
- START_EVENT, ERROR_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0500
- * @tc.name : 05.stop->start
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0500', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
- START_EVENT, STOP_EVENT, CLOSE_STREAM, START_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0600
- * @tc.name : 06.reset->start
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0600', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
- START_EVENT, RESET_EVENT, CLOSE_STREAM, START_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0700
- * @tc.name : 07.getInputSurface->start
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0700', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
- START_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0800
- * @tc.name : 08.start 3 times
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_START_CALLBACK_0800', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
- START_EVENT, START_EVENT, ERROR_EVENT, START_EVENT, ERROR_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0100
- * @tc.name : 01.create->pause
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0100', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PAUSE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0200
- * @tc.name : 02.prepare->pause
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0200', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, PAUSE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0300
- * @tc.name : 03.start->pause
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0300', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
- START_EVENT, PAUSE_EVENT, CLOSE_STREAM, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0400
- * @tc.name : 04.resume->pause
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0400', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
- START_EVENT, PAUSE_EVENT, RESUME_EVENT,
- PAUSE_EVENT, CLOSE_STREAM, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0500
- * @tc.name : 05.stop->pause
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0500', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
- START_EVENT, STOP_EVENT, CLOSE_STREAM, PAUSE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0600
- * @tc.name : 06.reset->pause
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0600', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
- START_EVENT, RESET_EVENT, CLOSE_STREAM, PAUSE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0700
- * @tc.name : 07.getInputSurface->pause
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0700', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, PAUSE_EVENT,
- ERROR_EVENT, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0800
- * @tc.name : 08.pause 3 times
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_PAUSE_CALLBACK_0800', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
- START_EVENT, PAUSE_EVENT, PAUSE_EVENT, ERROR_EVENT, PAUSE_EVENT, ERROR_EVENT,
- CLOSE_STREAM, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0100
- * @tc.name : 01.create->resume
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0100', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, RESUME_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0200
- * @tc.name : 02.prepare->resume
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0200', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, RESUME_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0300
- * @tc.name : 03.start->resume
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0300', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
- START_EVENT, RESUME_EVENT, ERROR_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0400
- * @tc.name : 04.pause->resume
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0400', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
- START_EVENT, PAUSE_EVENT,
- RESUME_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0500
- * @tc.name : 05.stop->resume
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0500', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
- START_EVENT, STOP_EVENT, CLOSE_STREAM, RESUME_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0600
- * @tc.name : 06.reset->resume
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0600', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
- START_EVENT, RESET_EVENT, CLOSE_STREAM, RESUME_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0700
- * @tc.name : 07.getInputSurface->resume
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0700', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, RESUME_EVENT,
- ERROR_EVENT, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0800
- * @tc.name : 08.resume 3 times
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESUME_CALLBACK_0800', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
- START_EVENT, PAUSE_EVENT,
- RESUME_EVENT, RESUME_EVENT, ERROR_EVENT, RESUME_EVENT, ERROR_EVENT,
- RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0100
- * @tc.name : 01.create->stop
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0100', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, STOP_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0200
- * @tc.name : 02.prepare->stop
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0200', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, STOP_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0300
- * @tc.name : 03.start->stop
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0300', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
- START_EVENT, STOP_EVENT, CLOSE_STREAM, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0400
- * @tc.name : 04.pause->stop
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0400', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
- START_EVENT, PAUSE_EVENT, STOP_EVENT, CLOSE_STREAM, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0500
- * @tc.name : 05.resume->stop
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0500', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
- START_EVENT, PAUSE_EVENT, RESUME_EVENT,
- STOP_EVENT, CLOSE_STREAM, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0600
- * @tc.name : 06.reset->stop
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0600', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, RESET_EVENT, STOP_EVENT,
- ERROR_EVENT, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0700
- * @tc.name : 07.getInputSurface->stop
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0700', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT,
- STOP_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0800
- * @tc.name : 08.stop 3 times
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_STOP_CALLBACK_0800', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
- START_EVENT, STOP_EVENT, CLOSE_STREAM, STOP_EVENT, ERROR_EVENT,
- STOP_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0100
- * @tc.name : 01.create->reset
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0100', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, RESET_EVENT, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0200
- * @tc.name : 02.prepare->reset
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0200', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, RESET_EVENT, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0300
- * @tc.name : 03.start->reset
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0300', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
- START_EVENT, RESET_EVENT, CLOSE_STREAM, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0400
- * @tc.name : 04.pause->reset
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0400', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
- START_EVENT, PAUSE_EVENT, RESET_EVENT, CLOSE_STREAM, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0500
- * @tc.name : 05.resume->reset
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0500', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
- START_EVENT, PAUSE_EVENT, RESUME_EVENT,
- RESET_EVENT, CLOSE_STREAM, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0600
- * @tc.name : 06.stop->reset
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0600', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM,
- START_EVENT, STOP_EVENT, CLOSE_STREAM, RESET_EVENT, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0700
- * @tc.name : 07.getInputSurface->reset
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0700', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, RESET_EVENT, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0800
- * @tc.name : 08.reset 3 times
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_RESET_CALLBACK_0800', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, RESET_EVENT,
- RESET_EVENT, RESET_EVENT, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0100
- * @tc.name : 01.create->getInputSurface
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0100', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, GETSURFACE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0200
- * @tc.name : 02.prepare->getInputSurface
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0200', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0300
- * @tc.name : 03.start->getInputSurface
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0300', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM, START_EVENT,
- GETSURFACE_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0400
- * @tc.name : 04.pause->getInputSurface
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0400', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM, START_EVENT,
- PAUSE_EVENT, GETSURFACE_EVENT, RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0500
- * @tc.name : 05.resume->getInputSurface
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0500', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM, START_EVENT,
- PAUSE_EVENT, RESUME_EVENT, GETSURFACE_EVENT,
- RELEASE_EVENT, CLOSE_STREAM, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0600
- * @tc.name : 06.stop->getInputSurface
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0600', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_STREEAM, START_EVENT,
- STOP_EVENT, CLOSE_STREAM, GETSURFACE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0700
- * @tc.name : 07.reset->getInputSurface
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0700', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, RESET_EVENT,
- GETSURFACE_EVENT, ERROR_EVENT, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0800
- * @tc.name : 08.getInputSurface 3 times
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level2
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_GETSURFACE_CALLBACK_0800', 0, async function (done) {
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT,
- GETSURFACE_EVENT, GETSURFACE_EVENT, RELEASE_EVENT, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
- })
-}
-
-
diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderEnumTest.test.js b/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderEnumTest.test.js
deleted file mode 100644
index 4cac74fe4c6369e608e6b604d438cd441dbd8f7e..0000000000000000000000000000000000000000
--- a/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderEnumTest.test.js
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2022 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import media from '@ohos.multimedia.media'
-import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
-
-export default function VideoRecorderEnumTest() {
- describe('VideoRecorderEnumTest', function () {
- beforeAll(function() {
- console.info('beforeAll case');
- })
-
- beforeEach(function() {
- console.info('beforeEach case');
- })
-
- afterEach(function() {
- console.info('afterEach case');
- })
-
- afterAll(function() {
- console.info('afterAll case');
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_ENUM_AUDIO_SOURCE_TYPE_0100
- * @tc.name : AudioSourceType
- * @tc.desc : AudioSourceType Enumeration test
- * @tc.size : MediumTest
- * @tc.type : Function test
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_ENUM_AUDIO_SOURCE_TYPE_0100', 0, async function (done) {
- expect(media.AudioSourceType.AUDIO_SOURCE_TYPE_DEFAULT).assertEqual(0);
- expect(media.AudioSourceType.AUDIO_SOURCE_TYPE_MIC).assertEqual(1);
- done();
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_ENUM_VIDEO_SOURCE_TYPE_0100
- * @tc.name : VideoSourceType
- * @tc.desc : VideoSourceType Enumeration test
- * @tc.size : MediumTest
- * @tc.type : Function test
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_ENUM_VIDEO_SOURCE_TYPE_0100', 0, async function (done) {
- expect(media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_YUV).assertEqual(0);
- expect(media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_ES).assertEqual(1);
- done();
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_ENUM_CODECMIMETYPE_0100
- * @tc.name : CodecMimeType
- * @tc.desc : Test Enumerate CodecMimeType
- * @tc.size : MediumTest
- * @tc.type : Function test
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_DECODER_ENUM_CODECMIMETYPE_0100', 0, async function (done) {
- expect(media.CodecMimeType.VIDEO_H263).assertEqual('video/h263');
- expect(media.CodecMimeType.VIDEO_AVC).assertEqual('video/avc');
- expect(media.CodecMimeType.VIDEO_MPEG2).assertEqual('video/mpeg2');
- expect(media.CodecMimeType.VIDEO_MPEG4).assertEqual('video/mp4v-es');
- expect(media.CodecMimeType.VIDEO_VP8).assertEqual('video/x-vnd.on2.vp8');
- done();
- })
- })
-}
-
diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderFuncCallbackTest.test.js b/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderFuncCallbackTest.test.js
deleted file mode 100644
index 059ec6c320eb87ffb49ad3a604416bc0d59b056e..0000000000000000000000000000000000000000
--- a/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderFuncCallbackTest.test.js
+++ /dev/null
@@ -1,848 +0,0 @@
-/*
- * Copyright (C) 2022 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the 'License');
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an 'AS IS' BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import media from '@ohos.multimedia.media'
-import camera from '@ohos.multimedia.camera'
-import * as mediaTestBase from '../../../../../MediaTestBase.js';
-import * as videoRecorderBase from '../../../../../VideoRecorderTestBase.js';
-import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
-
-export default function VideoRecorderFuncCallbackTest() {
- describe('VideoRecorderFuncCallbackTest', function () {
- const RECORDER_TIME = 3000;
- const PAUSE_TIME = 1000;
- const END_EVENT = 'end';
- const CREATE_EVENT = 'create';
- const PREPARE_EVENT = 'prepare';
- const PREPARE_OLNYVIDEO_EVENT = 'prepare_only';
- const GETSURFACE_EVENT = 'getInputSurface';
- const START_EVENT = 'start';
- const PAUSE_EVENT = 'pause';
- const RESUME_EVENT = 'resume';
- const STOP_EVENT = 'stop';
- const RESET_EVENT = 'reset';
- const RELEASE_EVENT = 'release';
- const CHECK_EVENT = "check";
- const ONLYVIDEO_TYPE = 'only_video';
- const AUDIO_VIDEO_TYPE = 'audio_video';
- const pagePath1 = 'pages/surfaceTest/surfaceTest';
- const pagePath2 = 'pages/surfaceTest2/surfaceTest2';
- let cameraManager;
- let cameras;
- let captureSession;
- let videoOutput;
- let surfaceID;
- let playerSurfaceId = '';
- let fdPath;
- let fdObject;
- let cameraID = 0;
- let pageId = 0;
- let videoProfiles;
- let previewProfiles;
- let previewOutput;
- let configFile = {
- audioBitrate : 48000,
- audioChannels : 2,
- audioCodec : media.CodecMimeType.AUDIO_AAC,
- audioSampleRate : 48000,
- durationTime : 1000,
- fileFormat : media.ContainerFormatType.CFT_MPEG_4,
- videoBitrate : 48000,
- videoCodec : media.CodecMimeType.VIDEO_MPEG4,
- videoFrameWidth : 640,
- videoFrameHeight : 480,
- videoFrameRate : 10
- }
- // rotation 0, 90, 180, 270
- let videoConfig = {
- audioSourceType : media.AudioSourceType.AUDIO_SOURCE_TYPE_MIC,
- videoSourceType : media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_YUV,
- profile : configFile,
- url : 'fd://',
- rotation : 0,
- location : { latitude : 30, longitude : 130 },
- maxSize : 100,
- maxDuration : 500
- }
-
- let onlyVideoProfile = {
- durationTime : 1000,
- fileFormat : media.ContainerFormatType.CFT_MPEG_4,
- videoBitrate : 48000,
- videoCodec : media.CodecMimeType.VIDEO_MPEG4,
- videoFrameWidth : 640,
- videoFrameHeight : 480,
- videoFrameRate : 10
- }
-
- let onlyVideoConfig = {
- videoSourceType : media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_YUV,
- profile : onlyVideoProfile,
- url : 'fd://',
- rotation : 0,
- location : { latitude : 30, longitude : 130 },
- maxSize : 100,
- maxDuration : 500
- }
-
- beforeAll(async function () {
- cameraManager = await camera.getCameraManager(null);
- if (cameraManager != null) {
- console.info('[camera] case getCameraManager success');
- } else {
- console.info('[camera] case getCameraManager failed');
- return;
- }
- await cameraManager.getSupportedCameras().then((cameraDevices)=> {
- cameras = cameraDevices;
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- if (cameras != null) {
- console.info('[camera] case getCameras success');
- } else {
- console.info('[camera] case getCameras failed');
- }
- await cameraManager.getSupportedOutputCapability(cameras[0]).then((cameraoutputcapability) => {
- console.info('[camera] case getSupportedOutputCapability success');
- videoProfiles = cameraoutputcapability.videoProfiles;
- videoProfiles[0].size.height = 480;
- videoProfiles[0].size.width = 640;
- previewProfiles = cameraoutputcapability.previewProfiles;
- previewProfiles[0].size.height = 480;
- previewProfiles[0].size.width = 640;
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback)
- if (previewProfiles[0].format == camera.CameraFormat.CAMERA_FORMAT_YUV_420_SP) {
- console.info('[camera] case format is VIDEO_SOURCE_TYPE_SURFACE_YUV');
- videoConfig.videoSourceType = media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_YUV;
- } else {
- console.info('[camera] case format is VIDEO_SOURCE_TYPE_SURFACE_ES');
- videoConfig.videoSourceType = media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_ES;
- }
- console.info('beforeAll case');
- })
-
- beforeEach(async function () {
- await mediaTestBase.toNewPage(pagePath1, pagePath2, pageId);
- pageId = (pageId + 1) % 2;
- if (previewProfiles[0].format == camera.CameraFormat.CAMERA_FORMAT_YUV_420_SP) {
- if (pageId == 0) {
- configFile.videoCodec = media.CodecMimeType.VIDEO_MPEG4;
- onlyVideoProfile.videoCodec = media.CodecMimeType.VIDEO_MPEG4;
- } else {
- configFile.videoCodec = media.CodecMimeType.VIDEO_AVC;
- onlyVideoProfile.videoCodec = media.CodecMimeType.VIDEO_AVC;
- }
- } else {
- configFile.videoCodec = media.CodecMimeType.VIDEO_MPEG4;
- onlyVideoProfile.videoCodec = media.CodecMimeType.VIDEO_MPEG4;
- }
- await mediaTestBase.msleepAsync(1000).then(
- () => {}, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- playerSurfaceId = globalThis.value;
- cameraID = 0;
- console.info('beforeEach case');
- })
-
- afterEach(async function () {
- await mediaTestBase.clearRouter();
- console.info('afterEach case');
- })
-
- afterAll(function () {
- console.info('afterAll case');
- })
-
- function printfError(error, done) {
- expect().assertFail();
- console.info(`case error called,errMessage is ${error.message}`);
- done();
- }
-
- let events = require('events');
- let eventEmitter = new events.EventEmitter();
-
- async function toNextStep(videoRecorder, steps, done) {
- if (steps[0] == END_EVENT) {
- console.info('case success!!');
- await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
- done();
- } else {
- console.info('case toNextStep is ' + steps[0]);
- eventEmitter.emit(steps[0], videoRecorder, steps, done);
- }
- }
-
- function setOnCallback(videoRecorder) {
- videoRecorder.on('info', (infoType, extra) => {
- console.info('case info called, infoType is ' + infoType);
- console.info('case info called, extra is ' + extra);
- });
-
- videoRecorder.on('error', (err) => {
- console.info('case error called, errMessage is ' + err.message);
- expect().assertFail();
- });
- }
-
- eventEmitter.on(CREATE_EVENT, async (videoRecorder, steps, done) => {
- steps.shift();
- media.createVideoRecorder((err, recorder) => {
- if (typeof (err) == 'undefined') {
- console.info('case createVideoRecorder success ');
- videoRecorder = recorder;
- setOnCallback(videoRecorder);
- expect(videoRecorder.state).assertEqual('idle');
- toNextStep(videoRecorder, steps, done);
- } else {
- printfError(err, done);
- }
- });
- });
-
- eventEmitter.on(PREPARE_EVENT, async (videoRecorder, steps, done) => {
- steps.shift();
- videoRecorder.prepare(videoConfig, (err) => {
- if (typeof (err) == 'undefined') {
- console.info('case prepare success');
- expect(videoRecorder.state).assertEqual('prepared');
- toNextStep(videoRecorder, steps, done);
- } else {
- printfError(err, done);
- }
- });
- });
-
- eventEmitter.on(PREPARE_OLNYVIDEO_EVENT, async (videoRecorder, steps, done) => {
- steps.shift();
- videoRecorder.prepare(onlyVideoConfig, (err) => {
- if (typeof (err) == 'undefined') {
- console.info('case prepare success');
- expect(videoRecorder.state).assertEqual('prepared');
- toNextStep(videoRecorder, steps, done);
- } else {
- printfError(err, done);
- }
- });
- });
-
- eventEmitter.on(GETSURFACE_EVENT, async (videoRecorder, steps, done) => {
- steps.shift();
- videoRecorder.getInputSurface((err, outPutsurface) => {
- if (typeof (err) == 'undefined') {
- expect(videoRecorder.state).assertEqual('prepared');
- surfaceID = outPutsurface;
- console.info('case getInputSurface success :' + surfaceID);
- toNextStep(videoRecorder, steps, done);
- } else {
- printfError(err, done);
- }
- });
- });
-
- eventEmitter.on(START_EVENT, async (videoRecorder, steps, done) => {
- steps.shift();
- videoOutput = await cameraManager.createVideoOutput(videoProfiles[0], surfaceID);
- if (videoOutput == null) {
- console.info('case createVideoOutput failed');
- } else {
- console.info('case createVideoOutput success');
- }
- previewOutput = await cameraManager.createPreviewOutput(previewProfiles[0], playerSurfaceId)
- captureSession = await videoRecorderBase.initCaptureSession(videoOutput, cameraManager,
- cameras[0], previewOutput);
- await videoOutput.start().then(() => {
- console.info('case videoOutput start success');
- });
- videoRecorder.start((err) => {
- if (typeof (err) == 'undefined') {
- console.info('case start success');
- expect(videoRecorder.state).assertEqual('playing');
- mediaTestBase.msleep(RECORDER_TIME);
- toNextStep(videoRecorder, steps, done);
- } else {
- printfError(err, done);
- }
- });
- });
-
- eventEmitter.on(PAUSE_EVENT, async (videoRecorder, steps, done) => {
- steps.shift();
- videoRecorder.pause((err) => {
- if (typeof (err) == 'undefined') {
- console.info('case pause success');
- expect(videoRecorder.state).assertEqual('paused');
- mediaTestBase.msleep(PAUSE_TIME);
- toNextStep(videoRecorder, steps, done);
- } else {
- printfError(err, done);
- }
- });
- });
-
- eventEmitter.on(RESUME_EVENT, async (videoRecorder, steps, done) => {
- steps.shift();
- videoRecorder.resume((err) => {
- if (typeof (err) == 'undefined') {
- console.info('case resume success');
- mediaTestBase.msleep(RECORDER_TIME);
- expect(videoRecorder.state).assertEqual('playing');
- toNextStep(videoRecorder, steps, done);
- } else {
- printfError(err, done);
- }
- });
- });
-
- eventEmitter.on(STOP_EVENT, async (videoRecorder, steps, done) => {
- steps.shift();
- videoRecorder.stop((err) => {
- if (typeof (err) == 'undefined') {
- console.info('case stop success');
- expect(videoRecorder.state).assertEqual('stopped');
- toNextStep(videoRecorder, steps, done);
- } else {
- printfError(err, done);
- }
- });
- });
-
- eventEmitter.on(RESET_EVENT, async (videoRecorder, steps, done) => {
- steps.shift();
- videoRecorder.reset((err) => {
- if (typeof (err) == 'undefined') {
- console.info('case reset success');
- expect(videoRecorder.state).assertEqual('idle');
- toNextStep(videoRecorder, steps, done);
- } else {
- printfError(err, done);
- }
- });
- });
-
- eventEmitter.on(RELEASE_EVENT, async (videoRecorder, steps, done) => {
- steps.shift();
- videoRecorder.release(async (err) => {
- await videoOutput.stop().then(() => {
- console.info('case videoOutput stop success');
- });
- await videoRecorderBase.stopCaptureSession(captureSession);
- if (typeof (err) == 'undefined') {
- expect(videoRecorder.state).assertEqual('idle');
- console.info('case release success');
- toNextStep(videoRecorder, steps, done);
- } else {
- printfError(err, done);
- }
- });
- });
-
- eventEmitter.on(CHECK_EVENT, async (videoRecorder, steps, done) => {
- steps.shift();
- let trackArray = steps[0];
- let recorderTime = steps[1];
- steps.shift();
- steps.shift();
- await videoRecorderBase.checkVideos(fdPath, recorderTime, trackArray, playerSurfaceId);
- toNextStep(videoRecorder, steps, done);
- });
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0100
- * @tc.name : 01.start->release (callback)
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0100', 0, async function (done) {
- fdObject = await mediaTestBase.getFd('recorder_callback_01.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT, RELEASE_EVENT, CHECK_EVENT,
- trackArray, RECORDER_TIME, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0200
- * @tc.name : 02.start->pause->release (callback)
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0200', 0, async function (done) {
- fdObject = await mediaTestBase.getFd('recorder_callback_02.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT,
- PAUSE_EVENT, RELEASE_EVENT, CHECK_EVENT,
- trackArray, RECORDER_TIME, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0300
- * @tc.name : 03.start->pause->resume->release (callback)
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0300', 0, async function (done) {
- fdObject = await mediaTestBase.getFd('recorder_callback_03.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT,
- PAUSE_EVENT, RESUME_EVENT, RELEASE_EVENT, CHECK_EVENT,
- trackArray, RECORDER_TIME * 2, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0400
- * @tc.name : 04.start->stop->release (callback)
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0400', 0, async function (done) {
- fdObject = await mediaTestBase.getFd('recorder_callback_04.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT,
- STOP_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0500
- * @tc.name : 05.start->reset->release (callback)
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0500', 0, async function (done) {
- fdObject = await mediaTestBase.getFd('recorder_callback_05.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT,
- RESET_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0600
- * @tc.name : 06.start->pause->stop->release (callback)
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0600', 0, async function (done) {
- fdObject = await mediaTestBase.getFd('recorder_callback_06.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT, PAUSE_EVENT,
- STOP_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0700
- * @tc.name : 07.start->pause->reset->release (callback)
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0700', 0, async function (done) {
- fdObject = await mediaTestBase.getFd('recorder_callback_07.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT, PAUSE_EVENT,
- RESET_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0800
- * @tc.name : 08.start->pause->resume->stop->release (callback)
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0800', 0, async function (done) {
- fdObject = await mediaTestBase.getFd('recorder_callback_08.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT, PAUSE_EVENT,
- RESUME_EVENT, STOP_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME * 2, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0900
- * @tc.name : 09.start->pause->resume->reset->release (callback)
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_0900', 0, async function (done) {
- fdObject = await mediaTestBase.getFd('recorder_callback_09.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT, PAUSE_EVENT,
- RESUME_EVENT, RESET_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME * 2, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1000
- * @tc.name : 10.start->stop->release
- * (audioBitrate 8000,audioSampleRate 8000,videoBitrateRange 8000)(promise)
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1000', 0, async function (done) {
- configFile.audioBitrate = 8000;
- configFile.audioSampleRate = 8000;
- configFile.videoBitrate = 8000;
- fdObject = await mediaTestBase.getFd('recorder_callback_10.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT,
- STOP_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1100
- * @tc.name : 11.start->stop->release
- * (audioBitrate 16000, audioSampleRate 32000, videoBitrateRange 16000)(callback)
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1100', 0, async function (done) {
- configFile.audioBitrate = 16000;
- configFile.audioSampleRate = 32000;
- configFile.videoBitrate = 16000;
- fdObject = await mediaTestBase.getFd('recorder_callback_11.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT,
- STOP_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1200
- * @tc.name : 12.start->stop->release
- * (audioBitrate 32000, audioSampleRate 44100, videoBitrateRange 32000)(callback)
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1200', 0, async function (done) {
- configFile.audioBitrate = 32000;
- configFile.audioSampleRate = 44100;
- configFile.videoBitrate = 32000;
- fdObject = await mediaTestBase.getFd('recorder_callback_12.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT,
- STOP_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1300
- * @tc.name : 13.start->stop->release
- * (audioBitrate 112000, audioSampleRate 96000, videoBitrateRange 112000)(callback)
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1300', 0, async function (done) {
- configFile.audioBitrate = 112000;
- configFile.audioSampleRate = 96000;
- configFile.videoBitrate = 112000;
- fdObject = await mediaTestBase.getFd('recorder_callback_13.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT,
- STOP_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1400
- * @tc.name : 14.start->release (only video) (callback)
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1400', 0, async function (done) {
- fdObject = await mediaTestBase.getFd('recorder_callback_14.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- onlyVideoConfig.url = fdPath;
- let trackArray = videoRecorderBase.getTrackArray(ONLYVIDEO_TYPE, onlyVideoProfile,
- onlyVideoConfig.videoSourceType);
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_OLNYVIDEO_EVENT, GETSURFACE_EVENT,
- START_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1500
- * @tc.name : 15.start->pause->release (only video) (callback)
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1500', 0, async function (done) {
- fdObject = await mediaTestBase.getFd('recorder_callback_15.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- onlyVideoConfig.url = fdPath;
- let trackArray = videoRecorderBase.getTrackArray(ONLYVIDEO_TYPE, onlyVideoProfile,
- onlyVideoConfig.videoSourceType);
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_OLNYVIDEO_EVENT, GETSURFACE_EVENT, START_EVENT,
- PAUSE_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1600
- * @tc.name : 16.start->pause->resume->releas (only video) (callback)
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1600', 0, async function (done) {
- fdObject = await mediaTestBase.getFd('recorder_callback_16.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- onlyVideoConfig.url = fdPath;
- let trackArray = videoRecorderBase.getTrackArray(ONLYVIDEO_TYPE, onlyVideoProfile,
- onlyVideoConfig.videoSourceType);
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_OLNYVIDEO_EVENT, GETSURFACE_EVENT, START_EVENT,
- PAUSE_EVENT, RESUME_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME * 2, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1700
- * @tc.name : 17.start->stop->release (only video) (callback)
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1700', 0, async function (done) {
- fdObject = await mediaTestBase.getFd('recorder_callback_17.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- onlyVideoConfig.url = fdPath;
- let trackArray = videoRecorderBase.getTrackArray(ONLYVIDEO_TYPE, onlyVideoProfile,
- onlyVideoConfig.videoSourceType);
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_OLNYVIDEO_EVENT, GETSURFACE_EVENT, START_EVENT,
- STOP_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1800
- * @tc.name : 18.start->reset->release (only video) (callback)
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1800', 0, async function (done) {
- fdObject = await mediaTestBase.getFd('recorder_callback_18.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- onlyVideoConfig.url = fdPath;
- let trackArray = videoRecorderBase.getTrackArray(ONLYVIDEO_TYPE, onlyVideoProfile,
- onlyVideoConfig.videoSourceType);
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_OLNYVIDEO_EVENT, GETSURFACE_EVENT, START_EVENT,
- RESET_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1900
- * @tc.name : 19.rotation 90 (callback)
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level1
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_1900', 0, async function (done) {
- fdObject = await mediaTestBase.getFd('recorder_callback_19.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- configFile.audioSampleRate = 48000;
- videoConfig.rotation = 90;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT,
- START_EVENT, RELEASE_EVENT, CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2000
- * @tc.name : 20.rotation 180 (callback)
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level1
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2000', 0, async function (done) {
- fdObject = await mediaTestBase.getFd('recorder_callback_20.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- videoConfig.rotation = 180;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT, RELEASE_EVENT,
- CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2100
- * @tc.name : 21.rotation 270 (callback)
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level1
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2100', 0, async function (done) {
- fdObject = await mediaTestBase.getFd('recorder_callback_21.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- videoConfig.rotation = 270;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT, RELEASE_EVENT,
- CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2200
- * @tc.name : 22.videoFrameRate 20 (callback)
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level1
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2200', 0, async function (done) {
- fdObject = await mediaTestBase.getFd('recorder_callback_22.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- configFile.videoFrameRate = 20;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT, RELEASE_EVENT,
- CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2300
- * @tc.name : 23.videoFrameRate 30 (callback)
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level1
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2300', 0, async function (done) {
- fdObject = await mediaTestBase.getFd('recorder_callback_23.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- configFile.videoFrameRate = 30;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT, RELEASE_EVENT,
- CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2400
- * @tc.name : 24.videoFrameRate 60 (callback)
- * @tc.desc : Audio recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level1
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_CALLBACK_2400', 0, async function (done) {
- fdObject = await mediaTestBase.getFd('recorder_callback_24.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- configFile.videoFrameRate = 60;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- let videoRecorder = null;
- let mySteps = new Array(CREATE_EVENT, PREPARE_EVENT, GETSURFACE_EVENT, START_EVENT, RELEASE_EVENT,
- CHECK_EVENT, trackArray, RECORDER_TIME, END_EVENT);
- eventEmitter.emit(mySteps[0], videoRecorder, mySteps, done);
- })
- })
-}
-
-
diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderFuncPromiseTest.test.js b/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderFuncPromiseTest.test.js
deleted file mode 100644
index af7f9885ee0da037c0eb5f2979f81d87aeb94d3d..0000000000000000000000000000000000000000
--- a/multimedia/media/media_js_standard/videoRecorder/src/main/js/test/VideoRecorderFuncPromiseTest.test.js
+++ /dev/null
@@ -1,1862 +0,0 @@
-/*
- * Copyright (C) 2022 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the 'License');
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an 'AS IS' BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import media from '@ohos.multimedia.media'
-import camera from '@ohos.multimedia.camera'
-import * as mediaTestBase from '../../../../../MediaTestBase.js';
-import * as videoRecorderBase from '../../../../../VideoRecorderTestBase.js';
-import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
-
-export default function VideoRecorderFuncPromiseTest() {
-describe('VideoRecorderFuncPromiseTest', function () {
- const RECORDER_TIME = 3000;
- const PAUSE_TIME = 1000;
- const ONLYVIDEO_TYPE = 'only_video';
- const AUDIO_VIDEO_TYPE = 'audio_video';
- let cameraManager;
- let cameras;
- let captureSession;
- let fdPath;
- let fdObject;
- let cameraID = 0;
- let playerSurfaceId = '';
- let pageId = 0;
- let videoProfiles;
- let previewProfiles;
- const pagePath1 = 'pages/surfaceTest/surfaceTest';
- const pagePath2 = 'pages/surfaceTest2/surfaceTest2';
- let configFile = {
- audioBitrate : 48000,
- audioChannels : 2,
- audioCodec : media.CodecMimeType.AUDIO_AAC,
- audioSampleRate : 48000,
- durationTime : 1000,
- fileFormat : media.ContainerFormatType.CFT_MPEG_4,
- videoBitrate : 48000,
- videoCodec : media.CodecMimeType.VIDEO_MPEG4,
- videoFrameWidth : 640,
- videoFrameHeight : 480,
- videoFrameRate : 10
- }
-
- let videoConfig = {
- audioSourceType : 1,
- videoSourceType : media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_ES,
- profile : configFile,
- url : 'fd://',
- rotation : 0,
- location : { latitude : 30, longitude : 130 },
- maxSize : 100,
- maxDuration : 500
- }
-
- let onlyVideoProfile = {
- durationTime : 1000,
- fileFormat : media.ContainerFormatType.CFT_MPEG_4,
- videoBitrate : 48000,
- videoCodec : media.CodecMimeType.VIDEO_MPEG4,
- videoFrameWidth : 640,
- videoFrameHeight : 480,
- videoFrameRate : 10
- }
-
- let onlyVideoConfig = {
- videoSourceType : media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_ES,
- profile : onlyVideoProfile,
- url : 'fd://',
- rotation : 0,
- location : { latitude : 30, longitude : 130 },
- maxSize : 100,
- maxDuration : 500
- }
-
- beforeAll(async function () {
- let permissionName1 = 'ohos.permission.MICROPHONE';
- let permissionName2 = 'ohos.permission.MEDIA_LOCATION';
- let permissionName3 = 'ohos.permission.READ_MEDIA';
- let permissionName4 = 'ohos.permission.WRITE_MEDIA';
- let permissionName5 = 'ohos.permission.CAMERA';
- let permissionNames = [permissionName1, permissionName2, permissionName3, permissionName4, permissionName5];
- await mediaTestBase.getPermission(permissionNames);
- await mediaTestBase.msleepAsync(2000);
- await mediaTestBase.driveFn(3);
- cameraManager = await camera.getCameraManager(null);
- if (cameraManager != null) {
- console.info('[camera] case getCameraManager success');
- } else {
- console.info('[camera] case getCameraManager failed');
- return;
- }
- await cameraManager.getSupportedCameras().then((cameraDevices)=> {
- cameras = cameraDevices;
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- if (cameras != null) {
- console.info('[camera] case getCameras success');
- } else {
- console.info('[camera] case getCameras failed');
- }
- await cameraManager.getSupportedOutputCapability(cameras[0]).then((cameraoutputcapability) => {
- console.info('[camera] case getSupportedOutputCapability success');
- videoProfiles = cameraoutputcapability.videoProfiles;
- videoProfiles[0].size.height = 480;
- videoProfiles[0].size.width = 640;
- previewProfiles = cameraoutputcapability.previewProfiles;
- previewProfiles[0].size.height = 480;
- previewProfiles[0].size.width = 640;
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback)
- if (previewProfiles[0].format == camera.CameraFormat.CAMERA_FORMAT_YUV_420_SP) {
- console.info('[camera] case format is VIDEO_SOURCE_TYPE_SURFACE_YUV');
- videoConfig.videoSourceType = media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_YUV;
- onlyVideoConfig.videoSourceType = media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_YUV;
- } else {
- console.info('[camera] case format is VIDEO_SOURCE_TYPE_SURFACE_ES');
- videoConfig.videoSourceType = media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_ES;
- onlyVideoConfig.videoSourceType = media.VideoSourceType.VIDEO_SOURCE_TYPE_SURFACE_ES;
- }
- console.info('beforeAll case');
- })
-
- beforeEach(async function () {
- await mediaTestBase.toNewPage(pagePath1, pagePath2, pageId);
- pageId = (pageId + 1) % 2;
- if (previewProfiles[0].format == camera.CameraFormat.CAMERA_FORMAT_YUV_420_SP) {
- if (pageId == 0) {
- configFile.videoCodec = media.CodecMimeType.VIDEO_MPEG4;
- onlyVideoProfile.videoCodec = media.CodecMimeType.VIDEO_MPEG4;
- } else {
- configFile.videoCodec = media.CodecMimeType.VIDEO_AVC;
- onlyVideoProfile.videoCodec = media.CodecMimeType.VIDEO_AVC;
- }
- } else {
- configFile.videoCodec = media.CodecMimeType.VIDEO_MPEG4;
- onlyVideoProfile.videoCodec = media.CodecMimeType.VIDEO_MPEG4;
- }
- await mediaTestBase.msleepAsync(1000).then(
- () => {}, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- playerSurfaceId = globalThis.value;
- cameraID = 0;
- console.info('beforeEach case');
- })
-
- afterEach(async function () {
- await mediaTestBase.clearRouter();
- console.info('afterEach case');
- })
-
- afterAll(function () {
- console.info('afterAll case');
- })
-
- function checkErrorCode(errorCode)
- {
- let value = false;
- switch (errorCode) {
- case 0:
- case 201:
- case 401:
- case 801:
- case 5400101:
- case 5400102:
- case 5400103:
- case 5400104:
- case 5400105:
- case 5400106:
- value = true;
- break;
- }
- return value;
- }
-
- async function startVideoOutput(videoOutPut) {
- if (videoOutPut == null) {
- console.info('[camera] case videoOutPut is null');
- return;
- }
- await videoOutPut.start().then(() => {
- console.info('[camera] case videoOutput start success');
- });
- }
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0100
- * @tc.name : 01.start->release (promise)
- * @tc.desc : Video recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0100', 0, async function (done) {
- let videoRecorder = undefined;
- let surfaceID = '';
- let videoOutput;
- let previewOutput;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- fdObject = await mediaTestBase.getFd('recorder_promise_01.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- await media.createVideoRecorder().then((recorder) => {
- console.info('case createVideoRecorder called');
- if (typeof (recorder) != 'undefined') {
- videoRecorder = recorder;
- expect(videoRecorder.state).assertEqual('idle');
- } else {
- console.info('case recordr is undefined!!');
- }
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.prepare(videoConfig).then(() => {
- console.info('case recordr prepare called');
- expect(videoRecorder.state).assertEqual('prepared');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.getInputSurface().then((outPutSurface) => {
- console.info('case getInputSurface called');
- expect(videoRecorder.state).assertEqual('prepared');
- surfaceID = outPutSurface;
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- videoOutput = await cameraManager.createVideoOutput(videoProfiles[0], surfaceID);
- previewOutput = await cameraManager.createPreviewOutput(previewProfiles[0], playerSurfaceId)
- captureSession = await videoRecorderBase.initCaptureSession(videoOutput, cameraManager,
- cameras[0], previewOutput);
- await startVideoOutput(videoOutput);
- await videoRecorder.start().then(() => {
- console.info('case start called');
- expect(videoRecorder.state).assertEqual('playing');
- mediaTestBase.msleep(RECORDER_TIME);
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.release().then(() => {
- console.info('case release ');
- expect(videoRecorder.state).assertEqual('idle');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoOutput.stop();
- await videoRecorderBase.stopCaptureSession(captureSession);
- await videoRecorderBase.checkVideos(fdPath, RECORDER_TIME, trackArray, playerSurfaceId);
- await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
- done();
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0200
- * @tc.name : 02.start->pause->release (promise)
- * @tc.desc : Video recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0200', 0, async function (done) {
- let videoRecorder = undefined;
- let surfaceID = '';
- let videoOutput;
- let previewOutput;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- fdObject = await mediaTestBase.getFd('recorder_promise_02.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- await media.createVideoRecorder().then((recorder) => {
- console.info('case createVideoRecorder called');
- if (typeof (recorder) != 'undefined') {
- videoRecorder = recorder;
- expect(videoRecorder.state).assertEqual('idle');
- } else {
- console.info('case recordr is undefined!!');
- }
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.prepare(videoConfig).then(() => {
- console.info('case recordr prepare called');
- expect(videoRecorder.state).assertEqual('prepared');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.getInputSurface().then((outPutSurface) => {
- console.info('case getInputSurface called');
- expect(videoRecorder.state).assertEqual('prepared');
- surfaceID = outPutSurface;
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- videoOutput = await cameraManager.createVideoOutput(videoProfiles[0], surfaceID);
- previewOutput = await cameraManager.createPreviewOutput(previewProfiles[0], playerSurfaceId)
- captureSession = await videoRecorderBase.initCaptureSession(videoOutput, cameraManager,
- cameras[0], previewOutput);
- await startVideoOutput(videoOutput);
- await videoRecorder.start().then(() => {
- console.info('case start called');
- expect(videoRecorder.state).assertEqual('playing');
- mediaTestBase.msleep(RECORDER_TIME);
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.pause().then(() => {
- console.info('case pause called');
- mediaTestBase.msleep(PAUSE_TIME);
- expect(videoRecorder.state).assertEqual('paused');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoRecorder.release().then(() => {
- console.info('case release ');
- expect(videoRecorder.state).assertEqual('idle');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoOutput.stop();
- await videoRecorderBase.stopCaptureSession(captureSession);
- await videoRecorderBase.checkVideos(fdPath, RECORDER_TIME, trackArray, playerSurfaceId);
- await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
- done();
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0300
- * @tc.name : 03.start->pause->resume->release (promise)
- * @tc.desc : Video recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0300', 0, async function (done) {
- let videoRecorder = undefined;
- let surfaceID = '';
- let videoOutput;
- let previewOutput;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- fdObject = await mediaTestBase.getFd('recorder_promise_03.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- await media.createVideoRecorder().then((recorder) => {
- console.info('case createVideoRecorder called');
- if (typeof (recorder) != 'undefined') {
- videoRecorder = recorder;
- expect(videoRecorder.state).assertEqual('idle');
- } else {
- console.info('case recordr is undefined!!');
- }
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.prepare(videoConfig).then(() => {
- console.info('case recordr prepare called');
- expect(videoRecorder.state).assertEqual('prepared');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.getInputSurface().then((outPutSurface) => {
- expect(videoRecorder.state).assertEqual('prepared');
- console.info('case getInputSurface called');
- surfaceID = outPutSurface;
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- videoOutput = await cameraManager.createVideoOutput(videoProfiles[0], surfaceID);
- previewOutput = await cameraManager.createPreviewOutput(previewProfiles[0], playerSurfaceId)
- captureSession = await videoRecorderBase.initCaptureSession(videoOutput, cameraManager,
- cameras[0], previewOutput);
- await startVideoOutput(videoOutput);
- await videoRecorder.start().then(() => {
- expect(videoRecorder.state).assertEqual('playing');
- console.info('case start called');
- mediaTestBase.msleep(RECORDER_TIME);
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoOutput.stop();
- await videoRecorder.pause().then(() => {
- expect(videoRecorder.state).assertEqual('paused');
- mediaTestBase.msleep(PAUSE_TIME);
- console.info('case pause called');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoOutput.start();
- await videoRecorder.resume().then(() => {
- expect(videoRecorder.state).assertEqual('playing');
- mediaTestBase.msleep(RECORDER_TIME);
- console.info('case resume called');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.release().then(() => {
- expect(videoRecorder.state).assertEqual('idle');
- console.info('case release ');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoOutput.stop();
- await videoRecorderBase.stopCaptureSession(captureSession);
- await videoRecorderBase.checkVideos(fdPath, RECORDER_TIME * 2, trackArray, playerSurfaceId);
- await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
- done();
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0400
- * @tc.name : 04.start->stop->release (promise)
- * @tc.desc : Video recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0400', 0, async function (done) {
- let videoRecorder = undefined;
- let surfaceID = '';
- let videoOutput;
- let previewOutput;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- fdObject = await mediaTestBase.getFd('recorder_promise_04.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- await media.createVideoRecorder().then((recorder) => {
- console.info('case createVideoRecorder called');
- if (typeof (recorder) != 'undefined') {
- videoRecorder = recorder;
- expect(videoRecorder.state).assertEqual('idle');
- } else {
- console.info('case recordr is undefined!!');
- }
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.prepare(videoConfig).then(() => {
- console.info('case recordr prepare called');
- expect(videoRecorder.state).assertEqual('prepared');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.getInputSurface().then((outPutSurface) => {
- console.info('case getInputSurface called');
- expect(videoRecorder.state).assertEqual('prepared');
- surfaceID = outPutSurface;
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- videoOutput = await cameraManager.createVideoOutput(videoProfiles[0], surfaceID);
- previewOutput = await cameraManager.createPreviewOutput(previewProfiles[0], playerSurfaceId);
- captureSession = await videoRecorderBase.initCaptureSession(videoOutput, cameraManager,
- cameras[0], previewOutput);
- await startVideoOutput(videoOutput);
- await videoRecorder.start().then(() => {
- console.info('case start called');
- expect(videoRecorder.state).assertEqual('playing');
- mediaTestBase.msleep(RECORDER_TIME);
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.stop().then(() => {
- expect(videoRecorder.state).assertEqual('stopped');
- console.info('case stop called');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoRecorder.release().then(() => {
- expect(videoRecorder.state).assertEqual('idle');
- console.info('case release ');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoOutput.stop();
- await videoRecorderBase.stopCaptureSession(captureSession);
- await videoRecorderBase.checkVideos(fdPath, RECORDER_TIME, trackArray, playerSurfaceId);
- await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
- done();
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0500
- * @tc.name : 05.start->reset->release (promise)
- * @tc.desc : Video recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0500', 0, async function (done) {
- let videoRecorder = undefined;
- let surfaceID = '';
- let videoOutput;
- let previewOutput;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- fdObject = await mediaTestBase.getFd('recorder_promise_05.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- await media.createVideoRecorder().then((recorder) => {
- console.info('case createVideoRecorder called');
- if (typeof (recorder) != 'undefined') {
- videoRecorder = recorder;
- expect(videoRecorder.state).assertEqual('idle');
- } else {
- console.info('case recordr is undefined!!');
- }
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.prepare(videoConfig).then(() => {
- console.info('case recordr prepare called');
- expect(videoRecorder.state).assertEqual('prepared');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.getInputSurface().then((outPutSurface) => {
- expect(videoRecorder.state).assertEqual('prepared');
- console.info('case getInputSurface called');
- surfaceID = outPutSurface;
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- videoOutput = await cameraManager.createVideoOutput(videoProfiles[0], surfaceID);
- previewOutput = await cameraManager.createPreviewOutput(previewProfiles[0], playerSurfaceId)
- captureSession = await videoRecorderBase.initCaptureSession(videoOutput, cameraManager,
- cameras[0], previewOutput);
- await startVideoOutput(videoOutput);
- await videoRecorder.start().then(() => {
- console.info('case start called');
- expect(videoRecorder.state).assertEqual('playing');
- mediaTestBase.msleep(RECORDER_TIME);
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.reset().then(() => {
- console.info('case reset called');
- expect(videoRecorder.state).assertEqual('idle');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoRecorder.release().then(() => {
- expect(videoRecorder.state).assertEqual('idle');
- console.info('case release ');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoOutput.stop();
- await videoRecorderBase.stopCaptureSession(captureSession);
- await videoRecorderBase.checkVideos(fdPath, RECORDER_TIME, trackArray, playerSurfaceId);
- await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
- done();
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0600
- * @tc.name : 06.start->pause->stop->release (promise)
- * @tc.desc : Video recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0600', 0, async function (done) {
- let videoRecorder = undefined;
- let surfaceID = '';
- let videoOutput;
- let previewOutput;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- fdObject = await mediaTestBase.getFd('recorder_promise_06.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- await media.createVideoRecorder().then((recorder) => {
- console.info('case createVideoRecorder called');
- if (typeof (recorder) != 'undefined') {
- videoRecorder = recorder;
- expect(videoRecorder.state).assertEqual('idle');
- } else {
- console.info('case recordr is undefined!!');
- }
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.prepare(videoConfig).then(() => {
- console.info('case recordr prepare called');
- expect(videoRecorder.state).assertEqual('prepared');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.getInputSurface().then((outPutSurface) => {
- expect(videoRecorder.state).assertEqual('prepared');
- console.info('case getInputSurface called');
- surfaceID = outPutSurface;
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- videoOutput = await cameraManager.createVideoOutput(videoProfiles[0], surfaceID);
- previewOutput = await cameraManager.createPreviewOutput(previewProfiles[0], playerSurfaceId)
- captureSession = await videoRecorderBase.initCaptureSession(videoOutput, cameraManager,
- cameras[0], previewOutput);
- await startVideoOutput(videoOutput);
- await videoRecorder.start().then(() => {
- console.info('case start called');
- expect(videoRecorder.state).assertEqual('playing');
- mediaTestBase.msleep(RECORDER_TIME);
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoOutput.stop();
- await videoRecorder.pause().then(() => {
- expect(videoRecorder.state).assertEqual('paused');
- mediaTestBase.msleep(PAUSE_TIME);
- console.info('case pause called');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.stop().then(() => {
- expect(videoRecorder.state).assertEqual('stopped');
- console.info('case stop called');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.release().then(() => {
- expect(videoRecorder.state).assertEqual('idle');
- console.info('case release ');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoRecorderBase.stopCaptureSession(captureSession);
- await videoRecorderBase.checkVideos(fdPath, RECORDER_TIME, trackArray, playerSurfaceId);
- await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
- done();
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0700
- * @tc.name : 07.start->pause->reset->release (promise)
- * @tc.desc : Video recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0700', 0, async function (done) {
- let videoRecorder = undefined;
- let surfaceID = '';
- let videoOutput;
- let previewOutput;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- fdObject = await mediaTestBase.getFd('recorder_promise_07.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- await media.createVideoRecorder().then((recorder) => {
- console.info('case createVideoRecorder called');
- if (typeof (recorder) != 'undefined') {
- videoRecorder = recorder;
- expect(videoRecorder.state).assertEqual('idle');
- } else {
- console.info('case recordr is undefined!!');
- }
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.prepare(videoConfig).then(() => {
- console.info('case recordr prepare called');
- expect(videoRecorder.state).assertEqual('prepared');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.getInputSurface().then((outPutSurface) => {
- expect(videoRecorder.state).assertEqual('prepared');
- console.info('case getInputSurface called');
- surfaceID = outPutSurface;
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- videoOutput = await cameraManager.createVideoOutput(videoProfiles[0], surfaceID);
- previewOutput = await cameraManager.createPreviewOutput(previewProfiles[0], playerSurfaceId)
- captureSession = await videoRecorderBase.initCaptureSession(videoOutput, cameraManager,
- cameras[0], previewOutput);
- await startVideoOutput(videoOutput);
- await videoRecorder.start().then(() => {
- console.info('case start called');
- expect(videoRecorder.state).assertEqual('playing');
- mediaTestBase.msleep(RECORDER_TIME);
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoOutput.stop();
- await videoRecorder.pause().then(() => {
- expect(videoRecorder.state).assertEqual('paused');
- mediaTestBase.msleep(PAUSE_TIME);
- console.info('case pause called');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.reset().then(() => {
- console.info('case reset called');
- expect(videoRecorder.state).assertEqual('idle');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.release().then(() => {
- expect(videoRecorder.state).assertEqual('idle');
- console.info('case release ');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoRecorderBase.stopCaptureSession(captureSession);
- await videoRecorderBase.checkVideos(fdPath, RECORDER_TIME, trackArray, playerSurfaceId);
- await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
- done();
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0800
- * @tc.name : 08.start->pause->resume->stop->release (promise)
- * @tc.desc : Video recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0800', 0, async function (done) {
- let videoRecorder = undefined;
- let surfaceID = '';
- let videoOutput;
- let previewOutput;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- fdObject = await mediaTestBase.getFd('recorder_promise_08.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- await media.createVideoRecorder().then((recorder) => {
- console.info('case createVideoRecorder called');
- if (typeof (recorder) != 'undefined') {
- videoRecorder = recorder;
- expect(videoRecorder.state).assertEqual('idle');
- } else {
- console.info('case recordr is undefined!!');
- }
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.prepare(videoConfig).then(() => {
- console.info('case recordr prepare called');
- expect(videoRecorder.state).assertEqual('prepared');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.getInputSurface().then((outPutSurface) => {
- expect(videoRecorder.state).assertEqual('prepared');
- console.info('case getInputSurface called');
- surfaceID = outPutSurface;
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- videoOutput = await cameraManager.createVideoOutput(videoProfiles[0], surfaceID);
- previewOutput = await cameraManager.createPreviewOutput(previewProfiles[0], playerSurfaceId)
- captureSession = await videoRecorderBase.initCaptureSession(videoOutput, cameraManager,
- cameras[0], previewOutput);
- await startVideoOutput(videoOutput);
- await videoRecorder.start().then(() => {
- console.info('case start called');
- expect(videoRecorder.state).assertEqual('playing');
- mediaTestBase.msleep(RECORDER_TIME);
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoOutput.stop();
- await videoRecorder.pause().then(() => {
- expect(videoRecorder.state).assertEqual('paused');
- mediaTestBase.msleep(PAUSE_TIME);
- console.info('case pause called');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoOutput.start();
- await videoRecorder.resume().then(() => {
- expect(videoRecorder.state).assertEqual('playing');
- mediaTestBase.msleep(RECORDER_TIME);
- console.info('case resume called');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.stop().then(() => {
- expect(videoRecorder.state).assertEqual('stopped');
- console.info('case stop called');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.release().then(() => {
- expect(videoRecorder.state).assertEqual('idle');
- console.info('case release ');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoOutput.stop();
- await videoRecorderBase.stopCaptureSession(captureSession);
- await videoRecorderBase.checkVideos(fdPath, RECORDER_TIME * 2, trackArray, playerSurfaceId);
- await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
- done();
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0900
- * @tc.name : 09.start->pause->resume->reset->release (promise)
- * @tc.desc : Video recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_0900', 0, async function (done) {
- let videoRecorder = undefined;
- let surfaceID = '';
- let videoOutput;
- let previewOutput;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- fdObject = await mediaTestBase.getFd('recorder_promise_09.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- await media.createVideoRecorder().then((recorder) => {
- console.info('case createVideoRecorder called');
- if (typeof (recorder) != 'undefined') {
- videoRecorder = recorder;
- expect(videoRecorder.state).assertEqual('idle');
- } else {
- console.info('case recordr is undefined!!');
- }
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.prepare(videoConfig).then(() => {
- console.info('case recordr prepare called');
- expect(videoRecorder.state).assertEqual('prepared');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.getInputSurface().then((outPutSurface) => {
- expect(videoRecorder.state).assertEqual('prepared');
- console.info('case getInputSurface called');
- surfaceID = outPutSurface;
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- videoOutput = await cameraManager.createVideoOutput(videoProfiles[0], surfaceID);
- previewOutput = await cameraManager.createPreviewOutput(previewProfiles[0], playerSurfaceId)
- captureSession = await videoRecorderBase.initCaptureSession(videoOutput, cameraManager,
- cameras[0], previewOutput);
- await startVideoOutput(videoOutput);
- await videoRecorder.start().then(() => {
- console.info('case start called');
- expect(videoRecorder.state).assertEqual('playing');
- mediaTestBase.msleep(RECORDER_TIME);
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoOutput.stop();
- await videoRecorder.pause().then(() => {
- expect(videoRecorder.state).assertEqual('paused');
- mediaTestBase.msleep(PAUSE_TIME);
- console.info('case pause called');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoOutput.start();
- await videoRecorder.resume().then(() => {
- expect(videoRecorder.state).assertEqual('playing');
- mediaTestBase.msleep(RECORDER_TIME);
- console.info('case resume called');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoOutput.stop();
- await videoRecorder.reset().then(() => {
- console.info('case reset called');
- expect(videoRecorder.state).assertEqual('idle');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.release().then(() => {
- expect(videoRecorder.state).assertEqual('idle');
- console.info('case release ');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoRecorderBase.stopCaptureSession(captureSession);
- await videoRecorderBase.checkVideos(fdPath, RECORDER_TIME * 2, trackArray, playerSurfaceId);
- await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
- done();
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1000
- * @tc.name : 10.start->stop->release
- * (audioBitrate 8000,audioSampleRate 8000,videoBitrateRange 8000)(promise)
- * @tc.desc : Video recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level1
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1000', 0, async function (done) {
- let videoRecorder = undefined;
- let surfaceID = '';
- let videoOutput;
- let previewOutput;
- fdObject = await mediaTestBase.getFd('recorder_promise_10.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- configFile.audioBitrate = 8000;
- configFile.audioSampleRate = 8000;
- configFile.videoBitrate = 8000;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- await media.createVideoRecorder().then((recorder) => {
- console.info('case createVideoRecorder called');
- if (typeof (recorder) != 'undefined') {
- videoRecorder = recorder;
- expect(videoRecorder.state).assertEqual('idle');
- } else {
- console.info('case recordr is undefined!!');
- }
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.prepare(videoConfig).then(() => {
- console.info('case recordr prepare called');
- expect(videoRecorder.state).assertEqual('prepared');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.getInputSurface().then((outPutSurface) => {
- console.info('case getInputSurface called');
- expect(videoRecorder.state).assertEqual('prepared');
- surfaceID = outPutSurface;
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- videoOutput = await cameraManager.createVideoOutput(videoProfiles[0], surfaceID);
- previewOutput = await cameraManager.createPreviewOutput(previewProfiles[0], playerSurfaceId)
- captureSession = await videoRecorderBase.initCaptureSession(videoOutput, cameraManager,
- cameras[0], previewOutput);
- await startVideoOutput(videoOutput);
- await videoRecorder.start().then(() => {
- console.info('case start called');
- expect(videoRecorder.state).assertEqual('playing');
- mediaTestBase.msleep(RECORDER_TIME);
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoOutput.stop();
- await videoRecorder.stop().then(() => {
- expect(videoRecorder.state).assertEqual('stopped');
- console.info('case stop called');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.release().then(() => {
- expect(videoRecorder.state).assertEqual('idle');
- console.info('case release ');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoRecorderBase.stopCaptureSession(captureSession);
- await videoRecorderBase.checkVideos(fdPath, RECORDER_TIME, trackArray, playerSurfaceId);
- await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
- done();
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1100
- * @tc.name : 11.start->stop->release
- * (audioBitrate 16000,audioSampleRate 32000,videoBitrateRange 16000)(promise)
- * @tc.desc : Video recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level1
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1100', 0, async function (done) {
- let videoRecorder = undefined;
- let surfaceID = '';
- let videoOutput;
- let previewOutput;
- fdObject = await mediaTestBase.getFd('recorder_promise_11.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- configFile.audioBitrate = 16000;
- configFile.audioSampleRate = 32000;
- configFile.videoBitrate = 16000;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- await media.createVideoRecorder().then((recorder) => {
- console.info('case createVideoRecorder called');
- if (typeof (recorder) != 'undefined') {
- videoRecorder = recorder;
- expect(videoRecorder.state).assertEqual('idle');
- } else {
- console.info('case recordr is undefined!!');
- }
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.prepare(videoConfig).then(() => {
- console.info('case recordr prepare called');
- expect(videoRecorder.state).assertEqual('prepared');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.getInputSurface().then((outPutSurface) => {
- console.info('case getInputSurface called');
- expect(videoRecorder.state).assertEqual('prepared');
- surfaceID = outPutSurface;
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- videoOutput = await cameraManager.createVideoOutput(videoProfiles[0], surfaceID);
- previewOutput = await cameraManager.createPreviewOutput(previewProfiles[0], playerSurfaceId)
- captureSession = await videoRecorderBase.initCaptureSession(videoOutput, cameraManager,
- cameras[0], previewOutput);
- await startVideoOutput(videoOutput);
- await videoRecorder.start().then(() => {
- console.info('case start called');
- expect(videoRecorder.state).assertEqual('playing');
- mediaTestBase.msleep(RECORDER_TIME);
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoOutput.stop();
- await videoRecorder.stop().then(() => {
- expect(videoRecorder.state).assertEqual('stopped');
- console.info('case stop called');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.release().then(() => {
- expect(videoRecorder.state).assertEqual('idle');
- console.info('case release ');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoRecorderBase.stopCaptureSession(captureSession);
- await videoRecorderBase.checkVideos(fdPath, RECORDER_TIME, trackArray, playerSurfaceId);
- await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
- done();
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1200
- * @tc.name : 12.start->stop->release
- * (audioBitrate 32000,audioSampleRate 44100,videoBitrateRange 32000)(promise)
- * @tc.desc : Video recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level1
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1200', 0, async function (done) {
- let videoRecorder = undefined;
- let surfaceID = '';
- let videoOutput;
- let previewOutput;
- fdObject = await mediaTestBase.getFd('recorder_promise_12.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- configFile.audioBitrate = 32000;
- configFile.audioSampleRate = 44100;
- configFile.videoBitrate = 32000;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- await media.createVideoRecorder().then((recorder) => {
- console.info('case createVideoRecorder called');
- if (typeof (recorder) != 'undefined') {
- videoRecorder = recorder;
- expect(videoRecorder.state).assertEqual('idle');
- } else {
- console.info('case recordr is undefined!!');
- }
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.prepare(videoConfig).then(() => {
- console.info('case recordr prepare called');
- expect(videoRecorder.state).assertEqual('prepared');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.getInputSurface().then((outPutSurface) => {
- console.info('case getInputSurface called');
- expect(videoRecorder.state).assertEqual('prepared');
- surfaceID = outPutSurface;
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- videoOutput = await cameraManager.createVideoOutput(videoProfiles[0], surfaceID);
- previewOutput = await cameraManager.createPreviewOutput(previewProfiles[0], playerSurfaceId)
- captureSession = await videoRecorderBase.initCaptureSession(videoOutput, cameraManager,
- cameras[0], previewOutput);
- await startVideoOutput(videoOutput);
- await videoRecorder.start().then(() => {
- console.info('case start called');
- expect(videoRecorder.state).assertEqual('playing');
- mediaTestBase.msleep(RECORDER_TIME);
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoOutput.stop();
- await videoRecorder.stop().then(() => {
- expect(videoRecorder.state).assertEqual('stopped');
- console.info('case stop called');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.release().then(() => {
- expect(videoRecorder.state).assertEqual('idle');
- console.info('case release ');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoRecorderBase.stopCaptureSession(captureSession);
- await videoRecorderBase.checkVideos(fdPath, RECORDER_TIME, trackArray, playerSurfaceId);
- await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
- done();
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1300
- * @tc.name : 13.start->stop->release
- * (audioBitrate 112000,audioSampleRate 96000,videoBitrateRange 112000)(promise)
- * @tc.desc : Video recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level1
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1300', 0, async function (done) {
- let videoRecorder = undefined;
- let surfaceID = '';
- let videoOutput;
- let previewOutput;
- fdObject = await mediaTestBase.getFd('recorder_promise_13.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- configFile.audioBitrate = 112000;
- configFile.audioSampleRate = 96000;
- configFile.videoBitrate = 112000;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- await media.createVideoRecorder().then((recorder) => {
- console.info('case createVideoRecorder called');
- if (typeof (recorder) != 'undefined') {
- videoRecorder = recorder;
- expect(videoRecorder.state).assertEqual('idle');
- } else {
- console.info('case recordr is undefined!!');
- }
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.prepare(videoConfig).then(() => {
- console.info('case recordr prepare called');
- expect(videoRecorder.state).assertEqual('prepared');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.getInputSurface().then((outPutSurface) => {
- console.info('case getInputSurface called');
- expect(videoRecorder.state).assertEqual('prepared');
- surfaceID = outPutSurface;
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- videoOutput = await cameraManager.createVideoOutput(videoProfiles[0], surfaceID);
- previewOutput = await cameraManager.createPreviewOutput(previewProfiles[0], playerSurfaceId)
- captureSession = await videoRecorderBase.initCaptureSession(videoOutput, cameraManager,
- cameras[0], previewOutput);
- await startVideoOutput(videoOutput);
- await videoRecorder.start().then(() => {
- console.info('case start called');
- expect(videoRecorder.state).assertEqual('playing');
- mediaTestBase.msleep(RECORDER_TIME);
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoOutput.stop();
- await videoRecorder.stop().then(() => {
- expect(videoRecorder.state).assertEqual('stopped');
- console.info('case stop called');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.release().then(() => {
- expect(videoRecorder.state).assertEqual('idle');
- console.info('case release ');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoRecorderBase.stopCaptureSession(captureSession);
- await videoRecorderBase.checkVideos(fdPath, RECORDER_TIME, trackArray, playerSurfaceId);
- await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
- done();
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1400
- * @tc.name : 14.start->release (only video) (promise)
- * @tc.desc : Video recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level1
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1400', 0, async function (done) {
- let videoRecorder = undefined;
- let surfaceID = '';
- let videoOutput;
- let previewOutput;
- fdObject = await mediaTestBase.getFd('recorder_promise_14.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- onlyVideoConfig.url = fdPath;
- let trackArray = videoRecorderBase.getTrackArray(ONLYVIDEO_TYPE, onlyVideoProfile,
- onlyVideoConfig.videoSourceType);
- await media.createVideoRecorder().then((recorder) => {
- console.info('case createVideoRecorder called');
- if (typeof (recorder) != 'undefined') {
- videoRecorder = recorder;
- expect(videoRecorder.state).assertEqual('idle');
- } else {
- console.info('case recordr is undefined!!');
- expect().assertFail();
- }
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.prepare(onlyVideoConfig).then(() => {
- expect(videoRecorder.state).assertEqual('prepared');
- console.info('case prepare called');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.getInputSurface().then((outPutSurface) => {
- surfaceID = outPutSurface;
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- videoOutput = await cameraManager.createVideoOutput(videoProfiles[0], surfaceID);
- previewOutput = await cameraManager.createPreviewOutput(previewProfiles[0], playerSurfaceId)
- captureSession = await videoRecorderBase.initCaptureSession(videoOutput, cameraManager,
- cameras[0], previewOutput);
- await startVideoOutput(videoOutput);
- await videoRecorder.start().then(() => {
- expect(videoRecorder.state).assertEqual('playing');
- console.info('case start called');
- mediaTestBase.msleep(RECORDER_TIME);
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoOutput.stop();
- await videoRecorder.release().then(() => {
- expect(videoRecorder.state).assertEqual('idle');
- console.info('case release ');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoRecorderBase.stopCaptureSession(captureSession);
- await videoRecorderBase.checkVideos(fdPath, RECORDER_TIME, trackArray, playerSurfaceId);
- await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
- done();
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1500
- * @tc.name : 15.start->pause->release (only video) (promise)
- * @tc.desc : Video recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level1
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1500', 0, async function (done) {
- let videoRecorder = undefined;
- let surfaceID = '';
- let videoOutput;
- let previewOutput;
- fdObject = await mediaTestBase.getFd('recorder_promise_15.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- onlyVideoConfig.url = fdPath;
- let trackArray = videoRecorderBase.getTrackArray(ONLYVIDEO_TYPE, onlyVideoProfile,
- onlyVideoConfig.videoSourceType);
- await media.createVideoRecorder().then((recorder) => {
- console.info('case createVideoRecorder called');
- if (typeof (recorder) != 'undefined') {
- videoRecorder = recorder;
- expect(videoRecorder.state).assertEqual('idle');
- } else {
- console.info('case recordr is undefined!!');
- }
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.prepare(onlyVideoConfig).then(() => {
- console.info('case recordr prepare called');
- expect(videoRecorder.state).assertEqual('prepared');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.getInputSurface().then((outPutSurface) => {
- console.info('case getInputSurface called');
- console.info(`case getInputSurface,state is ${videoRecorder.state}`);
- expect(videoRecorder.state).assertEqual('prepared');
- surfaceID = outPutSurface;
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- videoOutput = await cameraManager.createVideoOutput(videoProfiles[0], surfaceID);
- previewOutput = await cameraManager.createPreviewOutput(previewProfiles[0], playerSurfaceId)
- captureSession = await videoRecorderBase.initCaptureSession(videoOutput, cameraManager,
- cameras[0], previewOutput);
- await startVideoOutput(videoOutput);
- await videoRecorder.start().then(() => {
- console.info('case start called');
- expect(videoRecorder.state).assertEqual('playing');
- mediaTestBase.msleep(RECORDER_TIME);
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoOutput.stop();
- await videoRecorder.pause().then(() => {
- console.info('case pause called');
- mediaTestBase.msleep(PAUSE_TIME);
- expect(videoRecorder.state).assertEqual('paused');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.release().then(() => {
- console.info('case release ');
- expect(videoRecorder.state).assertEqual('idle');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoRecorderBase.stopCaptureSession(captureSession);
- await videoRecorderBase.checkVideos(fdPath, RECORDER_TIME, trackArray, playerSurfaceId);
- await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
- done();
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1600
- * @tc.name : 16.start->pause->resume->releas (only video) (promise)
- * @tc.desc : Video recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level1
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1600', 0, async function (done) {
- let videoRecorder = undefined;
- let surfaceID = '';
- let videoOutput;
- let previewOutput;
- fdObject = await mediaTestBase.getFd('recorder_promise_16.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- onlyVideoConfig.url = fdPath;
- let trackArray = videoRecorderBase.getTrackArray(ONLYVIDEO_TYPE, onlyVideoProfile,
- onlyVideoConfig.videoSourceType);
- await media.createVideoRecorder().then((recorder) => {
- console.info('case createVideoRecorder called');
- if (typeof (recorder) != 'undefined') {
- videoRecorder = recorder;
- expect(videoRecorder.state).assertEqual('idle');
- } else {
- console.info('case recordr is undefined!!');
- }
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.prepare(onlyVideoConfig).then(() => {
- console.info('case recordr prepare called');
- expect(videoRecorder.state).assertEqual('prepared');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.getInputSurface().then((outPutSurface) => {
- expect(videoRecorder.state).assertEqual('prepared');
- console.info('case getInputSurface called');
- surfaceID = outPutSurface;
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- videoOutput = await cameraManager.createVideoOutput(videoProfiles[0], surfaceID);
- previewOutput = await cameraManager.createPreviewOutput(previewProfiles[0], playerSurfaceId)
- captureSession = await videoRecorderBase.initCaptureSession(videoOutput, cameraManager,
- cameras[0], previewOutput);
- await startVideoOutput(videoOutput);
- await videoRecorder.start().then(() => {
- expect(videoRecorder.state).assertEqual('playing');
- console.info('case start called');
- mediaTestBase.msleep(RECORDER_TIME);
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoOutput.stop();
- await videoRecorder.pause().then(() => {
- expect(videoRecorder.state).assertEqual('paused');
- mediaTestBase.msleep(PAUSE_TIME);
- console.info('case pause called');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoOutput.start();
- await videoRecorder.resume().then(() => {
- expect(videoRecorder.state).assertEqual('playing');
- mediaTestBase.msleep(RECORDER_TIME);
- console.info('case resume called');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.release().then(() => {
- expect(videoRecorder.state).assertEqual('idle');
- console.info('case release ');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoRecorderBase.stopCaptureSession(captureSession);
- await videoRecorderBase.checkVideos(fdPath, RECORDER_TIME * 2, trackArray, playerSurfaceId);
- await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
- done();
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1700
- * @tc.name : 17.start->stop->release (only video) (promise)
- * @tc.desc : Video recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level1
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1700', 0, async function (done) {
- let videoRecorder = undefined;
- let surfaceID = '';
- let videoOutput;
- let previewOutput;
- fdObject = await mediaTestBase.getFd('recorder_promise_17.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- onlyVideoConfig.url = fdPath;
- let trackArray = videoRecorderBase.getTrackArray(ONLYVIDEO_TYPE, onlyVideoProfile,
- onlyVideoConfig.videoSourceType);
- await media.createVideoRecorder().then((recorder) => {
- console.info('case createVideoRecorder called');
- if (typeof (recorder) != 'undefined') {
- videoRecorder = recorder;
- expect(videoRecorder.state).assertEqual('idle');
- } else {
- console.info('case recordr is undefined!!');
- }
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.prepare(onlyVideoConfig).then(() => {
- console.info('case recordr prepare called');
- expect(videoRecorder.state).assertEqual('prepared');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.getInputSurface().then((outPutSurface) => {
- console.info('case getInputSurface called');
- expect(videoRecorder.state).assertEqual('prepared');
- surfaceID = outPutSurface;
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- videoOutput = await cameraManager.createVideoOutput(videoProfiles[0], surfaceID);
- previewOutput = await cameraManager.createPreviewOutput(previewProfiles[0], playerSurfaceId)
- captureSession = await videoRecorderBase.initCaptureSession(videoOutput, cameraManager,
- cameras[0], previewOutput);
- await startVideoOutput(videoOutput);
- await videoRecorder.start().then(() => {
- console.info('case start called');
- expect(videoRecorder.state).assertEqual('playing');
- mediaTestBase.msleep(RECORDER_TIME);
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoOutput.stop();
- await videoRecorder.stop().then(() => {
- expect(videoRecorder.state).assertEqual('stopped');
- console.info('case stop called');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.release().then(() => {
- expect(videoRecorder.state).assertEqual('idle');
- console.info('case release ');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoRecorderBase.stopCaptureSession(captureSession);
- await videoRecorderBase.checkVideos(fdPath, RECORDER_TIME, trackArray, playerSurfaceId);
- await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
- done();
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1800
- * @tc.name : 18.start->reset->release (only video) (promise)
- * @tc.desc : Video recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level1
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1800', 0, async function (done) {
- let videoRecorder = undefined;
- let surfaceID = '';
- let videoOutput;
- let previewOutput;
- fdObject = await mediaTestBase.getFd('recorder_promise_18.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- onlyVideoConfig.url = fdPath;
- let trackArray = videoRecorderBase.getTrackArray(ONLYVIDEO_TYPE, onlyVideoProfile,
- onlyVideoConfig.videoSourceType);
- await media.createVideoRecorder().then((recorder) => {
- console.info('case createVideoRecorder called');
- if (typeof (recorder) != 'undefined') {
- videoRecorder = recorder;
- expect(videoRecorder.state).assertEqual('idle');
- } else {
- console.info('case recordr is undefined!!');
- }
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.prepare(onlyVideoConfig).then(() => {
- console.info('case recordr prepare called');
- expect(videoRecorder.state).assertEqual('prepared');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.getInputSurface().then((outPutSurface) => {
- expect(videoRecorder.state).assertEqual('prepared');
- console.info('case getInputSurface called');
- surfaceID = outPutSurface;
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- videoOutput = await cameraManager.createVideoOutput(videoProfiles[0], surfaceID);
- previewOutput = await cameraManager.createPreviewOutput(previewProfiles[0], playerSurfaceId)
- captureSession = await videoRecorderBase.initCaptureSession(videoOutput, cameraManager,
- cameras[0], previewOutput);
- await startVideoOutput(videoOutput);
- await videoRecorder.start().then(() => {
- console.info('case start called');
- expect(videoRecorder.state).assertEqual('playing');
- mediaTestBase.msleep(RECORDER_TIME);
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoOutput.stop();
- await videoRecorder.reset().then(() => {
- console.info('case reset called');
- expect(videoRecorder.state).assertEqual('idle');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.release().then(() => {
- expect(videoRecorder.state).assertEqual('idle');
- console.info('case release ');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoRecorderBase.stopCaptureSession(captureSession);
- await videoRecorderBase.checkVideos(fdPath, RECORDER_TIME, trackArray, playerSurfaceId);
- await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
- done();
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1900
- * @tc.name : 19.rotation 90 (promise)
- * @tc.desc : Video recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_1900', 0, async function (done) {
- let videoRecorder = undefined;
- let surfaceID = '';
- let videoOutput;
- let previewOutput;
- fdObject = await mediaTestBase.getFd('recorder_promise_19.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- configFile.audioSampleRate = 48000;
- videoConfig.rotation = 90;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- await media.createVideoRecorder().then((recorder) => {
- console.info('case createVideoRecorder called');
- if (typeof (recorder) != 'undefined') {
- videoRecorder = recorder;
- expect(videoRecorder.state).assertEqual('idle');
- } else {
- console.info('case recordr is undefined!!');
- expect().assertFail();
- }
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.prepare(videoConfig).then(() => {
- expect(videoRecorder.state).assertEqual('prepared');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.getInputSurface().then((outPutSurface) => {
- surfaceID = outPutSurface;
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- videoOutput = await cameraManager.createVideoOutput(videoProfiles[0], surfaceID);
- previewOutput = await cameraManager.createPreviewOutput(previewProfiles[0], playerSurfaceId)
- captureSession = await videoRecorderBase.initCaptureSession(videoOutput, cameraManager,
- cameras[0], previewOutput);
- await startVideoOutput(videoOutput);
- await videoRecorder.start().then(() => {
- expect(videoRecorder.state).assertEqual('playing');
- console.info('case start called');
- mediaTestBase.msleep(RECORDER_TIME);
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoOutput.stop();
- await videoRecorder.release().then(() => {
- expect(videoRecorder.state).assertEqual('idle');
- console.info('case release ');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoRecorderBase.stopCaptureSession(captureSession);
- await videoRecorderBase.checkVideos(fdPath, RECORDER_TIME, trackArray, playerSurfaceId);
- await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
- done();
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_2000
- * @tc.name : 20.rotation 180 (promise)
- * @tc.desc : Video recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_2000', 0, async function (done) {
- let videoRecorder = undefined;
- let surfaceID = '';
- let videoOutput;
- let previewOutput;
- fdObject = await mediaTestBase.getFd('recorder_promise_20.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- videoConfig.rotation = 180;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- await media.createVideoRecorder().then((recorder) => {
- console.info('case createVideoRecorder called');
- if (typeof (recorder) != 'undefined') {
- videoRecorder = recorder;
- expect(videoRecorder.state).assertEqual('idle');
- } else {
- console.info('case recordr is undefined!!');
- expect().assertFail();
- }
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.prepare(videoConfig).then(() => {
- expect(videoRecorder.state).assertEqual('prepared');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.getInputSurface().then((outPutSurface) => {
- surfaceID = outPutSurface;
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- videoOutput = await cameraManager.createVideoOutput(videoProfiles[0], surfaceID);
- previewOutput = await cameraManager.createPreviewOutput(previewProfiles[0], playerSurfaceId)
- captureSession = await videoRecorderBase.initCaptureSession(videoOutput, cameraManager,
- cameras[0], previewOutput);
- await startVideoOutput(videoOutput);
- await videoRecorder.start().then(() => {
- expect(videoRecorder.state).assertEqual('playing');
- console.info('case start called');
- mediaTestBase.msleep(RECORDER_TIME);
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoOutput.stop();
- await videoRecorder.release().then(() => {
- expect(videoRecorder.state).assertEqual('idle');
- console.info('case release ');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoRecorderBase.stopCaptureSession(captureSession);
- await videoRecorderBase.checkVideos(fdPath, RECORDER_TIME, trackArray, playerSurfaceId);
- await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
- done();
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_2100
- * @tc.name : 21.rotation 270 (promise)
- * @tc.desc : Video recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_2100', 0, async function (done) {
- let videoRecorder = undefined;
- let surfaceID = '';
- let videoOutput;
- let previewOutput;
- fdObject = await mediaTestBase.getFd('recorder_promise_21.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- videoConfig.rotation = 270;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- await media.createVideoRecorder().then((recorder) => {
- console.info('case createVideoRecorder called');
- if (typeof (recorder) != 'undefined') {
- videoRecorder = recorder;
- expect(videoRecorder.state).assertEqual('idle');
- } else {
- console.info('case recordr is undefined!!');
- expect().assertFail();
- }
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.prepare(videoConfig).then(() => {
- expect(videoRecorder.state).assertEqual('prepared');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.getInputSurface().then((outPutSurface) => {
- surfaceID = outPutSurface;
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- videoOutput = await cameraManager.createVideoOutput(videoProfiles[0], surfaceID);
- previewOutput = await cameraManager.createPreviewOutput(previewProfiles[0], playerSurfaceId)
- captureSession = await videoRecorderBase.initCaptureSession(videoOutput, cameraManager,
- cameras[0], previewOutput);
- await startVideoOutput(videoOutput);
- await videoRecorder.start().then(() => {
- expect(videoRecorder.state).assertEqual('playing');
- console.info('case start called');
- mediaTestBase.msleep(RECORDER_TIME);
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoOutput.stop();
- await videoRecorder.release().then(() => {
- expect(videoRecorder.state).assertEqual('idle');
- console.info('case release ');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoRecorderBase.stopCaptureSession(captureSession);
- await videoRecorderBase.checkVideos(fdPath, RECORDER_TIME, trackArray, playerSurfaceId);
- await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
- done();
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_2200
- * @tc.name : 22.videoFrameRate 20 (promise)
- * @tc.desc : Video recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_2200', 0, async function (done) {
- let videoRecorder = undefined;
- let surfaceID = '';
- let videoOutput;
- let previewOutput;
- fdObject = await mediaTestBase.getFd('recorder_promise_22.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- configFile.videoFrameRate = 20;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- await media.createVideoRecorder().then((recorder) => {
- console.info('case createVideoRecorder called');
- if (typeof (recorder) != 'undefined') {
- videoRecorder = recorder;
- expect(videoRecorder.state).assertEqual('idle');
- } else {
- console.info('case recordr is undefined!!');
- expect().assertFail();
- }
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.prepare(videoConfig).then(() => {
- expect(videoRecorder.state).assertEqual('prepared');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.getInputSurface().then((outPutSurface) => {
- surfaceID = outPutSurface;
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- videoOutput = await cameraManager.createVideoOutput(videoProfiles[0], surfaceID);
- previewOutput = await cameraManager.createPreviewOutput(previewProfiles[0], playerSurfaceId)
- captureSession = await videoRecorderBase.initCaptureSession(videoOutput, cameraManager,
- cameras[0], previewOutput);
- await startVideoOutput(videoOutput);
- await videoRecorder.start().then(() => {
- expect(videoRecorder.state).assertEqual('playing');
- console.info('case start called');
- mediaTestBase.msleep(RECORDER_TIME);
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoOutput.stop();
- await videoRecorder.release().then(() => {
- expect(videoRecorder.state).assertEqual('idle');
- console.info('case release ');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoRecorderBase.stopCaptureSession(captureSession);
- await videoRecorderBase.checkVideos(fdPath, RECORDER_TIME, trackArray, playerSurfaceId);
- await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
- done();
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_2300
- * @tc.name : 23.videoFrameRate 30 (promise)
- * @tc.desc : Video recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_2300', 0, async function (done) {
- let videoRecorder = undefined;
- let surfaceID = '';
- let videoOutput;
- let previewOutput;
- fdObject = await mediaTestBase.getFd('recorder_promise_23.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- configFile.videoFrameRate = 30;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- await media.createVideoRecorder().then((recorder) => {
- console.info('case createVideoRecorder called');
- if (typeof (recorder) != 'undefined') {
- videoRecorder = recorder;
- expect(videoRecorder.state).assertEqual('idle');
- } else {
- console.info('case recordr is undefined!!');
- expect().assertFail();
- }
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.prepare(videoConfig).then(() => {
- expect(videoRecorder.state).assertEqual('prepared');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.getInputSurface().then((outPutSurface) => {
- surfaceID = outPutSurface;
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- videoOutput = await cameraManager.createVideoOutput(videoProfiles[0], surfaceID);
- previewOutput = await cameraManager.createPreviewOutput(previewProfiles[0], playerSurfaceId)
- captureSession = await videoRecorderBase.initCaptureSession(videoOutput, cameraManager,
- cameras[0], previewOutput);
- await startVideoOutput(videoOutput);
- await videoRecorder.start().then(() => {
- expect(videoRecorder.state).assertEqual('playing');
- console.info('case start called');
- mediaTestBase.msleep(RECORDER_TIME);
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoOutput.stop();
- await videoRecorder.release().then(() => {
- expect(videoRecorder.state).assertEqual('idle');
- console.info('case release ');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoRecorderBase.stopCaptureSession(captureSession);
- await videoRecorderBase.checkVideos(fdPath, RECORDER_TIME, trackArray, playerSurfaceId);
- await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
- done();
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_2400
- * @tc.name : 24.videoFrameRate 60 (promise)
- * @tc.desc : Video recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_2400', 0, async function (done) {
- let videoRecorder = undefined;
- let surfaceID = '';
- let videoOutput;
- let previewOutput;
- fdObject = await mediaTestBase.getFd('recorder_promise_24.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = fdPath;
- configFile.videoFrameRate = 60;
- let trackArray = videoRecorderBase.getTrackArray(AUDIO_VIDEO_TYPE, configFile, videoConfig.videoSourceType);
- await media.createVideoRecorder().then((recorder) => {
- console.info('case createVideoRecorder called');
- if (typeof (recorder) != 'undefined') {
- videoRecorder = recorder;
- expect(videoRecorder.state).assertEqual('idle');
- } else {
- console.info('case recordr is undefined!!');
- expect().assertFail();
- }
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.prepare(videoConfig).then(() => {
- expect(videoRecorder.state).assertEqual('prepared');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.getInputSurface().then((outPutSurface) => {
- surfaceID = outPutSurface;
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- videoOutput = await cameraManager.createVideoOutput(videoProfiles[0], surfaceID);
- previewOutput = await cameraManager.createPreviewOutput(previewProfiles[0], playerSurfaceId)
- captureSession = await videoRecorderBase.initCaptureSession(videoOutput, cameraManager,
- cameras[0], previewOutput);
- await startVideoOutput(videoOutput);
- await videoRecorder.start().then(() => {
- expect(videoRecorder.state).assertEqual('playing');
- console.info('case start called');
- mediaTestBase.msleep(RECORDER_TIME);
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoOutput.stop();
- await videoRecorder.release().then(() => {
- expect(videoRecorder.state).assertEqual('idle');
- console.info('case release ');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoRecorderBase.stopCaptureSession(captureSession);
- await videoRecorderBase.checkVideos(fdPath, RECORDER_TIME, trackArray, playerSurfaceId);
- await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
- done();
- })
-
- /* *
- * @tc.number : SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_ERRORCODE
- * @tc.name : 25.error code (promise)
- * @tc.desc : Video recordr control test
- * @tc.size : MediumTest
- * @tc.type : Function
- * @tc.level : Level0
- */
- it('SUB_MULTIMEDIA_MEDIA_VIDEO_RECORDER_FUNCTION_PROMISE_ERRORCODE', 0, async function (done) {
- let videoRecorder = undefined;
- let surfaceID = '';
- let videoOutput;
- let previewOutput;
- let errorCode = false;
- fdObject = await mediaTestBase.getFd('recorder_promise_25.mp4');
- fdPath = "fd://" + fdObject.fdNumber.toString();
- videoConfig.url = '';
- await media.createVideoRecorder().then((recorder) => {
- console.info('case createVideoRecorder called');
- if (typeof (recorder) != 'undefined') {
- videoRecorder = recorder;
- expect(videoRecorder.state).assertEqual('idle');
- } else {
- console.info('case recordr is undefined!!');
- }
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- videoRecorder.on('error', (err) => {
- console.info('case on error called, errMessage is ' + err.code);
- errorCode = checkErrorCode(err.code);
- expect(errorCode).assertEqual(true);
- });
-
- await videoRecorder.prepare(videoConfig).then(() => {
- console.info('case recordr prepare called');
- expect(videoRecorder.state).assertEqual('prepared');
- }, (err) => {
- console.info('case promise error called, errMessage is ' + err.code);
- errorCode = checkErrorCode(err.code);
- expect(errorCode).assertEqual(true);
- }).catch(mediaTestBase.catchCallback);
- await videoRecorder.reset().then(() => {
- console.info('case recordr reset called');
- expect(videoRecorder.state).assertEqual('idle');
- }, (err) => {
- console.info('case promise error called, errMessage is ' + err.code);
- errorCode = checkErrorCode(err.code);
- expect(errorCode).assertEqual(true);
- }).catch(mediaTestBase.catchCallback);
- videoConfig.url = fdPath;
- await videoRecorder.prepare(videoConfig).then(() => {
- console.info('case recordr prepare called');
- expect(videoRecorder.state).assertEqual('prepared');
- }, (err) => {
- expect(videoRecorder.state).assertEqual('error');
- console.info('case promise error called, errMessage is ' + err.code);
- expect().assertFail();
- }).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.getInputSurface().then((outPutSurface) => {
- console.info('case getInputSurface called');
- expect(videoRecorder.state).assertEqual('prepared');
- surfaceID = outPutSurface;
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
-
- videoOutput = await cameraManager.createVideoOutput(videoProfiles[0], surfaceID);
- previewOutput = await cameraManager.createPreviewOutput(previewProfiles[0], playerSurfaceId)
- captureSession = await videoRecorderBase.initCaptureSession(videoOutput, cameraManager,
- cameras[0], previewOutput);
-
- await startVideoOutput(videoOutput);
- await videoRecorder.start().then(() => {
- console.info('case recordr play called');
- expect(videoRecorder.state).assertEqual('playing');
- }, (err) => {
- console.info('case promise error called, errMessage is ' + err.code);
- expect().assertFail();
- }).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.start().then(() => {
- console.info('case recordr start called');
- }, (err) => {
- console.info('case promise error called, errMessage is ' + err.code);
- errorCode = checkErrorCode(err.code);
- expect(errorCode).assertEqual(true);
- }).catch(mediaTestBase.catchCallback);
-
- await videoRecorder.prepare(videoConfig).then(() => {
- console.info('case recordr prepare called');
- }, (err) => {
- console.info('case promise error called, errMessage is ' + err.code);
- errorCode = checkErrorCode(err.code);
- expect(errorCode).assertEqual(true);
- }).catch(mediaTestBase.catchCallback);
- await videoRecorder.release().then(() => {
- console.info('case release ');
- expect(videoRecorder.state).assertEqual('idle');
- }, mediaTestBase.failureCallback).catch(mediaTestBase.catchCallback);
- await videoOutput.stop();
- await videoRecorderBase.stopCaptureSession(captureSession);
- await mediaTestBase.closeFd(fdObject.fileAsset, fdObject.fdNumber);
- await videoRecorder.prepare(videoConfig).then(() => {
- console.info('case recordr prepare called');
- }, (err) => {
- console.info('case promise error called, errMessage is ' + err.code);
- errorCode = checkErrorCode(err.code);
- expect(errorCode).assertEqual(true);
- }).catch(mediaTestBase.catchCallback);
- done();
- })
-})
-}
diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/resources/base/element/string.json b/multimedia/media/media_js_standard/videoRecorder/src/main/resources/base/element/string.json
deleted file mode 100644
index 8afb12da3b72e7b085a608d62d98beb65fe83030..0000000000000000000000000000000000000000
--- a/multimedia/media/media_js_standard/videoRecorder/src/main/resources/base/element/string.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "string": [
- {
- "name": "entry_MainAbility",
- "value": "entry_MainAbility"
- },
- {
- "name": "mainability_description",
- "value": "JS_Empty Ability"
- },
- {
- "name": "MainAbility_desc",
- "value": "description"
- },
- {
- "name": "MainAbility_label",
- "value": "label"
- },
- {
- "name": "TestAbility_desc",
- "value": "description"
- },
- {
- "name": "TestAbility_label",
- "value": "label"
- }
- ]
-}
\ No newline at end of file
diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/resources/base/media/icon.png b/multimedia/media/media_js_standard/videoRecorder/src/main/resources/base/media/icon.png
deleted file mode 100644
index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000
Binary files a/multimedia/media/media_js_standard/videoRecorder/src/main/resources/base/media/icon.png and /dev/null differ
diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/resources/rawfile/01.mp3 b/multimedia/media/media_js_standard/videoRecorder/src/main/resources/rawfile/01.mp3
deleted file mode 100644
index 85573aabb4945760a979388540f9374db46a968c..0000000000000000000000000000000000000000
Binary files a/multimedia/media/media_js_standard/videoRecorder/src/main/resources/rawfile/01.mp3 and /dev/null differ
diff --git a/multimedia/media/media_js_standard/videoRecorder/src/main/resources/rawfile/H264_AAC.mp4 b/multimedia/media/media_js_standard/videoRecorder/src/main/resources/rawfile/H264_AAC.mp4
deleted file mode 100644
index 4b1e20e73501523f801a942f84f91ed6334161fa..0000000000000000000000000000000000000000
--- a/multimedia/media/media_js_standard/videoRecorder/src/main/resources/rawfile/H264_AAC.mp4
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:7277b0e4910c52a8614d4f2162af3c03ad8589100f32e80dc36a9c96ba797ecd
-size 1894335