提交 a45ec152 编写于 作者: 华华小仙女 提交者: Gitee

Merge branch 'monthly_20221018' of gitee.com:openharmony/xts_acts into monthly_20221018

Signed-off-by: N华华小仙女 <zhurong18@h-partners.com>
......@@ -21,7 +21,6 @@ group("communication") {
"bluetooth_profile:ActsBluetoothProFileJsTest",
"bluetooth_standard:ActsBluetoothJsTest",
"dsoftbus/rpc:ActsRpcJsTest",
"dsoftbus/rpc_server:ActsRpcJsServer",
"nfc_Controller:ActsNFCJSTest",
"wifi_p2p:ActsP2PJSTest",
"wifi_standard:ActsWifiJSTest",
......
......@@ -12,8 +12,7 @@
"kits": [
{
"test-file-name": [
"ActsRpcHapTest.hap",
"ActsRpcHapServer.hap"
"ActsRpcHapTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
......
{
"description": "Configuration for rpc Servers",
"driver": {
"type": "JSUnitServer",
"test-timeout": "900000",
"package": "ohos.rpc.test.server",
"abilityName": ".MainAbility",
"shell-timeout": "900000"
},
"kits": [
{
"test-file-name": [
"ActsRpcHapServer.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"app": {
"bundleName": "ohos.rpc.test.server",
"vendor": "rpc",
"version": {
"code": 1000000,
"name": "1.0.0"
},
"apiVersion": {
"compatible": 7,
"target": 8
}
},
"deviceConfig": {},
"module": {
"reqPermissions": [
{
"name": "ohos.permission.DISTRIBUTED_DATASYNC"
},
{
"name": "ohos.permission.GET_DISTRIBUTED_DEVICE_INFO"
},
{
"name": "ohos.permission.GET_BUNDLE_INFO"
}
],
"package": "ohos.rpc.test.server",
"name": ".MyApplication",
"mainAbility": ".MainAbility",
"deviceType": [
"tablet",
"default",
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": false
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"orientation": "unspecified",
"visible": true,
"srcPath": "MainAbility",
"name": ".MainAbility",
"srcLanguage": "js",
"icon": "$media:icon",
"description": "$string:mainability_description",
"formsEnabled": false,
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
},
{
"srcPath": "ServiceAbility",
"name": ".ServiceAbility",
"icon": "$media:icon",
"srcLanguage": "js",
"description": "$string:serviceability_description",
"type": "service",
"visible": true,
"formsEnabled": false
}
],
"js": [
{
"pages": [
"pages/index/index",
"pages/second/second"
],
"name": ".MainAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}
\ No newline at end of file
.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;
}
.btn {
width: 50%;
height: 100px;
font-size: 40px;
}
{
"string": [
{
"name": "entry_MainAbility",
"value": "RpcServer"
},
{
"name": "mainability_description",
"value": "JS_Empty Ability"
},
{
"name": "serviceability_description",
"value": "hap sample empty service"
}
]
}
\ No newline at end of file
......@@ -12,9 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// @ts-nocheck
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "deccjsunit/index"
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium"
import colorSpaceManager from '@ohos.graphics.colorSpaceManager';
export default function colorSpaceManagerTest(context, windowStage, abilityStorage) {
......@@ -93,7 +91,7 @@ export default function colorSpaceManagerTest(context, windowStage, abilityStora
done();
} catch (err) {
console.log('test enum value of ColorSpace Manager not support error ' + JSON.stringify(err));
expect(err.code == 18600001).assertTrue();
expect(err.code).assertEqual(18600001);
done();
}
})
......
......@@ -973,6 +973,9 @@ describe('webgl1Test_webgl14', function() {
var x13 = gl2.ANY_SAMPLES_PASSED_CONSERVATIVE;
expect(x13).assertEqual(36202);
var x14 = gl2.RGB10_A2;
expect(x14).assertEqual(32857);
var y1 = gl.LUMINANCE_ALPHA;
expect(y1).assertEqual(6410);
......@@ -994,6 +997,9 @@ describe('webgl1Test_webgl14', function() {
var y7 = gl.CONTEXT_LOST_WEBGL;
expect(y7).assertEqual(37442);
var y8 = gl.ACTIVE_ATTRIBUTES;
expect(y8).assertEqual(35721);
done();
});
})
......@@ -2955,6 +2955,15 @@ describe('window_test', function () {
expect(0).assertEqual(window.Orientation.UNSPECIFIED);
expect(1).assertEqual(window.Orientation.PORTRAIT);
expect(2).assertEqual(window.Orientation.LANDSCAPE);
expect(3).assertEqual(window.Orientation.PORTRAIT_INVERTED);
expect(4).assertEqual(window.Orientation.LANDSCAPE_INVERTED);
expect(5).assertEqual(window.Orientation.AUTO_ROTATION);
expect(6).assertEqual(window.Orientation.AUTO_ROTATION_PORTRAIT);
expect(7).assertEqual(window.Orientation.AUTO_ROTATION_LANDSCAPE);
expect(8).assertEqual(window.Orientation.AUTO_ROTATION_RESTRICTED);
expect(9).assertEqual(window.Orientation.AUTO_ROTATION_PORTRAIT_RESTRICTED);
expect(10).assertEqual(window.Orientation.AUTO_ROTATION_LANDSCAPE_RESTRICTED);
expect(11).assertEqual(window.Orientation.LOCKED);
done();
} catch (err) {
console.info('test enum value of windowStageEventType error ' + JSON.stringify(err));
......
......@@ -6,7 +6,7 @@
"bundle-name": "com.acts.imeability.test",
"module-name": "phone",
"shell-timeout": "600000",
"testcase-timeout": 70000
"testcase-timeout": 10000
},
"kits": [{
"test-file-name": [
......
......@@ -29,7 +29,7 @@ export default function imeAbilityTest(abilityContext) {
* beforeEach: Prerequisites at the test case level, which are executed before each test case is executed.
*/
beforeEach(function () {
console.info('beforeEach: switchInputMethod to kikakeyboard.');
console.info('====>beforeEach: switchInputMethod to kikakeyboard.');
let serviceAbilityProperty = {
packageName: "com.example.kikakeyboard",
methodId: "ServiceExtAbility",
......@@ -39,7 +39,7 @@ export default function imeAbilityTest(abilityContext) {
}
inputMethod.switchInputMethod(serviceAbilityProperty).then((data)=>{
console.info('SUB_InputMethod_IMEAbility_0001 switchInputMethod to Kika :' + data);
console.info('====>SUB_InputMethod_IMEAbility_0001 switchInputMethod to Kika :' + data);
expect(data == true).assertTrue();
})
......@@ -49,7 +49,7 @@ export default function imeAbilityTest(abilityContext) {
* afterEach: Test case-level clearance conditions, which are executed after each test case is executed.
*/
afterEach(function () {
console.info('afterEach: Test case-level clearance conditions is executed.');
console.info('====>afterEach: Test case-level clearance conditions is executed.');
});
/**
......@@ -60,7 +60,7 @@ export default function imeAbilityTest(abilityContext) {
* @tc.level : Level 1
*/
it('SUB_InputMethod_IMEAbility_0001', 0, async function (done) {
console.info('----------SUB_InputMethod_IMEAbility_0001 start-------------');
console.info('====>----------SUB_InputMethod_IMEAbility_0001 start-------------');
let imExtAbilityProperty = {
packageName : "com.acts.imeability.test",
methodId : "com.acts.imeability.test.ImExtAbility",
......@@ -70,11 +70,11 @@ export default function imeAbilityTest(abilityContext) {
}
inputMethod.switchInputMethod(imExtAbilityProperty).then((data)=>{
console.info('SUB_InputMethod_IMEAbility_0004 switchInputMethod to IME :' + data);
console.info('====>SUB_InputMethod_IMEAbility_0004 switchInputMethod to IME :' + data);
expect(data == true).assertTrue();
});
sleep(Date.now(), 3000);
console.info('----------SUB_InputMethod_IMEAbility_0001 end-------------');
console.info('====>----------SUB_InputMethod_IMEAbility_0001 end-------------');
done();
})
......@@ -87,7 +87,7 @@ export default function imeAbilityTest(abilityContext) {
* @tc.level : Level 1
*/
it('SUB_InputMethod_IMEAbility_0002', 0, async function (done) {
console.info('-----------SUB_InputMethod_IMEAbility_0002 start-------------');
console.info('====>-----------SUB_InputMethod_IMEAbility_0002 start-------------');
let imExtAbilityProperty = {
packageName : "com.acts.imeability.test",
......@@ -98,11 +98,11 @@ export default function imeAbilityTest(abilityContext) {
}
inputMethod.switchInputMethod(imExtAbilityProperty).then((data)=>{
console.info('SUB_InputMethod_IMEAbility_0004 switchInputMethod to IME :' + data);
console.info('====>SUB_InputMethod_IMEAbility_0004 switchInputMethod to IME :' + data);
expect(data == true).assertTrue();
});
sleep(Date.now(), 2500);
console.info('-----------SUB_InputMethod_IMEAbility_0002 end-------------');
console.info('====>-----------SUB_InputMethod_IMEAbility_0002 end-------------');
done();
})
})
......
......@@ -34,9 +34,9 @@ export default class Utils {
static getComponentRect(key) {
let strJson = getInspectorByKey(key);
let obj = JSON.parse(strJson);
console.info("[getInspectorByKey] current component obj is: " + JSON.stringify(obj));
console.info("====>[getInspectorByKey] current component obj is: " + JSON.stringify(obj));
let rectInfo = JSON.parse('[' + obj.$rect + ']')
console.info("[getInspectorByKey] rectInfo is: " + rectInfo);
console.info("====>[getInspectorByKey] rectInfo is: " + rectInfo);
this.rect_left = JSON.parse('[' + rectInfo[0] + ']')[0]
this.rect_top = JSON.parse('[' + rectInfo[0] + ']')[1]
this.rect_right = JSON.parse('[' + rectInfo[1] + ']')[0]
......@@ -47,12 +47,12 @@ export default class Utils {
}
static async swipe(downX, downY, upX, upY, steps) {
console.info('start to swipe')
console.info('====>start to swipe')
this.drags(downX, downY, upX, upY, steps, false)
}
static async drag(downX, downY, upX, upY, steps) {
console.info('start to drag')
console.info('====>start to drag')
this.drags(downX, downY, upX, upY, steps, true)
}
......@@ -70,16 +70,16 @@ export default class Utils {
}
xStep = (upX - downX) / swipeSteps;
yStep = (upY - downY) / swipeSteps;
console.info('move step is: ' + 'xStep: ' + xStep + ' yStep: ' + yStep)
console.info('====>move step is: ' + 'xStep: ' + xStep + ' yStep: ' + yStep)
let downPonit: TouchObject = {
id: 1,
x: downX,
y: downY,
type: TouchType.Down,
}
console.info('down touch started: ' + JSON.stringify(downPonit))
console.info('====>down touch started: ' + JSON.stringify(downPonit))
sendTouchEvent(downPonit);
console.info('start to move')
console.info('====>start to move')
if (drag) {
await this.sleep(500)
}
......@@ -90,14 +90,14 @@ export default class Utils {
y: downY + (yStep * i),
type: TouchType.Move
}
console.info('move touch started: ' + JSON.stringify(movePoint))
console.info('====>move touch started: ' + JSON.stringify(movePoint))
ret = sendTouchEvent(movePoint)
if (ret == false) {
break;
}
await this.sleep(5)
}
console.info('start to up')
console.info('====>start to up')
if (drag) {
await this.sleep(100)
}
......@@ -107,7 +107,7 @@ export default class Utils {
y: upY,
type: TouchType.Up,
}
console.info('up touch started: ' + JSON.stringify(upPoint))
console.info('====>up touch started: ' + JSON.stringify(upPoint))
sendTouchEvent(upPoint)
await this.sleep(500)
}
......
......@@ -17,12 +17,12 @@ import inputMethod from '@ohos.inputmethod';
export default function inputMethodJSUnit() {
describe('appInfoTest_input_2', function () {
console.info("************* settings Test start*************");
console.info("====>************* settings Test start*************");
it('inputmethoh_test_001', 0, async function (done) {
let inputMethodSetting = inputMethod.getInputMethodSetting();
console.info("inputmethoh_test_001 result:" + JSON.stringify(inputMethodSetting));
console.info("====>inputmethoh_test_001 result:" + JSON.stringify(inputMethodSetting));
inputMethodSetting.listInputMethod((arr) => {
console.info("appInfoTest_input_2 listInputMethod result---" + JSON.stringify(arr));
console.info("====>appInfoTest_input_2 listInputMethod result---" + JSON.stringify(arr));
expect(1==1).assertTrue();
});
done();
......@@ -30,40 +30,40 @@ export default function inputMethodJSUnit() {
it('inputmethoh_test_002', 0, async function (done) {
let inputMethodSetting = inputMethod.getInputMethodSetting();
console.info("inputmethoh_test_002 result:" + JSON.stringify(inputMethodSetting));
console.info("====>inputmethoh_test_002 result:" + JSON.stringify(inputMethodSetting));
inputMethodSetting.listInputMethod().then(inputMethodProperty => {
if (inputMethodProperty.length > 0){
let obj = inputMethodProperty[0]
console.info("inputmethoh_test_002 listInputMethod obj---" + JSON.stringify(obj));
console.info("====>inputmethoh_test_002 listInputMethod obj---" + JSON.stringify(obj));
expect(obj.packageName != null).assertTrue();
expect(obj.methodId != null).assertTrue();
}else{
console.info("inputmethoh_test_002 listInputMethod is null");
console.info("====>inputmethoh_test_002 listInputMethod is null");
expect().assertFail()
}
}).catch(err => {
console.info("inputmethoh_test_002 listInputMethod is err: " + JSON.stringify(err));
console.info("====>inputmethoh_test_002 listInputMethod is err: " + JSON.stringify(err));
});
done();
});
it('inputmethoh_test_003', 0, async function (done) {
let inputMethodSetting = inputMethod.getInputMethodSetting();
console.info("inputmethoh_test_003 result:" + JSON.stringify(inputMethodSetting));
console.info("====>inputmethoh_test_003 result:" + JSON.stringify(inputMethodSetting));
inputMethodSetting.displayOptionalInputMethod(() => {
console.info("inputmethoh_test_003 displayOptionalInputMethod---");
console.info("====>inputmethoh_test_003 displayOptionalInputMethod---");
});
done();
});
it('inputmethoh_test_004', 0, async function (done) {
let inputMethodSetting = inputMethod.getInputMethodSetting();
console.info("inputmethoh_test_004 result:" + JSON.stringify(inputMethodSetting));
console.info("====>inputmethoh_test_004 result:" + JSON.stringify(inputMethodSetting));
inputMethodSetting.displayOptionalInputMethod().then(() => {
console.info("inputmethoh_test_004 displayOptionalInputMethod is called");
console.info("====>inputmethoh_test_004 displayOptionalInputMethod is called");
expect(true).assertTrue()
}).catch(err => {
console.info("inputmethoh_test_004 displayOptionalInputMethod is err: " + JSON.stringify(err));
console.info("====>inputmethoh_test_004 displayOptionalInputMethod is err: " + JSON.stringify(err));
expect().assertFail()
});
done();
......@@ -71,24 +71,24 @@ export default function inputMethodJSUnit() {
it('inputmethoh_test_005', 0, async function (done) {
let inputMethodCtrl = inputMethod.getInputMethodController();
console.info("inputmethoh_test_005 result:" + JSON.stringify(inputMethodCtrl));
console.info("====>inputmethoh_test_005 result:" + JSON.stringify(inputMethodCtrl));
inputMethodCtrl.stopInput((res) => {
console.info("inputmethoh_test_005 stopInput result----" + res);
console.info("====>inputmethoh_test_005 stopInput result----" + res);
});
done();
});
it('inputmethoh_test_006', 0, async function (done) {
let inputMethodCtrl = inputMethod.getInputMethodController();
console.info("inputmethoh_test_006 result:" + JSON.stringify(inputMethodCtrl));
inputMethodCtrl.stopInput().then(data => {
console.info("inputmethoh_test_006 stopInput result----" + data);
expect(data == true).assertTrue();
}).catch(err => {
console.info("inputmethoh_test_006 stopInput is err: " + JSON.stringify(err));
console.info("====>inputmethoh_test_006 result:" + JSON.stringify(inputMethodCtrl));
inputMethodCtrl.stopInput().then(() => {
expect().assertFail();
done();
}).catch((err) => {
console.info("====>inputmethoh_test_006 stopInput is err: " + JSON.stringify(err));
expect().assertEqual();
done();
});
done();
});
/*
......@@ -97,11 +97,11 @@ export default function inputMethodJSUnit() {
* @tc.desc: Verify Max_ TYPE_ NUM
*/
it('inputmethod_test_MAX_TYPE_NUM_001', 0, async function (done) {
console.info("************* inputmethod_test_MAX_TYPE_NUM_001 Test start*************");
console.info("====>************* inputmethod_test_MAX_TYPE_NUM_001 Test start*************");
let inputMethodSetting = inputMethod.MAX_TYPE_NUM;
console.info("inputmethod_test_001 result:" + inputMethodSetting);
expect(inputMethodSetting != null).assertTrue();
console.info("************* inputmethod_test_MAX_TYPE_NUM_001 Test end*************");
console.info("====>inputmethod_test_001 result:" + inputMethodSetting);
expect(inputMethodSetting !== null).assertTrue();
console.info("====>************* inputmethod_test_MAX_TYPE_NUM_001 Test end*************");
done();
});
......@@ -112,7 +112,7 @@ export default function inputMethodJSUnit() {
* @tc.level 2
*/
it('inputmethod_test_switchInputMethod_001', 0, async function (done) {
console.info("************* inputmethod_test_switchInputMethod_001 Test start*************");
console.info("====>************* inputmethod_test_switchInputMethod_001 Test start*************");
let inputMethodProperty = {
packageName: "com.example.kikakeyboard",
methodId: "ServiceExtAbility",
......@@ -121,13 +121,13 @@ export default function inputMethodJSUnit() {
extra:{}
}
inputMethod.switchInputMethod(inputMethodProperty).then(data => {
console.info("inputmethod_test_switchInputMethod_001 data:" + data)
console.info("====>inputmethod_test_switchInputMethod_001 data:" + data)
expect(data == true).assertTrue();
}).catch( err=> {
console.info("inputmethod_test_switchInputMethod_001 err:" + err)
console.info("====>inputmethod_test_switchInputMethod_001 err:" + err)
expect().assertFail();
})
console.info("************* inputmethod_test_switchInputMethod_001 Test end*************");
console.info("====>************* inputmethod_test_switchInputMethod_001 Test end*************");
done();
});
......@@ -138,7 +138,7 @@ export default function inputMethodJSUnit() {
* @tc.level 2
*/
it('inputmethod_test_switchInputMethod_002', 0, async function (done) {
console.info("************* inputmethod_test_switchInputMethod_002 Test start*************");
console.info("====>************* inputmethod_test_switchInputMethod_002 Test start*************");
let inputMethodProperty = {
packageName: "com.example.kikakeyboard",
methodId: "ServiceExtAbility",
......@@ -148,13 +148,13 @@ export default function inputMethodJSUnit() {
}
inputMethod.switchInputMethod(inputMethodProperty, (err, data)=>{
if(err){
console.info("inputmethod_test_switchInputMethod_002 error:" + err);
console.info("====>inputmethod_test_switchInputMethod_002 error:" + err);
expect().assertFail();
}
console.info("inputmethod_test_switchInputMethod_002 data:" + data)
console.info("====>inputmethod_test_switchInputMethod_002 data:" + data)
expect(data == true).assertTrue();
});
console.info("************* inputmethod_test_switchInputMethod_002 Test end*************");
console.info("====>************* inputmethod_test_switchInputMethod_002 Test end*************");
done();
});
......@@ -166,17 +166,16 @@ export default function inputMethodJSUnit() {
*/
it('inputmethod_test_showSoftKeyboard_001', 0, async function (done) {
let inputMethodCtrl = inputMethod.getInputMethodController()
inputMethodCtrl.showSoftKeyboard((err, data)=>{
if(data == undefined){
console.info("showSoftKeyboard callbace success" );
expect(true).assertTrue();
}else{
console.info('showSoftKeyboard callbace failed : ' + JSON.stringify(err))
expect().assertFail();
}
});
console.info("************* inputmethod_test_showSoftKeyboard_001 Test end*************");
done();
try{
inputMethodCtrl.showSoftKeyboard((err)=>{
expect(err.code).assertEqual('12800003')
console.info("====>************* inputmethod_test_showSoftKeyboard_001 Test end*************");
done();
});
}catch(err){
expect().assertFail()
done();
}
});
/*
......@@ -187,15 +186,15 @@ export default function inputMethodJSUnit() {
*/
it('inputmethod_test_showSoftKeyboard_002', 0, async function (done) {
let inputMethodCtrl = inputMethod.getInputMethodController()
inputMethodCtrl.showSoftKeyboard().then((data) =>{
console.info("showSoftKeyboard promise success" );
expect(true).assertTrue();
inputMethodCtrl.showSoftKeyboard().then(() =>{
expect().assertFail()
done();
}).catch((err) => {
console.info('showSoftKeyboard promise failed : ' + JSON.stringify(err))
expect().assertFail();
console.info('====>showSoftKeyboard promise failed : ' + JSON.stringify(err))
expect(err.code).assertEqual('12800003')
console.info("====>************* inputmethod_test_showSoftKeyboard_002 Test end*************");
done();
})
console.info("************* inputmethod_test_showSoftKeyboard_002 Test end*************");
done();
});
/*
......@@ -206,17 +205,17 @@ export default function inputMethodJSUnit() {
*/
it('inputmethod_test_hideSoftKeyboard_001', 0, async function (done) {
let inputMethodCtrl = inputMethod.getInputMethodController()
inputMethodCtrl.hideSoftKeyboard((err, data)=>{
if(data == undefined){
console.info("hideSoftKeyboard callbace success" );
expect(true).assertTrue();
}else{
console.info('hideSoftKeyboard callbace failed : ' + JSON.stringify(err))
expect().assertFail();
}
});
console.info("************* inputmethod_test_hideSoftKeyboard_001 Test end*************");
done();
try{
inputMethodCtrl.hideSoftKeyboard((err)=>{
console.info('====>hideSoftKeyboard callbacek failed : ' + JSON.stringify(err))
expect(err.code).assertEqual('12800003')
console.info("====>************* inputmethod_test_hideSoftKeyboard_001 Test end*************");
done();
})
}catch(err){
expect().assertFail();
done();
}
});
/*
......@@ -227,15 +226,15 @@ export default function inputMethodJSUnit() {
*/
it('inputmethod_test_hideSoftKeyboard_002', 0, async function (done) {
let inputMethodCtrl = inputMethod.getInputMethodController()
inputMethodCtrl.hideSoftKeyboard().then((data) =>{
console.info("hideSoftKeyboard promise success" );
expect(true).assertTrue();
}).catch((err) => {
console.info('hideSoftKeyboard promise failed : ' + JSON.stringify(err))
inputMethodCtrl.hideSoftKeyboard().then(() =>{
expect().assertFail();
done();
}).catch((err) => {
console.info('====>hideSoftKeyboard promise failed : ' + JSON.stringify(err))
expect(err.code).assertEqual('12800003');
console.info("====>************* inputmethod_test_hideSoftKeyboard_002 Test end*************");
done();
})
console.info("************* inputmethod_test_hideSoftKeyboard_002 Test end*************");
done();
});
/*
......@@ -246,12 +245,12 @@ export default function inputMethodJSUnit() {
*/
it('inputmethod_test_getCurrentInputMethod_001', 0, async function (done) {
let currentIme = inputMethod.getCurrentInputMethod();
console.info("inputmethod_test_getCurrentInputMethod_001 currentIme---" + JSON.stringify(currentIme));
console.info("====>inputmethod_test_getCurrentInputMethod_001 currentIme---" + JSON.stringify(currentIme));
console.info(currentIme.packageName);
console.info(currentIme.methodId);
expect(currentIme.packageName != null).assertTrue();
expect(currentIme.methodId != null).assertTrue();
console.info("************* inputmethod_test_getCurrentInputMethod_001 Test end*************");
expect(currentIme.packageName !== null).assertTrue();
expect(currentIme.methodId !== null).assertTrue();
console.info("====>************* inputmethod_test_getCurrentInputMethod_001 Test end*************");
done();
});
......@@ -264,13 +263,13 @@ export default function inputMethodJSUnit() {
*/
it('inputmethod_test_getInputMethods_001', 0, async function (done) {
let inputMethodSetting = inputMethod.getInputMethodSetting();
console.info("inputmethod_test_getInputMethods_001 result:" + JSON.stringify(inputMethodSetting));
console.info("====>inputmethod_test_getInputMethods_001 result:" + JSON.stringify(inputMethodSetting));
inputMethodSetting.getInputMethods(true, (err, arr) => {
if (err) {
console.error("inputmethod_test_getInputMethods_001 failed because: " + JSON.stringify(err));
expect().assertFail();
};
console.info("inputmethod_test_getInputMethods_001 listInputMethod result---" + JSON.stringify(arr));
console.info("====>inputmethod_test_getInputMethods_001 listInputMethod result---" + JSON.stringify(arr));
expect(arr != null).assertTrue();
});
done();
......@@ -285,13 +284,13 @@ export default function inputMethodJSUnit() {
*/
it('inputmethod_test_getInputMethods_002', 0, async function (done) {
let inputMethodSetting = inputMethod.getInputMethodSetting();
console.info("inputmethod_test_getInputMethods_002 result:" + JSON.stringify(inputMethodSetting));
console.info("====>inputmethod_test_getInputMethods_002 result:" + JSON.stringify(inputMethodSetting));
inputMethodSetting.getInputMethods(false, (err, arr) => {
if (err) {
console.error("inputmethod_test_getInputMethods_002 failed because: " + JSON.stringify(err));
expect().assertFail();
};
console.info("inputmethod_test_getInputMethods_002 listInputMethod result---" + JSON.stringify(arr));
console.info("====>inputmethod_test_getInputMethods_002 listInputMethod result---" + JSON.stringify(arr));
expect(arr != null).assertTrue();
});
done();
......
......@@ -18,7 +18,7 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "
export default function requestSystemJSUnit() {
describe('requestSystemJSUnit', function () {
console.info('****************start requestSystemTest*****************')
console.info('====>****************start requestSystemTest*****************')
/**
* @tc.name: ohos.SUB_REQUESTSYSTEM_UPLOAD_API_0001
......@@ -28,7 +28,7 @@ export default function requestSystemJSUnit() {
* @tc.level: Level 1
*/
it('SUB_REQUESTSYSTEM_UPLOAD_API_0001', 0, async function (done) {
console.info("-----------------------SUB_REQUESTSYSTEM_UPLOAD_API_0001 start-----------------------");
console.info("====>-----------------------SUB_REQUESTSYSTEM_UPLOAD_API_0001 start-----------------------");
let UploadResponse = {
code: 200,
data: '',
......@@ -52,23 +52,23 @@ export default function requestSystemJSUnit() {
},
],
success: function(UploadResponse) {
console.info('SUB_REQUESTSYSTEM_UPLOAD_API_0001 upload success, code:' + UploadResponse.code);
console.info('====>SUB_REQUESTSYSTEM_UPLOAD_API_0001 upload success, code:' + UploadResponse.code);
},
fail: function(data, code) {
console.info('SUB_REQUESTSYSTEM_UPLOAD_API_0001 upload fail');
console.info('====>SUB_REQUESTSYSTEM_UPLOAD_API_0001 upload fail');
},
complete: function (){
console.info('SUB_REQUESTSYSTEM_UPLOAD_API_0001 upload complete');
console.info('====>SUB_REQUESTSYSTEM_UPLOAD_API_0001 upload complete');
}
}
try{
let result = request.upload(UploadRequestOptions);
console.info('SUB_REQUESTSYSTEM_UPLOAD_API_0001 upload err:' + result);
console.info('====>SUB_REQUESTSYSTEM_UPLOAD_API_0001 upload err:' + result);
expect(true).assertEqual(true);
}catch(err){
console.info('SUB_REQUESTSYSTEM_UPLOAD_API_0001 upload err:' + err);
console.info('====>SUB_REQUESTSYSTEM_UPLOAD_API_0001 upload err:' + err);
}
console.info("-----------------------SUB_REQUESTSYSTEM_UPLOAD_API_0001 end-----------------------");
console.info("====>-----------------------SUB_REQUESTSYSTEM_UPLOAD_API_0001 end-----------------------");
done();
});
......@@ -80,7 +80,7 @@ export default function requestSystemJSUnit() {
* @tc.level: Level 1
*/
it('SUB_REQUESTSYSTEM_DOWNLOAD_API_0001', 0, async function (done) {
console.info("-----------------------SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 start-----------------------");
console.info("====>-----------------------SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 start-----------------------");
let DownloadResponse = {
token: "Hm_lpvt_1d6c34c1bc067f5746a5fca18d1c24ab"
}
......@@ -91,23 +91,23 @@ export default function requestSystemJSUnit() {
header: '',
description: 'this is requeSystem download response',
success: function(DownloadResponse) {
console.info('SUB_REQUESTSYSTEM_DOWNLOAD_API_0001call success callback success: ' + DownloadResponse.token);
console.info('====>SUB_REQUESTSYSTEM_DOWNLOAD_API_0001call success callback success: ' + DownloadResponse.token);
},
fail: function(data, code) {
console.info('SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 handling fail');
console.info('====>SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 handling fail');
},
complete: function (){
console.info('SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 download complete');
console.info('====>SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 download complete');
}
}
try{
let result = request.download(DownloadRequestOptions);
console.info('SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 upload err:' + result);
console.info('====>SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 upload err:' + result);
expect(result == null).assertEqual(true);
}catch(err){
console.info('SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 download complete' + err);
console.info('====>SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 download complete' + err);
}
console.info("-----------------------SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 end-----------------------");
console.info("====>-----------------------SUB_REQUESTSYSTEM_DOWNLOAD_API_0001 end-----------------------");
done();
});
......@@ -119,27 +119,27 @@ export default function requestSystemJSUnit() {
* @tc.level: Level 1
*/
it('SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001', 0, async function (done) {
console.info("-----------------------SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 start-----------------------");
console.info("====>-----------------------SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 start-----------------------");
let OnDownloadCompleteResponse = {
uri: "http://www.path.com"
}
let OnDownloadCompleteOptions = {
token: 'token-index',
success: function(OnDownloadCompleteResponse) {
console.info('SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 download success,uri:'
console.info('====>SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 download success,uri:'
+ OnDownloadCompleteResponse.uri);
},
fail: function(data, code) {
console.info('SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 download fail');
console.info('====>SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 download fail');
},
complete: function (){
console.info('SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 download complete');
console.info('====>SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 download complete');
}
}
let result = request.onDownloadComplete(OnDownloadCompleteOptions);
console.info('SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 upload err:' + result);
console.info('====>SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 upload err:' + result);
expect(result == null).assertEqual(true);
console.info("-----------------------SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 end-----------------------");
console.info("====>-----------------------SUB_REQUESTSYSTEM_DOWNLOADCOMPLETE_API_0001 end-----------------------");
done();
});
})
......
......@@ -18,6 +18,7 @@ group("storage") {
deps = [
"storagefileioerrorjstest:storagefileioerror_js_test",
"storagefileiojstest:storagefileio_js_test",
"storagefileiov9jstest:storagefileiov9_js_test",
"storagefilejstest:storagefile_js_test",
"storagesecuritylabeljstest:storagesecuritylabel_js_test",
"storagestatfsjstest:storagestatfs_js_test",
......
# Copyright (C) 2021 Huawei Device Co., Ltd.
# 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
......@@ -10,25 +10,26 @@
# 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_hap_assist_suite("ActsRpcJsServer") {
ohos_js_hap_suite("storagefileiov9_js_test") {
hap_profile = "./src/main/config.json"
deps = [
":rpc_js_assets",
":rpc_js_resources",
":storagefileiov9_js_assets",
":storagefileiov9_js_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsRpcHapServer"
subsystem_name = "communication"
part_name = "ipc"
hap_name = "ActsStorageFileIoV9JSTest"
subsystem_name = "filemanagement"
part_name = "file_api"
}
ohos_js_assets("rpc_js_assets") {
source_dir = "./src/main/js"
ohos_js_assets("storagefileiov9_js_assets") {
js2abc = true
hap_profile = "./src/main/config.json"
source_dir = "./src/main/js"
}
ohos_resources("rpc_js_resources") {
ohos_resources("storagefileiov9_js_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
}
{
"description": "Configuration for storage filefs Tests",
"driver": {
"type": "OHJSUnitTest",
"test-timeout": "600000",
"shell-timeout": "600000",
"bundle-name": "ohos.acts.storage.fileiov9",
"package-name": "ohos.acts.storage.fileiov9"
},
"kits": [
{
"test-file-name": ["ActsStorageFileIoV9JSTest.hap"],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
\ No newline at end of file
{
"app": {
"bundleName": "ohos.acts.storage.fileiov9",
"vendor": "example",
"version": {
"code": 1000000,
"name": "1.0.0"
},
"apiVersion": {
"compatible": 4,
"target": 5
}
},
"deviceConfig": {},
"module": {
"package": "ohos.acts.storage.fileiov9",
"name": ".entry",
"deviceType": [
"default",
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": true
},
"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"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
},
{
"pages": [
"pages/index/index"
],
"name": ".TestAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
],
"testRunner": {
"name": "OpenHarmonyTestRunner",
"srcPath": "TestRunner"
},
"mainAbility": ".MainAbility",
"srcPath": ""
}
}
\ 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("Application onCreate");
},
onDestroy() {
console.info("Application onDestroy");
}
};
/*
* 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('ohos.acts.storage.fileio onCreate');
},
onDestroy() {
console.info('ohos.acts.storage.fileio onDestroy');
}
};
{
"strings": {
"hello": "Hello",
"world": "Test"
}
}
\ 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;
}
.title {
font-size: 100px;
}
<div class="container" onswipe="touchMove">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
<input class="btn" type="button" value="{{ $t('strings.next') }}" onclick="onclick"></input>
</div>
<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 router from '@system.router'
export default {
data: {
title: 'World'
},
onclick: function () {
router.replace({
uri: "pages/index/index"
})
}
}
/*
* 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 app from '@system.app'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: ''
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
},
onReady() {
},
}
<div class="container">
<text class="title">
{{ $t('strings.page') }}
</text>
<input class="btn" type="button" value="{{ $t('strings.back') }}" onclick="onclick"></input>
</div>
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册