提交 76ff0fa9 编写于 作者: L lxq

<liuxueqi3@huawei.com>

Signed-off-by: Nlxq <liuxueqi3@huawei.com>
上级 45dc4e32
......@@ -20,8 +20,11 @@ group("multimedia") {
"audio/audio_js_standard/audioManager:audio_manager_js_hap",
"camera/camera_js_standard:camera_standard_ets_hap",
"image/image_js_standard/image:image_js_hap",
"image/image_js_standard/imageColorspace:image_colorspace_js_hap",
"image/image_js_standard/imageDecodeOptions:image_DecodeOptions_js_hap",
"image/image_js_standard/imageExif:image_exif_js_hap",
"image/image_js_standard/imagePixelMapFramework:image_pixelmapframework_js_hap",
"image/image_js_standard/imageWebp:image_webp_js_hap",
"media/media_js_standard/audioCodecFormat:audio_codec_format_js_hap",
"media/media_js_standard/audioDecoder:audio_decoder_js_hap",
"media/media_js_standard/audioEncoder:audio_encoder_js_hap",
......@@ -32,6 +35,7 @@ group("multimedia") {
"media/media_js_standard/videoDecoder:video_decoder_js_hap",
"media/media_js_standard/videoEncoder:video_encoder_js_hap",
"media/media_js_standard/videoPlayer:video_player_js_hap",
"media/media_js_standard/videoRecorder:video_recorder_js_hap",
"medialibrary/mediaLibrary_js_standard:mediaLibrary_js_hap",
]
} else {
......
# Copyright (C) 2021 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("image_colorspace_js_hap") {
hap_profile = "./src/main/config.json"
deps = [
":image_colorspace_js_assets",
":image_colorspace_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsImageColorspaceJsTest"
}
ohos_js_assets("image_colorspace_js_assets") {
source_dir = "./src/main/js/default"
}
ohos_resources("image_colorspace_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
}
{
"description": "Configuration for Image Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "300000",
"package": "ohos.acts.multimedia.image.Colorspace",
"shell-timeout": "120000"
},
"kits": [
{
"test-file-name": [
"ActsImageColorspaceJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"app": {
"apiVersion": {
"compatible": 6,
"releaseType": "Beta1",
"target": 7
},
"vendor": "acts",
"bundleName": "ohos.acts.multimedia.image.Colorspace",
"version": {
"code": 1000000,
"name": "1.0.0"
}
},
"deviceConfig": {
"default": {
"debug": true
}
},
"module": {
"abilities": [
{
"iconId": 16777218,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"descriptionId": 16777217,
"visible": true,
"labelId": 16777216,
"icon": "$media:icon",
"name": "ohos.acts.multimedia.image.Colorspace.MainAbility",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "page",
"homeAbility": true,
"launchType": "standard"
}
],
"deviceType": [
"phone",
"tablet",
"tv",
"wearable"
],
"mainAbility": "ohos.acts.multimedia.image.Colorspace.MainAbility",
"distro": {
"moduleType": "entry",
"installationFree": false,
"deliveryWithInstall": true,
"moduleName": "entry"
},
"reqPermissions": [
{
"name": "ohos.permission.GET_BUNDLE_INFO",
"reason": "use ohos.permission.GET_BUNDLE_INFO"
},
{
"name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
"reason":"use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
},
{
"name" : "ohos.permission.GRANT_SENSITIVE_PERMISSIONS",
"reason" : "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
},
{
"name" : "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS",
"reason" : "use ohos.permission.REVOKE_SENSITIVE_PERMISSIONS"
},
{
"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.image.Colorspace",
"name": ".MyApplication",
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": true
}
}
]
}
}
\ No newline at end of file
/*
* Copyright (C) 2021 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');
}
};
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
.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;
}
}
\ No newline at end of file
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
\ No newline at end of file
/*
* Copyright (C) 2021 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'
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
this.timeout = 60000
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
},
onReady() {
},
}
\ No newline at end of file
/*
* Copyright (C) 2021 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.
*/
require('./colorspace.test.js')
\ No newline at end of file
/*
* Copyright (C) 2021 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 image from '@ohos.multimedia.image'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
import { iccbuf } from './testImg2'
describe('Image', function () {
beforeAll(async function () {
console.info('beforeAll case');
})
beforeEach(function () {
console.info('beforeEach case');
})
afterEach(async function () {
console.info('afterEach case');
})
afterAll(async function () {
console.info('afterAll case');
})
function genPicSource() {
var data = iccbuf.buffer;
return image.createImageSource(data);
}
function loger(caseName) {
return {
myName: caseName,
log:function(msg) {
console.info(this.myName+ ' ' + msg);
}
}
}
async function packingCbFail(done, testNum, args){
let logger = loger(`${testNum}`)
try {
let imageSource = genPicSource();
logger.log("ImageSource " + (imageSource != undefined));
if (imageSource == undefined) {
console.info(`${testNum} create image source failed`);
expect(false).assertTrue();
done();
}else{
const imagePackerApi = image.createImagePacker();
if (imagePackerApi == undefined) {
console.info(`${testNum} create image packer failed`);
expect(false).assertTrue();
done();
}else{
imagePackerApi.packing(imageSource, args, (err, data) => {
expect(data == undefined).assertTrue();
done();
})
}
}
} catch (error) {
logger.log('failed ' + error);
expect(false).assertTrue();
done();
}
}
async function packingPromiseFail(done, testNum, args) {
let logger = loger(`testNum`)
try {
let imageSource = genPicSource();
logger.log("ImageSource " + (imageSource != undefined));
if (imageSource == undefined) {
console.info(`${testNum} create image source failed`);
expect(false).assertTrue();
done();
}else{
const imagePackerApi = image.createImagePacker();
if (imagePackerApi == undefined) {
console.info(`${testNum} create image packer failed`);
expect(false).assertTrue();
done();
}else{
imagePackerApi.packing(imageSource, args).then(data => {
expect(data == undefined).assertTrue();
done();
}).catch(error => {
console.log(` ${testNum} error: ` + error);
expect(true).assertTrue();
done();
})
}
}
} catch (error) {
logger.log('failed ' + error);
expect(false).assertTrue();
done();
}
}
/**
* @tc.number : decodeP3_001
* @tc.name : Decode
* @tc.desc : 1.create imagesource
* 2.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('decodeP3_001', 0, async function (done) {
let logger = loger('decodeP3_001')
try {
let imageSource = genPicSource();
logger.log("ImageSource " + (imageSource != undefined));
if (imageSource != undefined) {
let pixelMap = await imageSource.createPixelMap();
logger.log("PixelMap " + pixelMap);
logger.log("PixelMap " + (pixelMap != undefined));
expect(pixelMap != undefined ).assertTrue();
done();
}
} catch (error) {
logger.log('failed ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : decodeP3_002
* @tc.name : Decode -callback
* @tc.desc : 1.create imagesource
* 2.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('decodeP3_002', 0, async function (done) {
let logger = loger('decodeP3_002')
try {
let imageSource = genPicSource();
logger.log("ImageSource " + (imageSource != undefined));
if (imageSource != undefined) {
imageSource.createPixelMap((err,pixelMap)=>{
logger.log("PixelMap " + pixelMap);
logger.log("PixelMap " + (pixelMap != undefined));
expect(pixelMap != undefined ).assertTrue();
done();
})
}
} catch (error) {
logger.log('failed ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : encodeP3_001
* @tc.name : Encode -callback
* @tc.desc : 1.create imagesource
* 2.createImagePacker
* 3.packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('encodeP3_001', 0, async function (done) {
let logger = loger('encodeP3_001')
let testNum = 'encodeP3_001'
try {
let imageSource = genPicSource();
logger.log("ImageSource " + (imageSource != undefined));
if (imageSource == undefined) {
console.info(`${testNum} create image source failed`);
expect(false).assertTrue();
done();
}else{
const imagePackerApi = image.createImagePacker();
if (imagePackerApi == undefined) {
console.info(`${testNum} create image packer failed`);
expect(false).assertTrue();
done();
}else{
let packOpts = { format:["image/jpeg"], quality:90 }
imagePackerApi.packing(imageSource, packOpts, (err, data) => {
expect(data != undefined).assertTrue();
var dataArr = new Uint8Array(data);
console.info(`${testNum} dataArr.length=` + dataArr.length);
for (var i = 0; i < dataArr.length; i++) {
console.info(`dataArr[` + i + `]=` + dataArr[i]);
}
done();
})
}
}
} catch (error) {
logger.log('failed ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : encodeP3_002
* @tc.name : Encode -promise
* @tc.desc : 1.create imagesource
* 2.createImagePacker
* 3.packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('encodeP3_002', 0, async function (done) {
let logger = loger('encodeP3_002')
let testNum = 'encodeP3_002'
try {
let imageSource = genPicSource();
logger.log("ImageSource " + (imageSource != undefined));
if (imageSource == undefined) {
console.info(`${testNum} create image source failed`);
expect(false).assertTrue();
done();
}else{
const imagePackerApi = image.createImagePacker();
if (imagePackerApi == undefined) {
console.info(`${testNum} create image packer failed`);
expect(false).assertTrue();
done();
}else{
let packOpts = { format:["image/jpeg"], quality:90 }
imagePackerApi.packing(imageSource, packOpts).then(data => {
expect(data != undefined).assertTrue();
var dataArr = new Uint8Array(data);
console.info(`${testNum} dataArr.length=` + dataArr.length);
for (var i = 0; i < dataArr.length; i++) {
console.info(`dataArr[` + i + `]=` + dataArr[i]);
}
done();
}).catch(error => {
console.log('encodeP3_002 error: ' + error);
expect(false).assertTrue();
done();
})
}
}
} catch (error) {
logger.log('failed ' + error);
expect(false).assertTrue();
done();
}
})
/**
* @tc.number : encodeP3_003
* @tc.name : Encode -callback-
* @tc.desc : 1.create imagesource
* 2.createImagePacker
* 3.packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('encodeP3_003', 0, async function (done) {
let packOpts = { format:["image/gif"], quality:90 }
packingCbFail(done, 'encodeP3_003', packOpts)
})
/**
* @tc.number : encodeP3_004
* @tc.name : Encode -callback-wrong format
* @tc.desc : 1.create imagesource
* 2.createImagePacker
* 3.packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('encodeP3_004', 0, async function (done) {
let packOpts = { format:["image/jpeg"], quality:200 }
packingCbFail(done, 'encodeP3_004', packOpts)
})
/**
* @tc.number : encodeP3_005
* @tc.name : Encode -callback-no quality
* @tc.desc : 1.create imagesource
* 2.createImagePacker
* 3.packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('encodeP3_005', 0, async function (done) {
let packOpts = { format:["image/jpeg"] }
packingCbFail(done, 'encodeP3_005', packOpts)
})
/**
* @tc.number : encodeP3_006
* @tc.name : Encode -callback-no format
* @tc.desc : 1.create imagesource
* 2.createImagePacker
* 3.packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('encodeP3_006', 0, async function (done) {
let packOpts = { quality:50 }
packingCbFail(done, 'encodeP3_006', packOpts)
})
/**
* @tc.number : encodeP3_007
* @tc.name : Encode -promise
* @tc.desc : 1.create imagesource
* 2.createImagePacker
* 3.packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('encodeP3_007', 0, async function (done) {
let packOpts = { format:["image/gif"], quality:90 }
packingPromiseFail(done, 'encodeP3_007', packOpts)
})
/**
* @tc.number : encodeP3_008
* @tc.name : Encode -promise
* @tc.desc : 1.create imagesource
* 2.createImagePacker
* 3.packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('encodeP3_008', 0, async function (done) {
let packOpts = { format:["image/jpeg"], quality:101 }
packingPromiseFail(done, 'encodeP3_008', packOpts)
})
/**
* @tc.number : encodeP3_009
* @tc.name : Encode -promise -no quality
* @tc.desc : 1.create imagesource
* 2.createImagePacker
* 3.packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('encodeP3_009', 0, async function (done) {
let packOpts = { format:["image/jpeg"] }
packingPromiseFail(done, 'encodeP3_009', packOpts)
})
/**
* @tc.number : encodeP3_010
* @tc.name : Encode -promise -no format
* @tc.desc : 1.create imagesource
* 2.createImagePacker
* 3.packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it('encodeP3_010', 0, async function (done) {
let packOpts = { quality:100 }
packingPromiseFail(done, 'encodeP3_010', packOpts)
})
})
{
"string": [
{
"name": "entry_MainAbility",
"value": "ImageTwoJSTestMain"
},
{
"name": "mainability_description",
"value": "ImageTwoJSTestMain Ability"
}
]
}
\ No newline at end of file
# Copyright (C) 2021 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("image_pixelmapframework_js_hap") {
hap_profile = "./src/main/config.json"
deps = [
":image_pixelmapframework_js_assets",
":image_pixelmapframework_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsImagePixelMapFrameworkJsTest"
}
ohos_js_assets("image_pixelmapframework_js_assets") {
source_dir = "./src/main/js/default"
}
ohos_resources("image_pixelmapframework_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
}
{
"description": "Configuration for Image Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "300000",
"package": "ohos.acts.multimedia.image.PixelMapFramework",
"shell-timeout": "120000"
},
"kits": [
{
"test-file-name": [
"ActsImagePixelMapFrameworkJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"app": {
"apiVersion": {
"compatible": 6,
"releaseType": "Beta1",
"target": 7
},
"vendor": "acts",
"bundleName": "ohos.acts.multimedia.image.PixelMapFramework",
"version": {
"code": 1000000,
"name": "1.0.0"
}
},
"deviceConfig": {
"default": {
"debug": true
}
},
"module": {
"abilities": [
{
"iconId": 16777218,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"descriptionId": 16777217,
"visible": true,
"labelId": 16777216,
"icon": "$media:icon",
"name": "ohos.acts.multimedia.image.PixelMapFramework.MainAbility",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "page",
"homeAbility": true,
"launchType": "standard"
}
],
"deviceType": [
"phone",
"tablet",
"tv",
"wearable"
],
"mainAbility": "ohos.acts.multimedia.image.PixelMapFramework.MainAbility",
"distro": {
"moduleType": "entry",
"installationFree": false,
"deliveryWithInstall": true,
"moduleName": "entry"
},
"reqPermissions": [
{
"name": "ohos.permission.GET_BUNDLE_INFO",
"reason": "use ohos.permission.GET_BUNDLE_INFO"
},
{
"name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
"reason":"use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
},
{
"name" : "ohos.permission.GRANT_SENSITIVE_PERMISSIONS",
"reason" : "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
},
{
"name" : "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS",
"reason" : "use ohos.permission.REVOKE_SENSITIVE_PERMISSIONS"
},
{
"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.image.PixelMapFramework",
"name": ".MyApplication",
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": true
}
}
]
}
}
\ No newline at end of file
/*
* Copyright (C) 2021 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');
}
};
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
.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;
}
}
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
/*
* Copyright (C) 2021 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'
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
const configService = core.getDefaultService('config')
this.timeout = 60000
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
},
onReady() {
},
}
\ No newline at end of file
/*
* Copyright (C) 2021 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.
*/
require('./framework.test.js')
{
"string": [
{
"name": "entry_MainAbility",
"value": "ImageJSTestMain"
},
{
"name": "mainability_description",
"value": "ImageJSTestMain Ability"
}
]
}
\ No newline at end of file
# Copyright (C) 2021 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("image_webp_js_hap") {
hap_profile = "./src/main/config.json"
deps = [
":image_webp_js_assets",
":image_webp_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsImageWebpJsTest"
}
ohos_js_assets("image_webp_js_assets") {
source_dir = "./src/main/js/default"
}
ohos_resources("image_webp_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
}
{
"description": "Configuration for Image Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "100000",
"package": "ohos.acts.multimedia.image.Webp",
"shell-timeout": "120000"
},
"kits": [
{
"test-file-name": [
"ActsImageWebpJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
},
{
"type": "ShellKit",
"run-command": [
"mkdir /data/app/el2/100/base/ohos.acts.multimedia.image.Webp/files",
"chmod 777 /data/app/el2/100/base/ohos.acts.multimedia.image.Webp/files"
],
"teardown-command":[
]
},
{
"type": "PushKit",
"pre-push": [
],
"push": [
"./resource/image/test_large.webp ->/data/app/el2/100/base/ohos.acts.multimedia.image.Webp/files",
"./resource/image/test.png ->/data/app/el2/100/base/ohos.acts.multimedia.image.Webp/files",
"./resource/image/test.jpg ->/data/app/el2/100/base/ohos.acts.multimedia.image.Webp/files",
"./resource/image/test.bmp ->/data/app/el2/100/base/ohos.acts.multimedia.image.Webp/files",
"./resource/image/test.gif ->/data/app/el2/100/base/ohos.acts.multimedia.image.Webp/files"
]
},
{
"type": "ShellKit",
"run-command": [
"chmod 777 /data/app/el2/100/base/ohos.acts.multimedia.image.Webp/files/test.jpg",
"chmod 777 /data/app/el2/100/base/ohos.acts.multimedia.image.Webp/files/test.png",
"chmod 777 /data/app/el2/100/base/ohos.acts.multimedia.image.Webp/files/test.bmp",
"chmod 777 /data/app/el2/100/base/ohos.acts.multimedia.image.Webp/files/test.gif",
"chmod 777 /data/app/el2/100/base/ohos.acts.multimedia.image.Webp/files/test_large.webp",
"hilog -Q pidoff"
],
"teardown-command":[
]
}
]
}
\ No newline at end of file
{
"app": {
"apiVersion": {
"compatible": 6,
"releaseType": "Beta1",
"target": 7
},
"vendor": "acts",
"bundleName": "ohos.acts.multimedia.image.Webp",
"version": {
"code": 1000000,
"name": "1.0.0"
}
},
"deviceConfig": {
"default": {
"debug": true
}
},
"module": {
"abilities": [
{
"iconId": 16777218,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"descriptionId": 16777217,
"visible": true,
"labelId": 16777216,
"icon": "$media:icon",
"name": "ohos.acts.multimedia.image.Webp.MainAbility",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "page",
"homeAbility": true,
"launchType": "standard"
}
],
"deviceType": [
"phone",
"tablet",
"tv",
"wearable"
],
"mainAbility": "ohos.acts.multimedia.image.Webp.MainAbility",
"distro": {
"moduleType": "entry",
"installationFree": false,
"deliveryWithInstall": true,
"moduleName": "entry"
},
"reqPermissions": [
{
"name": "ohos.permission.GET_BUNDLE_INFO",
"reason": "use ohos.permission.GET_BUNDLE_INFO"
},
{
"name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
"reason":"use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
},
{
"name" : "ohos.permission.GRANT_SENSITIVE_PERMISSIONS",
"reason" : "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
},
{
"name" : "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS",
"reason" : "use ohos.permission.REVOKE_SENSITIVE_PERMISSIONS"
},
{
"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.image.Webp",
"name": ".MyApplication",
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": true
}
}
]
}
}
\ No newline at end of file
/*
* Copyright (C) 2021 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');
}
};
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
\ No newline at end of file
/*
* Copyright (C) 2021 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.
*/
require('./webp.test.js')
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册