提交 f779536c 编写于 作者: Y yaocui

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

......@@ -61,7 +61,7 @@ var test2200ReleaseFlag = '';
function testCall(data) {
let recvSequence = new MySequenceable(0, '', '');
console.log('======>SystemAppCalleeA MainAbility on testCall <======')
data.readSequenceable(recvSequence);
data.readParcelable(recvSequence);
var result = recvSequence.str + 'processed';
var commonEventData = {
code: 0,
......@@ -82,7 +82,7 @@ function testCall(data) {
function testCallWithResult(data) {
let recvSequence = new MySequenceable(0, '', '');
console.log('======>SystemAppCalleeA MainAbility on testCall <======')
data.readSequenceable(recvSequence);
data.readParcelable(recvSequence);
let result = recvSequence.str + 'processed';
recvSequence.setMySequence(recvSequence.num, recvSequence.str, result);
......@@ -94,7 +94,7 @@ export default class MainAbility extends Ability {
test2200(data) {
console.log("SystemAppCalleeA MainAbility test2200");
let recvData = new MySequenceable(0, '', '');
data.readSequenceable(recvData);
data.readParcelable(recvData);
let want = {
bundleName: "com.example.systemappcalleea",
......@@ -106,7 +106,7 @@ export default class MainAbility extends Ability {
let param = new MySequenceable(recvData.num + 1, recvData.str + "SystemAppCalleeA", '');
caller.onRelease(test2200ReleaseCallback);
caller.callWithResult('test2200', param).then((data2) => {
data2.readSequenceable(resultData);
data2.readParcelable(resultData);
caller.release();
for (let start=Date.now(); Date.now() - start <= 200;);
resultData.result = test2200ReleaseFlag;
......
......@@ -50,7 +50,7 @@ class MySequenceable {
function testCall(data) {
let recvSequence = new MySequenceable(0, '', '');
console.log('======>SystemAppCalleeA MainAbility on testCall <======')
data.readSequenceable(recvSequence);
data.readParcelable(recvSequence);
var result = recvSequence.str + 'processed';
var commonEventData = {
code: 0,
......@@ -71,7 +71,7 @@ function testCall(data) {
function testCallWithResult(data) {
let recvSequence = new MySequenceable(0, '', '');
console.log('======>SystemAppCalleeA MainAbility on testCall <======')
data.readSequenceable(recvSequence);
data.readParcelable(recvSequence);
let result = recvSequence.str + 'processed';
recvSequence.setMySequence(recvSequence.num, recvSequence.str, result);
......@@ -82,7 +82,7 @@ export default class SecondAbility extends Ability {
test2200(data) {
console.log("SystemAppCalleeA SecondAbility test2200");
let recvData = new MySequenceable(0, '', '');
data.readSequenceable(recvData);
data.readParcelable(recvData);
let result = new MySequenceable(recvData.num + 1, recvData.str + "SystemAppCalleeA", '');
return result;
}
......
......@@ -50,7 +50,7 @@ class MySequenceable {
function testCall(data) {
let recvSequence = new MySequenceable(0, '', '');
console.log('======>SystemAppCallerA MainAbility on testCall <======')
data.readSequenceable(recvSequence);
data.readParcelable(recvSequence);
var result = recvSequence.str + 'processed';
var commonEventData = {
code: 0,
......@@ -71,7 +71,7 @@ function testCall(data) {
function testCallWithResult(data) {
let recvSequence = new MySequenceable(0, '', '');
console.log('======>SystemAppCallerA MainAbility on testCall <======')
data.readSequenceable(recvSequence);
data.readParcelable(recvSequence);
let result = recvSequence.str + 'processed';
recvSequence.setMySequence(recvSequence.num, recvSequence.str, result);
......
......@@ -114,7 +114,7 @@ function startNext(context) {
function testCall(data) {
let recvSequence = new MySequenceable(0, '', '');
console.log('======>SystemAppCallerA MainAbility on testCall <======')
data.readSequenceable(recvSequence);
data.readParcelable(recvSequence);
var result = recvSequence.str + 'processed';
var commonEventData = {
code: 0,
......@@ -134,7 +134,7 @@ function testCall(data) {
function testCallWithResult(data) {
let recvSequence = new MySequenceable(0, '', '');
console.log('======>SystemAppCallerA MainAbility on testCall <======')
data.readSequenceable(recvSequence);
data.readParcelable(recvSequence);
let result = recvSequence.str + 'processed';
recvSequence.setMySequence(recvSequence.num, recvSequence.str, result);
......
......@@ -50,7 +50,7 @@ class MySequenceable {
function testCall(data) {
let recvSequence = new MySequenceable(0, '', '');
console.log('======>SystemAppCallerA SecondAbility on testCall <======')
data.readSequenceable(recvSequence);
data.readParcelable(recvSequence);
var result = recvSequence.str + 'processed';
var commonEventData = {
code: 0,
......@@ -70,7 +70,7 @@ function testCall(data) {
function testCallWithResult(data) {
let recvSequence = new MySequenceable(0, '', '');
console.log('======>SystemAppCallerA SecondAbility on testCall <======')
data.readSequenceable(recvSequence);
data.readParcelable(recvSequence);
let result = recvSequence.str + 'processed';
recvSequence.setMySequence(recvSequence.num, recvSequence.str, result);
......
......@@ -50,7 +50,7 @@ class MySequenceable {
function testCall(data) {
let recvSequence = new MySequenceable(0, '', '');
console.log('======>SystemAppCallerA ThirdAbility on testCall <======')
data.readSequenceable(recvSequence);
data.readParcelable(recvSequence);
var result = recvSequence.str + 'processed';
var commonEventData = {
code: 0,
......@@ -70,7 +70,7 @@ function testCall(data) {
function testCallWithResult(data) {
let recvSequence = new MySequenceable(0, '', '');
console.log('======>SystemAppCallerA ThirdAbility on testCall <======')
data.readSequenceable(recvSequence);
data.readParcelable(recvSequence);
let result = recvSequence.str + 'processed';
recvSequence.setMySequence(recvSequence.num, recvSequence.str, result);
......
......@@ -50,7 +50,7 @@ export default class MainAbility extends Ability {
test2100(data) {
console.log("SystemCallTest MainAbility test2100 begin");
let recvData = new MySequenceable(0, '', '');
data.readSequenceable(recvData);
data.readParcelable(recvData);
return new MySequenceable(recvData.num + 1, recvData.str + "Main", recvData.result);
}
......
......@@ -74,7 +74,7 @@ class MySequenceable {
function testCall(data) {
let recvSequence = new MySequenceable(0, '', '');
console.log('======>SystemCallTest SecondAbility on testCall <======')
data.readSequenceable(recvSequence);
data.readParcelable(recvSequence);
var result = recvSequence.str + 'processed';
var commonEventData = {
code: 0,
......@@ -94,7 +94,7 @@ function testCall(data) {
function testCall2(data) {
let recvSequence = new MySequenceable(0, '', '');
console.log('======>SystemCallTest SecondAbility on testCall <======')
data.readSequenceable(recvSequence);
data.readParcelable(recvSequence);
var result = recvSequence.str + 'processed2';
var commonEventData = {
code: 0,
......@@ -114,7 +114,7 @@ function testCall2(data) {
function testCallWithResult(data) {
let recvSequence = new MySequenceable(0, '', '');
console.log('======>SystemCallTest SecondAbility on testCall <======')
data.readSequenceable(recvSequence);
data.readParcelable(recvSequence);
let result = recvSequence.str + 'processed';
recvSequence.setMySequence(recvSequence.num, recvSequence.str, result);
......@@ -132,7 +132,7 @@ export default class SecondAbility extends Ability {
test2100(data) {
let recvData = new MySequenceable(0, '', '');
data.readSequenceable(recvData);
data.readParcelable(recvData);
let want = {
bundleName: "com.example.systemcalltest",
abilityName: "com.example.systemcalltest.MainAbility",
......@@ -144,7 +144,7 @@ export default class SecondAbility extends Ability {
caller.onRelease(test2100ReleaseCallback);
for (let start=Date.now(); Date.now() - start <= 200;);
caller.callWithResult('test2100', param).then((data2) => {
data2.readSequenceable(resultData);
data2.readParcelable(resultData);
caller.release();
for (let start=Date.now(); Date.now() - start <= 200;);
resultData.result = test2100ReleaseFlag;
......@@ -166,13 +166,13 @@ export default class SecondAbility extends Ability {
testOff(data) {
let recvSequence = new MySequenceable(0, '', '');
data.readSequenceable(recvSequence);
data.readParcelable(recvSequence);
return recvSequence;
}
stressMethod(data) {
let recvData = new MySequenceable(0, '', '');
data.readSequenceable(recvData);
data.readParcelable(recvData);
console.log('SystemCallTest SecondAbility stressMethod caller ' + recvData.str);
if (recvData.str == callerA) {
callSeqA.push(recvData.num);
......@@ -206,7 +206,7 @@ export default class SecondAbility extends Ability {
loopMethod(data) {
let recvData = new MySequenceable(0, '', '');
data.readSequenceable(recvData);
data.readParcelable(recvData);
return new MySequenceable(recvData.num + 1, recvData.str, '');
}
......
......@@ -183,7 +183,7 @@ export default function abilityTest() {
caller.callWithResult('testCallWithResult', param).then((data) => {
console.log('ACTS_CommonComponent_Call_0400 call success');
var result = new MySequenceable(0, '', '');
data.readSequenceable(result);
data.readParcelable(result);
expect(result.num).assertEqual(400);
expect(result.str).assertEqual('ACTS_CommonComponent_Call_0400');
expect(result.result).assertEqual('ACTS_CommonComponent_Call_0400processed');
......@@ -282,7 +282,7 @@ export default function abilityTest() {
caller2.callWithResult('testCallWithResult', param).then((data) => {
console.log('ACTS_CommonComponent_Call_0600 call success');
var result = new MySequenceable(0, '', '');
data.readSequenceable(result);
data.readParcelable(result);
expect(result.num).assertEqual(600);
expect(result.str).assertEqual('ACTS_CommonComponent_Call_0600');
expect(result.result).assertEqual('ACTS_CommonComponent_Call_0600processed');
......@@ -392,7 +392,7 @@ export default function abilityTest() {
caller.callWithResult('testCallWithResult', param).then((data) => {
console.log('ACTS_CommonComponent_Call_0800 call success');
var result = new MySequenceable(0, '', '');
data.readSequenceable(result);
data.readParcelable(result);
expect(result.num).assertEqual(800);
expect(result.str).assertEqual('ACTS_CommonComponent_Call_0800');
expect(result.result).assertEqual('ACTS_CommonComponent_Call_0800processed');
......@@ -492,7 +492,7 @@ export default function abilityTest() {
caller.callWithResult('testCallWithResult', param).then((data) => {
console.log('ACTS_CommonComponent_Call_1000 call success');
var result = new MySequenceable(0, '', '');
data.readSequenceable(result);
data.readParcelable(result);
expect(result.num).assertEqual(1000);
expect(result.str).assertEqual('ACTS_CommonComponent_Call_1000');
expect(result.result).assertEqual('ACTS_CommonComponent_Call_1000processed');
......
......@@ -50,7 +50,7 @@ let callSeq = "";
export default class MainAbility extends Ability {
test2300(data) {
let recvData = new MySequenceable(0, '', '');
data.readSequenceable(recvData);
data.readParcelable(recvData);
let sendData = new MySequenceable(0, '', '');
if (recvData.num == 2300 && recvData.str == 'case2300') {
sendData.num = 0;
......@@ -63,7 +63,7 @@ export default class MainAbility extends Ability {
test4600(data) {
let recvData = new MySequenceable(0, '', '');
data.readSequenceable(recvData);
data.readParcelable(recvData);
let sendData = new MySequenceable(0, '', '');
if (recvData.num == 4600 && recvData.str == 'case4600') {
sendData.num = 0;
......
......@@ -51,7 +51,7 @@ class MySequenceable {
function testCall(data) {
let recvSequence = new MySequenceable(0, '', '');
console.log('======>ThirdAppA MainAbility on testCall <======')
data.readSequenceable(recvSequence);
data.readParcelable(recvSequence);
var result = recvSequence.str + 'processed';
var commonEventData = {
code: 0,
......@@ -71,7 +71,7 @@ function testCall(data) {
function testCallWithResult(data) {
let recvSequence = new MySequenceable(0, '', '');
console.log('======>ThirdAppA MainAbility on testCall <======')
data.readSequenceable(recvSequence);
data.readParcelable(recvSequence);
let result = recvSequence.str + 'processed';
recvSequence.setMySequence(recvSequence.num, recvSequence.str, result);
......
......@@ -50,7 +50,7 @@ class MySequenceable {
function testCall(data) {
let recvSequence = new MySequenceable(0, '', '');
console.log('======>SystemCallTest FifthAbility on testCall <======')
data.readSequenceable(recvSequence);
data.readParcelable(recvSequence);
var result = recvSequence.str + 'processed';
var commonEventData = {
code: 0,
......@@ -70,7 +70,7 @@ function testCall(data) {
function testCallWithResult(data) {
let recvSequence = new MySequenceable(0, '', '');
console.log('======>SystemCallTest FifthAbility on testCall <======')
data.readSequenceable(recvSequence);
data.readParcelable(recvSequence);
let result = recvSequence.str + 'processed';
recvSequence.setMySequence(recvSequence.num, recvSequence.str, result);
......
......@@ -50,7 +50,7 @@ class MySequenceable {
function testCall(data) {
let recvSequence = new MySequenceable(0, '', '');
console.log('======>SystemCallTest ForthAbility on testCall <======')
data.readSequenceable(recvSequence);
data.readParcelable(recvSequence);
var result = recvSequence.str + 'processed';
var commonEventData = {
code: 0,
......@@ -70,7 +70,7 @@ function testCall(data) {
function testCallWithResult(data) {
let recvSequence = new MySequenceable(0, '', '');
console.log('======>SystemCallTest ForthAbility on testCall <======')
data.readSequenceable(recvSequence);
data.readParcelable(recvSequence);
let result = recvSequence.str + 'processed';
recvSequence.setMySequence(recvSequence.num, recvSequence.str, result);
......
......@@ -50,7 +50,7 @@ class MySequenceable {
function testCall(data) {
let recvSequence = new MySequenceable(0, '', '');
console.log('======>SystemCallTest SecondAbility on testCall <======')
data.readSequenceable(recvSequence);
data.readParcelable(recvSequence);
var result = recvSequence.str + 'processed';
var commonEventData = {
code: 0,
......@@ -70,7 +70,7 @@ function testCall(data) {
function testCallWithResult(data) {
let recvSequence = new MySequenceable(0, '', '');
console.log('======>SystemCallTest SecondAbility on testCall <======')
data.readSequenceable(recvSequence);
data.readParcelable(recvSequence);
let result = recvSequence.str + 'processed';
recvSequence.setMySequence(recvSequence.num, recvSequence.str, result);
......
......@@ -50,7 +50,7 @@ class MySequenceable {
function testCall(data) {
let recvSequence = new MySequenceable(0, '', '');
console.log('======>SystemCallTest ThirdAbility on testCall <======')
data.readSequenceable(recvSequence);
data.readParcelable(recvSequence);
var result = recvSequence.str + 'processed';
var commonEventData = {
code: 0,
......@@ -70,7 +70,7 @@ function testCall(data) {
function testCallWithResult(data) {
let recvSequence = new MySequenceable(0, '', '');
console.log('======>SystemCallTest ThirdAbility on testCall <======')
data.readSequenceable(recvSequence);
data.readParcelable(recvSequence);
let result = recvSequence.str + 'processed';
recvSequence.setMySequence(recvSequence.num, recvSequence.str, result);
......
......@@ -21,7 +21,7 @@ ohos_js_hap_suite("ActsAmsUsersThirdTest") {
":actsamsusersthirdtest_resources",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx_thirdparty.p7b"
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsAmsUsersThirdTest"
subsystem_name = "ability"
part_name = "ability_runtime"
......
......@@ -57,6 +57,12 @@
"visible": true,
"orientation": "portrait"
}
],
"requestPermissions": [
{
"name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND",
"reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND"
}
]
}
}
......@@ -22,11 +22,16 @@ var mainability
const START_ABILITY_TIMEOUT = 10000;
const START_ABILITY_TIMEOUT_TWO_THOUSAND = 2000;
const START_ABILITY_TIMEOUT_THOUSAND = 1000;
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
export default function abilityTest() {
describe('ActsChangeAbilityStagetest', function () {
beforeAll(async function (done) {
console.info('beforeAll called')
await sleep(2000)
await globalThis.abilitydelegator.getCurrentTopAbility().then((data) => {
mainability = data
done()
......
......@@ -26,10 +26,10 @@
{
"type": "PushKit",
"push":[
"atomizationresultstageentry.hap -> /data/test/AtomizationResultStageEntry.hap",
"atomizationresultstagehm2.hap -> /data/test/AtomizationResultStageHm2.hap",
"atomizationresultstagehnm2.hap -> /data/test/AtomizationResultStageHnm2.hap",
"stageresultmyapplication1.hap -> /data/test/StageResultMyApplication1.hap",
"AtomizationResultStageEntry.hap -> /data/test/AtomizationResultStageEntry.hap",
"AtomizationResultStageHm2.hap -> /data/test/AtomizationResultStageHm2.hap",
"AtomizationResultStageHnm2.hap -> /data/test/AtomizationResultStageHnm2.hap",
"StageResultMyApplication1.hap -> /data/test/StageResultMyApplication1.hap",
"MockService.hap -> /data/test/MockService.hap"
]
}
......
......@@ -26,7 +26,7 @@
{
"type": "PushKit",
"push":[
"atomizationresultstageentry.hap -> /data/test/AtomizationResultStageEntry.hap",
"AtomizationResultStageEntry.hap -> /data/test/AtomizationResultStageEntry.hap",
"MockService.hap -> /data/test/MockService.hap"
]
}
......
......@@ -40,12 +40,12 @@ export default function oauthTokenInfoTest() {
/*
* @tc.number OAuthTokenInfoTest_0100
* @tc.name OAuthTokenInfoTest_0100
* @tc.desc OAuthTokenInfo without account.
* @tc.desc AuthTokenInfo without account.
* @tc.size SmallTest
* @tc.type User
*/
it('OAuthTokenInfoTest_0100', 0, async function (done) {
let info : appAccount.OAuthTokenInfo = {
let info : appAccount.AuthTokenInfo = {
authType: "getSocialData",
token: "xxxxx"
}
......@@ -58,12 +58,12 @@ export default function oauthTokenInfoTest() {
/*
* @tc.number OAuthTokenInfoTest_0200
* @tc.name OAuthTokenInfoTest_0200
* @tc.desc OAuthTokenInfo with account.
* @tc.desc AuthTokenInfo with account.
* @tc.size SmallTest
* @tc.type User
*/
it('OAuthTokenInfoTest_0200', 0, async function (done) {
let info : appAccount.OAuthTokenInfo = {
let info : appAccount.AuthTokenInfo = {
authType: "getSocialData",
token: "xxxxx",
account: {
......
......@@ -14,7 +14,7 @@
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry';
import { UiComponent, UiDriver, BY, Component, Driver, UiWindow, ON, MatchPattern, DisplayRotation, ResizeDirection, WindowMode, PointerMatrix } from '@ohos.uitest'
import { UiComponent, UiDriver, BY, Component, Driver, UiWindow, ON, MatchPattern, DisplayRotation, ResizeDirection, WindowMode, PointerMatrix } from '@ohos.UiTest'
import ability_featureAbility from '@ohos.ability.featureAbility';
const delegator = abilityDelegatorRegistry.getAbilityDelegator();
......@@ -494,7 +494,7 @@ export default function UiTest() {
await driver.delayMs(waitUiReadyMs)
let Button = await driver.findComponent(ON.text('next page'))
let center = await Button.getBoundsCenter()
await driver.click(center.X, center.Y)
await driver.click(center.x, center.y)
await driver.delayMs(waitUiReadyMs)
let newButton = await driver.findComponent(ON.text('back to index'))
let text = await newButton.getText()
......@@ -514,7 +514,7 @@ export default function UiTest() {
await driver.delayMs(waitUiReadyMs)
let Button = await driver.findComponent(ON.text('Click twice'))
let center = await Button.getBoundsCenter()
await driver.doubleClick(center.X, center.Y)
await driver.doubleClick(center.x, center.y)
await driver.delayMs(waitUiReadyMs)
let button = await driver.findComponent(ON.text('doubleClick'))
let text = await button.getText()
......@@ -534,7 +534,7 @@ export default function UiTest() {
await driver.delayMs(waitUiReadyMs)
let Button = await driver.findComponent(ON.text('next page'))
let center = await Button.getBoundsCenter()
await driver.longClick(center.X, center.Y)
await driver.longClick(center.x, center.y)
await driver.delayMs(waitUiReadyMs)
let newButton = await driver.findComponent(ON.text('longClick'))
let text = await newButton.getText()
......@@ -784,7 +784,7 @@ export default function UiTest() {
let text = await driver.findComponent(ON.type('TextInput'))
let center = await text.getBoundsCenter()
await text.inputText('123')
await driver.click(center.X, center.Y)
await driver.click(center.x, center.y)
await driver.delayMs(waitUiReadyMs)
await driver.triggerCombineKeys(2072, 2017)
await driver.delayMs(waitUiReadyMs)
......@@ -924,7 +924,7 @@ export default function UiTest() {
await startAbility('com.uitestScene.acts', 'com.uitestScene.acts.MainAbility')
let driver = Driver.create()
await driver.delayMs(waitUiReadyMs)
await driver.fling({X:300, Y:600},{X:300, Y:300}, 20, 600)
await driver.fling({x:300, y:600},{x:300, y:300}, 20, 600)
let text = await driver.findComponent(ON.text('next page'))
expect(text == null).assertTrue()
let scrollBar = await driver.findComponent(ON.type('Scroll'))
......@@ -1026,28 +1026,28 @@ export default function UiTest() {
let bounds1 = await image1.getBounds()
let pointer = PointerMatrix.create(2,11)
await driver.delayMs(300)
pointer.setPoint(0,0,{X:245,Y:480})
pointer.setPoint(0,1,{X:250,Y:480})
pointer.setPoint(0,2,{X:255,Y:480})
pointer.setPoint(0,3,{X:260,Y:480})
pointer.setPoint(0,4,{X:265,Y:480})
pointer.setPoint(0,5,{X:270,Y:480})
pointer.setPoint(0,6,{X:275,Y:480})
pointer.setPoint(0,7,{X:280,Y:480})
pointer.setPoint(0,8,{X:285,Y:480})
pointer.setPoint(0,9,{X:290,Y:480})
pointer.setPoint(0,10,{X:295,Y:480})
pointer.setPoint(1,0,{X:505,Y:480})
pointer.setPoint(1,1,{X:500,Y:480})
pointer.setPoint(1,2,{X:495,Y:480})
pointer.setPoint(1,3,{X:490,Y:480})
pointer.setPoint(1,4,{X:485,Y:480})
pointer.setPoint(1,5,{X:480,Y:480})
pointer.setPoint(1,6,{X:475,Y:480})
pointer.setPoint(1,7,{X:470,Y:480})
pointer.setPoint(1,8,{X:465,Y:480})
pointer.setPoint(1,9,{X:460,Y:480})
pointer.setPoint(1,10,{X:455,Y:480})
pointer.setPoint(0,0,{x:245,y:480})
pointer.setPoint(0,1,{x:250,y:480})
pointer.setPoint(0,2,{x:255,y:480})
pointer.setPoint(0,3,{x:260,y:480})
pointer.setPoint(0,4,{x:265,y:480})
pointer.setPoint(0,5,{x:270,y:480})
pointer.setPoint(0,6,{x:275,y:480})
pointer.setPoint(0,7,{x:280,y:480})
pointer.setPoint(0,8,{x:285,y:480})
pointer.setPoint(0,9,{x:290,y:480})
pointer.setPoint(0,10,{x:295,y:480})
pointer.setPoint(1,0,{x:505,y:480})
pointer.setPoint(1,1,{x:500,y:480})
pointer.setPoint(1,2,{x:495,y:480})
pointer.setPoint(1,3,{x:490,y:480})
pointer.setPoint(1,4,{x:485,y:480})
pointer.setPoint(1,5,{x:480,y:480})
pointer.setPoint(1,6,{x:475,y:480})
pointer.setPoint(1,7,{x:470,y:480})
pointer.setPoint(1,8,{x:465,y:480})
pointer.setPoint(1,9,{x:460,y:480})
pointer.setPoint(1,10,{x:455,y:480})
await driver.injectMultiPointerAction(pointer, 600)
let image2 = await driver.findComponent(ON.type('Image'))
let bounds2= await image2.getBounds()
......@@ -1343,8 +1343,8 @@ export default function UiTest() {
let driver = Driver.create()
await driver.delayMs(waitUiReadyMs)
let s = await driver.getDisplaySize()
expect(s.X != 0).assertTrue()
expect(s.Y != 0).assertTrue()
expect(s.x != 0).assertTrue()
expect(s.y != 0).assertTrue()
await stopApplication('com.uitestScene.acts')
})
......@@ -1358,8 +1358,8 @@ export default function UiTest() {
let driver = Driver.create()
await driver.delayMs(waitUiReadyMs)
let s = await driver.getDisplayDensity()
expect(s.X != 0).assertTrue()
expect(s.Y != 0).assertTrue()
expect(s.x != 0).assertTrue()
expect(s.y != 0).assertTrue()
await stopApplication('com.uitestScene.acts')
})
......@@ -1501,7 +1501,7 @@ export default function UiTest() {
let text2 = await driver.findComponent(ON.text('one'))
let point1 = await text1.getBoundsCenter()
let point2 = await text2.getBoundsCenter()
await driver.drag(point1.X, point1.Y, point2.X, point2.Y)
await driver.drag(point1.x, point1.y, point2.x, point2.y)
await driver.delayMs(waitUiReadyMs)
let text = await driver.findComponent(ON.text('four'))
expect(text == null).assertTrue()
......
......@@ -5,7 +5,8 @@
"test-timeout": "600000",
"bundle-name": "com.open.harmony.aceEtsAttrLack",
"package-name": "com.open.harmony.aceEtsAttrLack",
"shell-timeout": "600000"
"shell-timeout": "600000",
"testcase-timeout":"10000"
},
"kits": [
{
......
......@@ -39,7 +39,6 @@ struct WebEditText {
.blur(2)
// .fileFromUrlAccess(true)
.initialScale(2)
.webDebuggingAccess(true)
.onRenderExited((event) => {
console.info('onRenderExited getAcceptType: ', event.renderExitReason);
})
......@@ -80,8 +79,6 @@ struct WebEditText {
})
.onHttpErrorReceive((event) => {
console.log('setResponseHeader:' + event.response.setResponseHeader([]));
console.log('web getExtra:' + this.controller.getHitTestValue().getExtra());
console.log('web getType:' + this.controller.getHitTestValue().getType());
let result = event.request.getRequestHeader();
console.log('The request header result size is ' + result.length);
for (let i of result) {
......
......@@ -43,7 +43,6 @@ struct Index {
@State geolocationAccess:boolean=true
@State onlineImageAccess:boolean=true
@State databaseAccess:boolean=true
@State overviewModeAccess:boolean=false
@State initialScale:number=100
@State enterPageEnd:boolean=false
@State newScale:number=0
......@@ -54,7 +53,6 @@ struct Index {
@State cacheError:boolean=false
@State mixedSwitch:boolean=false
@State mixedAllSwitch:boolean=false
@State overViewFalseHeight:number=0
@State isProgressFinish:boolean=false
@State isHttpErrorReceive:boolean=false
onPageShow(){
......@@ -106,7 +104,6 @@ struct Index {
.cacheMode(this.cacheMode)
.initialScale(this.initialScale)
.mixedMode(this.mixedMode)
.overviewModeAccess(this.overviewModeAccess)
.userAgent("Mozila/5.0 (Linux; Andriod 9; VRD-AL10; HMSCore 6.3.0.331) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.105 HuaweiBrowser/12.0.4.1 MobileSafari/537.36")
.javaScriptProxy({
object:this.jsObj,
......@@ -276,10 +273,12 @@ struct Index {
break;
}
case "emitLoadUrl":{
this.controller.loadUrl({url:"https://www.gitee.com"})
this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/index.html"});
setTimeout(()=>{
let webTitle=this.controller.getTitle()
Utils.emitEvent(webTitle,110)
this.controller.runJavaScript({script:"gettitle()",callback:(res)=>{
console.info("gettitle1==>"+res)
Utils.emitEvent(res,110)
}})
},3000)
break;
}
......@@ -310,30 +309,6 @@ struct Index {
Utils.emitEvent(hitType,118)
break;
}
case "emitGetWebId":{
let webId=this.controller.getWebId()+""
Utils.emitEvent(webId,120)
break;
}
case "emitGetTitle":{
this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/index.html"});
setTimeout(()=>{
let webTitle=this.controller.getTitle()
Utils.emitEvent(webTitle,122)
},3000)
break;
}
case "emitGetPageHeight":{
this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/index.html"});
let webPageHeight=this.controller.getPageHeight()+""
setTimeout(()=>{
this.controller.runJavaScript({script:"getPageHeight()",callback:(res)=>{
console.info("getPageHeight==>"+res)
Utils.emitEventTwo(res,webPageHeight,124)
}})
},3000)
break;
}
case "emitGetRequestFocus":{
this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/second.html"});
await Utils.sleep(2000)
......@@ -357,25 +332,18 @@ struct Index {
}
case "emitBackward":{
this.controller.backward()
this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/index.html"});
setTimeout(()=>{
let webTitle=this.controller.getTitle()
Utils.emitEvent(webTitle,134)
this.controller.runJavaScript({script:"gettitle()",callback:(res)=>{
Utils.emitEvent(res,134)
}})
},3000)
break;
}
case "emitForward":{
this.controller.forward()
setTimeout(()=>{
let webTitle=this.controller.getTitle()
Utils.emitEvent(webTitle,136)
},3000)
break;
}
case "emitBackOrForward":{
this.controller.backOrForward(-1)
setTimeout(()=>{
let webTitle=this.controller.getTitle()
Utils.emitEvent(webTitle,138)
setTimeout(()=>{
Utils.emitEvent(this.newUrl,136)
},3000)
break;
}
......@@ -496,32 +464,6 @@ struct Index {
},3000)
break;
}
case "emitOverviewModeAccessFalse":{
this.overviewModeAccess=false
await Utils.sleep(1000)
this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/overview.html"});
setTimeout(()=>{
let webPageHeight=this.controller.getPageHeight()
this.controller.runJavaScript({script:"getViewResult()",callback:(res)=>{
this.overViewFalseHeight=parseInt(res)
console.info("getViewResult==>"+res)
Utils.emitEventTwo(webPageHeight,res,168)
}})
},3000)
break;
}
case "emitOverviewModeAccessTrue":{
this.overviewModeAccess=true
await Utils.sleep(1000)
this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/overview.html"});
setTimeout(()=>{
this.controller.runJavaScript({script:"getViewResult()",callback:(res)=>{
console.info("getViewResult==>"+res)
Utils.emitEventTwo(this.overViewFalseHeight,parseInt(res),170)
}})
},3000)
break;
}
case "emitOnPrompt":{
this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/index.html"});
setTimeout(()=>{
......@@ -539,10 +481,11 @@ struct Index {
case "emitCacheModeDefault":{
this.cacheMode=CacheMode.Default
await Utils.sleep(2000)
this.controller.loadUrl({url:"https://www.openharmony.cn/mainPlay"})
this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/index.html"});
setTimeout(()=>{
let webTitle=this.controller.getTitle()
Utils.emitEvent(webTitle,184)
this.controller.runJavaScript({script:"gettitle()",callback:(res)=>{
Utils.emitEvent(res,184)
}})
},3000)
break;
}
......@@ -565,8 +508,9 @@ struct Index {
this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/index.html"});
this.controller.runJavaScript({script:"openRawFile()"})
setTimeout(()=>{
let webTitle=this.controller.getTitle()
Utils.emitEvent(webTitle,190)
this.controller.runJavaScript({script:"gettitle()",callback:(res)=>{
Utils.emitEvent(res,190)
}})
},3000)
break;
}
......@@ -628,69 +572,20 @@ struct Index {
this.controller.loadUrl({url:"https://consumer.huawei.com/content/dam/huawei-cbg-site/cn/mkt/mobileservices/2022/download/PC107f1b3947c942ffaa14334a879065d8.2107261020.exe"})
break;
}
case "emitSetCookie":{
this.controller.getCookieManager().setCookie('http://www.baidu.com','e=f')
setTimeout(()=>{
let setCookieCalled = this.controller.getCookieManager().getCookie('http://www.baidu.com')
Utils.emitEvent(setCookieCalled,76)
},3000)
break;
}
case "emitGetCookie":{
this.controller.getCookieManager().setCookie('https://www.bilibili.com/','e=f')
setTimeout(()=>{
let getCookieCalled = this.controller.getCookieManager().getCookie('https://www.bilibili.com/')
Utils.emitEvent(getCookieCalled,69)
},3000)
break;
}
case "emitZoom":{
this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/index.html"});
setTimeout(()=>{
this.controller.zoom(2)
setTimeout(() => {
if(this.controller.getPageHeight() > 1400){
var zoomCalled = true
}
Utils.emitEvent(zoomCalled,77)
},3000)
this.controller.zoom(2)
setTimeout(()=>{
this.controller.runJavaScript({script:"getPageHeight()",callback:(res)=>{
console.info("getPageHeight++++++"+res)
if(Number(res) > 1400){
var zoomCalled = true
}
Utils.emitEvent(zoomCalled,77)
}})
},5000)
break;
}
case "emitZoomOut":{
this.controller.zoomOut()
setTimeout(()=>{
if(this.controller.getPageHeight() < 1500){
var zoomOutCalled = true
}
Utils.emitEvent(zoomOutCalled,78)
},3000)
break;
}
case "emitZoomIn":{
this.controller.zoomIn()
setTimeout(()=>{
var zoomInCalled = false
if(this.controller.getPageHeight() > 1400){
zoomInCalled = true
}
Utils.emitEvent(zoomInCalled,79)
},3000)
break;
}
case "emitDeleteEntireCookie":{
this.controller.getCookieManager().deleteEntireCookie()
setTimeout(()=>{
let deleteEntireCookieCalled = this.controller.getCookieManager().getCookie('http://www.baidu.com')
Utils.emitEvent(deleteEntireCookieCalled,80)
},3000)
break;
}
case "emitSaveCookieSync":{
let saveCookieSyncCalled = this.controller.getCookieManager().saveCookieSync()
Utils.emitEvent(saveCookieSyncCalled,81)
break;
}
case "emitClearHistory":{
this.controller.loadUrl({url:"http://www.baidu.com/"})
setTimeout(()=>{
......@@ -714,15 +609,14 @@ struct Index {
},3000)
break;
}
case "emitOnInactive":{
case "emitOnInactive":{
this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/index.html"});
this.controller.onInactive()
this.controller.zoomOut()
setTimeout(()=>{
var onInactiveCalled = false
if(this.controller.getPageHeight() < 2600){
onInactiveCalled = true
}
Utils.emitEvent(onInactiveCalled,84)
this.controller.runJavaScript({script:"gettitle()",callback:(res)=>{
console.info("gettitle++++++"+res)
Utils.emitEvent(res,84)
}})
},3000)
break;
}
......@@ -767,14 +661,6 @@ struct Index {
},3000)
break;
}
case "emitGetCookieManager":{
this.controller.getCookieManager().setCookie("https://weibo.com","a=b")
setTimeout(()=>{
let getCookieManagerCalled = this.controller.getCookieManager().getCookie('https://weibo.com')
Utils.emitEvent(getCookieManagerCalled,89)
},3000)
break;
}
default:
console.info("can not match case")
}
......
/*
* 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 events_emitter from '@ohos.events.emitter';
import Utils from '../../test/Utils';
@Entry
@Component
struct Second {
controller:WebController = new WebController()
@State str:string="emitOverviewModeAccessTrue"
@State overviewModeAccess:boolean=true
@State overviewScale:string=""
onPageShow(){
let valueChangeEvent={
eventId:10,
priority:events_emitter.EventPriority.LOW
};
events_emitter.on(valueChangeEvent,this.valueChangeCallBack);
}
private valueChangeCallBack=(eventData)=>{
console.info("web page valueChangeCallBack");
if(eventData != null){
console.info("valueChangeCallBack:"+ JSON.stringify(eventData));
if(eventData.data.ACTION != null){
this.str = eventData.data.ACTION;
}
}
}
build(){
Column(){
Row(){
Button("web click").key('webcomponenttwo').onClick(async ()=>{
console.info("key==>"+this.str);
switch(this.str){
case "emitOverviewModeAccessTrue":{
this.controller.runJavaScript({script:"getViewResult()",callback:(res)=>{
console.info("getViewResult==>"+res);
this.overviewScale=res;
Utils.emitEventTwo(res,"1",168);
}});
break;
}
case "emitOverviewModeAccessFalse":{
this.overviewModeAccess=false;
await Utils.sleep(2000);
this.controller.runJavaScript({script:"getViewResult()",callback:(res)=>{
console.info("getViewResult==>"+res);
Utils.emitEventTwo(this.overviewScale,res,170);
}});
break;
}
default:
console.info("can not match case");
}
})
}
Web({src:$rawfile('overview.html'),controller:this.controller})
.overviewModeAccess(this.overviewModeAccess)
}
}
}
\ No newline at end of file
......@@ -13,7 +13,8 @@
* limitations under the License.
*/
import webJsunit from './WebJsunit.test'
import webTwoJsunit from './WebTwoJsunit.test'
export default function testsuite() {
webJsunit()
webTwoJsunit()
}
\ No newline at end of file
/*
* 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.
*/
// @ts-nocheck
import { describe, beforeEach, afterEach, it, expect, beforeAll} from "@ohos/hypium";
import events_emitter from '@ohos.events.emitter';
import router from '@system.router';
import Utils from './Utils.ets';
let emitKey = "emitOverviewModeAccessTrue";
export default function webTwoJsunit() {
describe('overviewTest', function () {
beforeAll(async function (done) {
let options = {
uri: 'MainAbility/pages/webTwo',
}
try {
router.clear();
let pages = router.getState();
console.info("get webTwo state success " + JSON.stringify(pages));
if (!("webTwo" == pages.name)) {
console.info("get webTwo state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push webTwo page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push webTwo page error: " + err);
}
done()
});
beforeEach(async function (done) {
await Utils.sleep(2000);
console.info("web beforeEach start");
done();
})
afterEach(async function (done) {
console.info("web afterEach start:"+emitKey);
try {
let backData = {
data: {
"ACTION": emitKey
}
}
let backEvent = {
eventId:10,
priority:events_emitter.EventPriority.LOW
}
console.info("start send emitKey");
events_emitter.emit(backEvent, backData);
} catch (err) {
console.info("emit emitKey err: " + JSON.stringify(err));
}
await Utils.sleep(2000);
done();
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_001
*tc.name overviewModeAccessTrue
*tc.desic Sets allow the Web access overview mode
*/
it('overviewModeAccessTrue',0,async function(done){
emitKey="emitOverviewModeAccessFalse";
Utils.registerLargerEvent("overviewModeAccessTrue",168,done);
sendEventByKey('webcomponenttwo',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_002
*tc.name overviewModeAccessFalse
*tc.desic Sets not allow the Web access overview mode
*/
it('overviewModeAccessFalse',0,async function(done){
emitKey="emitOverviewModeAccessFalse";
Utils.registerLargerEvent("overviewModeAccessFalse",170,done);
sendEventByKey('webcomponenttwo',10,'');
})
})
}
\ No newline at end of file
......@@ -6,8 +6,8 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
"tablet",
"default",
"tablet",
"default",
"phone"
],
"deliveryWithInstall": true,
......
{
"src": [
"MainAbility/pages/web"
"MainAbility/pages/web",
"MainAbility/pages/webTwo"
]
}
\ No newline at end of file
......@@ -66,5 +66,8 @@
function openRawFile(){
document.getElementById("fileAccess").click()
}
function gettitle(){
return document.title
}
</script>
</html>
......@@ -15,8 +15,8 @@
</body>
<script>
function getViewResult(){
let height=document.getElementsByTagName("body")[0].scrollHeight;
return height;
let scaleNumber=window.visualViewport.scale;
return scaleNumber;
}
</script>
</html>
\ No newline at end of file
......@@ -18,4 +18,4 @@
"singleUser": false
}
}
}
\ No newline at end of file
}
......@@ -18,17 +18,22 @@ import { Hypium } from '@ohos/hypium';
import testsuite from '../../test/List.test';
import Utils from '../../test/Utils';
import web_webview from '@ohos.web.webview';
import fileio from '@ohos.fileio';
let loadedUrl;
@Entry
@Component
struct Index {
controller: web_webview.WebviewController = new web_webview.WebviewController();
controllerTwo: web_webview.WebviewController = new web_webview.WebviewController();
scheme1: web_webview.WebCustomScheme = {schemeName: "name1", isSupportCORS: true, isSupportFetch: true}
responseweb: WebResourceResponse = new WebResourceResponse()
@State str:string="emitLoadUrl"
@State text:boolean=false
@State num:number=0
@State mode: WebDarkMode = WebDarkMode.Off
@State mode1: WebDarkMode = WebDarkMode.On
@State mode2: WebDarkMode = WebDarkMode.Auto
ports: web_webview.WebMessagePort[];
testObj = {
testOne: (data) => {
Utils.emitEvent(data,13)
......@@ -62,6 +67,14 @@ struct Index {
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
try{
web_webview.once("webInited",()=>{
web_webview.WebCookieManager.setCookie("https://www.huawei.com", "a=b");
})
}catch(error){
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
}
}
build(){
Column(){
......@@ -72,7 +85,7 @@ struct Index {
case "emitLoadUrl":{
try {
setTimeout(()=>{
this.controller.loadUrl('www.baidu.com');
this.controller.loadUrl("file:///data/storage/el1/bundle/phone/resources/rawfile/index.html");
setTimeout(()=>{
let title = this.controller.getTitle();
Utils.emitEvent(title,1)
......@@ -406,16 +419,126 @@ struct Index {
}
break;
}
case "emitOnce":{
try {
let re = web_webview.WebCookieManager.getCookie("https://www.huawei.com")
Utils.emitEvent(re, 31)
console.log("result: " + re);
} catch (error) {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
}
break;
}
case "emitGetItemAtIndex":{
try {
let res = this.controller.getBackForwardEntries()
let item =res.getItemAtIndex(0)
Utils.emitEvent(item.title, 32)
console.log("result: " + item.title);
} catch (error) {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
}
break;
}
case "emitSlideScroll":{
try {
this.controller.slideScroll(10, 10);
} catch (error) {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
}
try {
let state = this.controller.serializeWebState();
let path = globalThis.AbilityContext.cacheDir;
path += '/WebState';
let fd = fileio.openSync(path, 0o2 | 0o100, 0o666);
fileio.writeSync(fd, state.buffer);
fileio.closeSync(fd);
} catch (error) {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
}
try {
let path = globalThis.AbilityContext.cacheDir;
path += '/WebState';
let fd = fileio.openSync(path, 0o002, 0o666);
let stat = fileio.fstatSync(fd);
let size = stat.size;
let buf = new ArrayBuffer(size);
fileio.read(fd, buf, (err, data) => {
if (data) {
this.controller.restoreWebState(new Uint8Array(data.buffer));
}
fileio.closeSync(fd);
});
} catch (error) {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
}
try {
this.ports = this.controller.createWebMessagePorts();
this.ports[1].onMessageEvent((msg) => {
if (typeof(msg) == "string") {
console.log("received string message from html5, string is:" + msg);
} else if (typeof(msg) == "object") {
if (msg instanceof ArrayBuffer) {
console.log("received arraybuffer from html5, length is:" + msg.byteLength);
} else {
console.log("not support");
}
} else {
console.log("not support");
}
})
} catch (error) {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
}
break;
}
case "emitContextMenuMediaType":{
try {
let con = ContextMenuMediaType.Image
Utils.emitEvent(con, 33)
console.log("result: " + con);
} catch (error) {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
}
break;
}
case "emitContextMenuInputFieldType":{
try {
Utils.emitEvent(ContextMenuInputFieldType.PlainText, 34)
Utils.emitEvent(ContextMenuInputFieldType.Telephone, 35)
Utils.emitEvent(ContextMenuInputFieldType.Other, 36)
console.log("result: " + ContextMenuInputFieldType.PlainText);
} catch (error) {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
}
break;
}
case "emitContextMenuEditStateFlags":{
try {
Utils.emitEvent(ContextMenuEditStateFlags.NONE, 37)
Utils.emitEvent(ContextMenuEditStateFlags.CAN_CUT, 38)
Utils.emitEvent(ContextMenuEditStateFlags.CAN_COPY, 39)
Utils.emitEvent(ContextMenuEditStateFlags.CAN_PASTE, 40)
Utils.emitEvent(ContextMenuEditStateFlags.CAN_SELECT_ALL, 41)
console.log("result: " + ContextMenuEditStateFlags.CAN_SELECT_ALL);
} catch (error) {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
}
break;
}
default:
console.info("can not match case")
}
})
}
Web({src:"www.example.com",controller:this.controller})
.webDebuggingAccess(true)
.mediaPlayGestureAccess(true)
.javaScriptAccess(true)
.zoomAccess(this.text)
.onDataResubmitted((event) => {
console.log('onDataResubmitted')
event.handler.resend();
})
.onSearchResultReceive(ret=>{
var searchResult = ret.activeMatchOrdinal.toString() +
ret.numberOfMatches.toString()
......@@ -424,6 +547,29 @@ struct Index {
Utils.emitEvent(searchResult,16)
},3000)
})
.onContextMenuShow((event) => {
console.info(event.param.getMediaType() + event.param.getSelectionText() + event.param.getSourceType())
console.info(event.param.getInputFieldType().toString())
console.info(event.param.isEditable().toString())
console.info(event.param.getEditStateFlags().toString())
event.result.paste()
event.result.cut()
return true
})
.onHttpErrorReceive((event) => {
event.response.setResponseIsReady(true)
})
.darkMode(this.mode)
.forceDarkAccess(false)
.webSerifFont('serif')
.webFixedFont('fixed')
.webSansSerifFont('serif')
.minLogicalFontSize(1)
.horizontalScrollBarAccess(true)
.verticalScrollBarAccess(true)
.onTouchIconUrlReceived((event) => {
console.log('onTouchIconUrlReceived:' + JSON.stringify(event))
})
}
}
......
......@@ -51,7 +51,7 @@ export default function webJsunit() {
*/
it('LoadUrl',0,async function(done){
emitKey="emitLoadData";
Utils.registerContainEvent("LoadUrl","百度一下,你就知道",1,done);
Utils.registerContainEvent("LoadUrl","index",1,done);
sendEventByKey('webcomponent',10,'');
})
/*
......@@ -71,7 +71,7 @@ export default function webJsunit() {
*/
it('Backward',0,async function(done){
emitKey="emitForward";
Utils.registerEvent("Backward","百度一下,你就知道",3,done);
Utils.registerEvent("Backward","index",3,done);
sendEventByKey('webcomponent',10,'');
})
/*
......@@ -340,9 +340,65 @@ export default function webJsunit() {
*tc.desic Save current page
*/
it('GetUrl',0,async function(done){
emitKey="emitGetUrl";
emitKey="emitOnce";
Utils.registerContainEvent("GetUrl","17100001",30,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_031
*tc.name Once
*tc.desic Save current page
*/
it('Once',0,async function(done){
emitKey="emitGetItemAtIndex";
Utils.registerContainEvent("Once","a=b",31,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_032
*tc.name GetItemAtIndex
*tc.desic Save current page
*/
it('GetItemAtIndex',0,async function(done){
emitKey="emitContextMenuMediaType";
Utils.registerEvent("GetItemAtIndex","index",32,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_033
*tc.name ContextMenuMediaType
*tc.desic Save current page
*/
it('ContextMenuMediaType',0,async function(done){
emitKey="emitContextMenuInputFieldType";
Utils.registerEvent("ContextMenuMediaType",1,33,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_034
*tc.name ContextMenuInputFieldType
*tc.desic Save current page
*/
it('ContextMenuInputFieldType',0,async function(done){
emitKey="emitContextMenuEditStateFlags";
Utils.registerEvent("ContextMenuInputFieldType",1,34,done);
Utils.registerEvent("ContextMenuInputFieldType",4,35,done);
Utils.registerEvent("ContextMenuInputFieldType",5,36,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_035
*tc.name ContextMenuEditStateFlags
*tc.desic Save current page
*/
it('ContextMenuEditStateFlags',0,async function(done){
emitKey="emitContextMenuEditStateFlags";
Utils.registerEvent("ContextMenuEditStateFlags",0,37,done);
Utils.registerEvent("ContextMenuEditStateFlags",1,38,done);
Utils.registerEvent("ContextMenuEditStateFlags",2,39,done);
Utils.registerEvent("ContextMenuEditStateFlags",4,40,done);
Utils.registerEvent("ContextMenuEditStateFlags",8,41,done);
sendEventByKey('webcomponent',10,'');
})
})
}
\ No newline at end of file
......@@ -15,11 +15,11 @@
"uiSyntax": "ets",
"pages": "$profile:main_pages",
"metadata": [
{
"name": "ArkTSPartialUpdate",
"value": "false"
}
],
{
"name": "ArkTSPartialUpdate",
"value": "true"
}
],
"abilities": [{
"name": "com.example.myapplication.MainAbility",
"srcEntrance": "./ets/MainAbility/MainAbility.ts",
......@@ -46,4 +46,4 @@
}
]
}
}
}
\ No newline at end of file
......@@ -25,7 +25,7 @@ let loadedUrl;
struct Index {
controller:WebController = new WebController()
responseweb: WebResourceResponse = new WebResourceResponse()
@State str:string="emitStoreWebArchive"
@State str:string="emitAllowGeolocation"
@State text:string=""
@State textRatio:number=100
@State zoomAccessValue:boolean=true
......@@ -75,15 +75,6 @@ struct Index {
Button("web click").key('webcomponent').onClick(async ()=>{
console.info("key==>"+this.str)
switch(this.str){
case "emitStoreWebArchive":{
let webAsyncController = new web_webview.WebAsyncController(this.controller)
webAsyncController.storeWebArchive("/data/storage/el2/base/",true,(filename) => {
if(filename != null) {
Utils.emitEvent(filename,400)
}
})
break;
}
case "emitAllowGeolocation":{
web_webview.GeolocationPermissions.allowGeolocation("file:///")
web_webview.GeolocationPermissions.getAccessibleGeolocation(this.origin, (error, result) => {
......@@ -146,15 +137,6 @@ struct Index {
},3000)
break;
}
case "emitExistCookie":{
this.controller.getCookieManager().deleteEntireCookie();
setTimeout(()=>{
var result = web_webview.WebCookieManager.existCookie();
console.log(result.toString());
Utils.emitEvent(result,414)
},3000)
break ;
}
case "emitOnConsole":{
this.controller.runJavaScript({script:"consoleTest()"})
break;
......@@ -163,29 +145,32 @@ struct Index {
this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/index.html"})
setTimeout(()=>{
this.controller.loadData({
data: "<html><title>index</title></html>",
data: "<html><head><title>index</title></head><body bgcolor=\"white\">Source:<pre>source</pre</body><script>function gettitle(){return document.title}</script></html>",
mimeType: "text/html",
encoding: "UTF-8"
})
},3000)
setTimeout(()=>{
this.text = this.controller.getTitle();
Utils.emitEvent(this.text,424)
this.controller.runJavaScript({script:"gettitle()",callback:(res)=>{
Utils.emitEvent(res,424)
}})
},4000)
break ;
}
case "emitZoomAccess":{
this.zoomAccessValue = false
this.controller.refresh()
var origin = this.controller.getPageHeight()
var zoomInCalled = false
setTimeout(()=>{
this.controller.zoomIn()
if (this.controller.getPageHeight() > origin) {
this.controller.refresh()
setTimeout(()=>{
this.controller.runJavaScript({script:"getPageHeight()",callback:(res1)=>{
var zoomInCalled = false
this.controller.runJavaScript({script:"getPageHeight()",callback:(res)=>{
console.info("getPageHeight==>"+res)
if (Number(res) > Number(res1)) {
zoomInCalled = true
}
console.log("final" + this.controller.getPageHeight())
Utils.emitEvent(zoomInCalled,428);
Utils.emitEvent(zoomInCalled,428);
}})
}})
},3000);
break ;
}
......@@ -213,13 +198,6 @@ struct Index {
},3000)
break;
}
case "emitSearchAllAsync":{
this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/index.html"})
setTimeout(()=>{
this.controller.searchAllAsync("首页");
},3000)
break ;
}
default:
console.info("can not match case")
}
......@@ -243,14 +221,6 @@ struct Index {
},3000)
return false
})
.onSearchResultReceive(ret=>{
var searchResult = ret.activeMatchOrdinal.toString() +
ret.numberOfMatches.toString()
console.log("searchResult" + searchResult)
setTimeout(()=>{
Utils.emitEvent(searchResult,426)
},3000)
})
}
}
}
......@@ -16,7 +16,7 @@
import { describe, beforeEach, afterEach, it, expect } from "@ohos/hypium";
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils.ets';
let emitKey = "emitUserAgent";
let emitKey = "emitAllowGeolocation";
export default function webJsunit() {
describe('ActsAceWebDevTest', function () {
beforeEach(async function (done) {
......@@ -44,16 +44,6 @@ export default function webJsunit() {
await Utils.sleep(2000);
done();
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_066
*tc.name storeWebArchive
*tc.desic Save current page
*/
it('storeWebArchive',0,async function(done){
emitKey="emitAllowGeolocation";
Utils.registerContainEvent("storeWebArchive","/data/storage/el2/base/",400,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_067
*tc.name allowGeolocation
......@@ -110,18 +100,8 @@ export default function webJsunit() {
*tc.desic return whether the third party cookie is allowed
*/
it('isThirdPartyCookieAllowed',0,async function(done){
emitKey="emitExistCookie";
Utils.registerEvent("isThirdPartyCookieAllowed",false,412,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_073
*tc.name existCookie
*tc.desic return whether there exits cookie
*/
it('existCookie',0,async function(done){
emitKey="emitOnConsole";
Utils.registerEvent("existCookie",false,414,done);
Utils.registerEvent("isThirdPartyCookieAllowed",false,412,done);
sendEventByKey('webcomponent',10,'');
})
/*
......@@ -190,19 +170,9 @@ export default function webJsunit() {
*tc.desic delete credentials
*/
it('deleteHttpAuthCredentials',0,async function(done){
emitKey="emitSearchAllAsync";
emitKey="emitDeleteHttpAuthCredentials";
Utils.registerEvent("deleteHttpAuthCredentials",false,446,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_079
*tc.name searchAllAsync
*tc.desic search specific words
*/
it('searchAllAsync',0,async function(done){
emitKey="emitSearchAllAsync";
Utils.registerEvent("searchAllAsync","01",426,done);
sendEventByKey('webcomponent',10,'');
})
})
}
......@@ -6,8 +6,8 @@
"description": "$string:phone_entry_dsc",
"mainElement": "MainAbility",
"deviceTypes": [
"tablet",
"default",
"tablet",
"default",
"phone"
],
"deliveryWithInstall": true,
......
......@@ -66,5 +66,8 @@
function openRawFile(){
document.getElementById("fileAccess").click()
}
function gettitle(){
return document.title
}
</script>
</html>
......@@ -9,4 +9,9 @@
<body>
<div style="height: 1300px;background-color: #999999;">second pages</div>
</body>
<script>
function gettitle(){
return document.title
}
</script>
</html>
\ No newline at end of file
......@@ -281,7 +281,7 @@ export default function getBundleInfoForSelf() {
expect(data.hapModulesInfo[0].abilitiesInfo[0].icon).assertEqual("$media:icon");
expect(data.hapModulesInfo[0].abilitiesInfo[0].iconId).assertLarger(0);
expect(data.hapModulesInfo[0].abilitiesInfo[0].process).assertEqual("");
expect(data.hapModulesInfo[0].abilitiesInfo[0].isVisible).assertTrue();
expect(data.hapModulesInfo[0].abilitiesInfo[0].exported).assertTrue();
expect(data.hapModulesInfo[0].abilitiesInfo[0].type).assertEqual(1);
expect(data.hapModulesInfo[0].abilitiesInfo[0].orientation).assertEqual(bundle.DisplayOrientation.PORTRAIT);
expect(data.hapModulesInfo[0].abilitiesInfo[0].launchType).assertEqual(bundle.LaunchType.SINGLETON);
......@@ -311,7 +311,7 @@ export default function getBundleInfoForSelf() {
expect(data.hapModulesInfo[0].abilitiesInfo[0].windowSize.maxWindowHeight).assertEqual(0);
expect(data.hapModulesInfo[0].abilitiesInfo[0].windowSize.minWindowHeight).assertEqual(0);
expect(data.hapModulesInfo[0].abilitiesInfo[1].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility1");
expect(data.hapModulesInfo[0].abilitiesInfo[1].launchType).assertEqual(bundle.LaunchType.STANDARD);
expect(data.hapModulesInfo[0].abilitiesInfo[1].launchType).assertEqual(bundle.LaunchType.MULTITON);
expect(data.hapModulesInfo[0].abilitiesInfo[1].orientation).assertEqual(bundle.DisplayOrientation.LANDSCAPE);
expect(data.hapModulesInfo[0].abilitiesInfo[2].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility10");
expect(data.hapModulesInfo[0].abilitiesInfo[2].orientation).assertEqual(bundle.DisplayOrientation.LOCKED);
......@@ -387,7 +387,7 @@ export default function getBundleInfoForSelf() {
expect(data.hapModulesInfo[0].abilitiesInfo[0].icon).assertEqual("$media:icon");
expect(data.hapModulesInfo[0].abilitiesInfo[0].iconId).assertLarger(0);
expect(data.hapModulesInfo[0].abilitiesInfo[0].process).assertEqual("");
expect(data.hapModulesInfo[0].abilitiesInfo[0].isVisible).assertTrue();
expect(data.hapModulesInfo[0].abilitiesInfo[0].exported).assertTrue();
expect(data.hapModulesInfo[0].abilitiesInfo[0].type).assertEqual(1);
expect(data.hapModulesInfo[0].abilitiesInfo[0].orientation).assertEqual(bundle.DisplayOrientation.PORTRAIT);
expect(data.hapModulesInfo[0].abilitiesInfo[0].launchType).assertEqual(bundle.LaunchType.SINGLETON);
......@@ -417,7 +417,7 @@ export default function getBundleInfoForSelf() {
expect(data.hapModulesInfo[0].abilitiesInfo[0].windowSize.maxWindowHeight).assertEqual(0);
expect(data.hapModulesInfo[0].abilitiesInfo[0].windowSize.minWindowHeight).assertEqual(0);
expect(data.hapModulesInfo[0].abilitiesInfo[1].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility1");
expect(data.hapModulesInfo[0].abilitiesInfo[1].launchType).assertEqual(bundle.LaunchType.STANDARD);
expect(data.hapModulesInfo[0].abilitiesInfo[1].launchType).assertEqual(bundle.LaunchType.MULTITON);
expect(data.hapModulesInfo[0].abilitiesInfo[1].orientation).assertEqual(bundle.DisplayOrientation.LANDSCAPE);
expect(data.hapModulesInfo[0].abilitiesInfo[2].name).assertEqual("ohos.acts.bundle.stage.test.MainAbility10");
expect(data.hapModulesInfo[0].abilitiesInfo[2].orientation).assertEqual(bundle.DisplayOrientation.LOCKED);
......@@ -493,7 +493,7 @@ export default function getBundleInfoForSelf() {
expect(extensionList[i].labelId).assertLarger(0);
expect(extensionList[i].descriptionId).assertLarger(0);
expect(extensionList[i].iconId).assertLarger(0);
expect(extensionList[i].isVisible).assertTrue();
expect(extensionList[i].exported).assertTrue();
expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.FORM);
expect(extensionList[i].permissions.length).assertEqual(0);
expect(extensionList[i].applicationInfo).assertEqual(null);
......@@ -511,7 +511,7 @@ export default function getBundleInfoForSelf() {
expect(extensionList[i].labelId).assertLarger(0);
expect(extensionList[i].descriptionId).assertLarger(0);
expect(extensionList[i].iconId).assertLarger(0);
expect(extensionList[i].isVisible).assertTrue();
expect(extensionList[i].exported).assertTrue();
expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.FORM);
expect(extensionList[i].permissions.length).assertEqual(0);
expect(extensionList[i].applicationInfo).assertEqual(null);
......@@ -618,7 +618,7 @@ export default function getBundleInfoForSelf() {
expect(extensionList[i].labelId).assertLarger(0);
expect(extensionList[i].descriptionId).assertLarger(0);
expect(extensionList[i].iconId).assertLarger(0);
expect(extensionList[i].isVisible).assertTrue();
expect(extensionList[i].exported).assertTrue();
expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.FORM);
expect(extensionList[i].permissions.length).assertEqual(0);
expect(extensionList[i].applicationInfo).assertEqual(null);
......@@ -636,7 +636,7 @@ export default function getBundleInfoForSelf() {
expect(extensionList[i].labelId).assertLarger(0);
expect(extensionList[i].descriptionId).assertLarger(0);
expect(extensionList[i].iconId).assertLarger(0);
expect(extensionList[i].isVisible).assertTrue();
expect(extensionList[i].exported).assertTrue();
expect(extensionList[i].extensionAbilityType).assertEqual(bundle.ExtensionAbilityType.FORM);
expect(extensionList[i].permissions.length).assertEqual(0);
expect(extensionList[i].applicationInfo).assertEqual(null);
......@@ -1067,7 +1067,7 @@ export default function getBundleInfoForSelf() {
expect(data.icon).assertEqual("$media:icon");
expect(data.iconId).assertLarger(0);
expect(data.process).assertEqual("");
expect(data.isVisible).assertTrue();
expect(data.exported).assertTrue();
expect(data.type).assertEqual(1);
expect(data.permissions.length).assertEqual(0);
expect(data.readPermission).assertEqual("");
......
......@@ -890,7 +890,7 @@ describe('TextEncoderTest', function () {
var result = util.randomUUID(true);
expect(result.length).assertEqual(36);
})
/**
* @tc.name: testUtilRandomUUID002
* @tc.desc: Generate a random RFC 4122 version 4 UUID.
......@@ -950,6 +950,42 @@ describe('TextEncoderTest', function () {
expect(e.message).assertEqual('Syntax Error.Invalid 84Wdf796-66cc-4655-9b89-d6218d100f9c string');
}
})
/**
* @tc.name: testUtilgenerateRandomUUID001
* @tc.desc: Generate a random RFC 4122 version 4 UUID.
*/
it('testUtilgenerateRandomUUID001', 0, async function () {
var result = util.generateRandomUUID(true);
expect(result.length).assertEqual(36);
})
/**
* @tc.name: testUtilgenerateRandomUUID002
* @tc.desc: Generate a random RFC 4122 version 4 UUID.
*/
it('testUtilgenerateRandomUUID002', 0, async function () {
var result = util.generateRandomUUID(false);
expect(result.length).assertEqual(36);
})
/**
* @tc.name: testUtilgenerateRandomBinaryUUID001
* @tc.desc: Generate a random RFC 4122 version 4 UUID.
*/
it('testUtilgenerateRandomBinaryUUID001', 0, async function () {
var result = util.generateRandomBinaryUUID(true);
expect(result.length).assertEqual(16);
})
/**
* @tc.name: testUtilgenerateRandomBinaryUUID002
* @tc.desc: Generate a random RFC 4122 version 4 UUID.
*/
it('testUtilgenerateRandomBinaryUUID002', 0, async function () {
var result = util.generateRandomBinaryUUID(false);
expect(result.length).assertEqual(16);
})
})
describe('ScopeHelperTest', function () {
......@@ -3371,7 +3407,7 @@ describe('FunctionTest', function () {
})
/**
* @tc.name: testUtilformat001
* @tc.name: testUtilformatThrowError001
* @tc.desc: Returns the formatted string.
*/
it('testUtilformatThrowError001', 0, function () {
......@@ -3515,11 +3551,9 @@ describe('RationalNumberTest', function () {
* @tc.desc: Creates a RationalNumber object based on a given string.
*/
it('test_parseRationalNumber_001', 0, function () {
var pro = new util.RationalNumber()
pro.parseRationalNumber(1, 2)
var res = pro.createRationalFromString('+2:-4')
var result1 = res.valueOf()
expect(result1).assertEqual(-0.5)
var res = util.RationalNumber.parseRationalNumber(2, 1)
var result = res.valueOf()
expect(result).assertEqual(2)
})
/**
......@@ -3528,11 +3562,9 @@ describe('RationalNumberTest', function () {
*/
it('test_parseRationalNumberThrowError_001', 0, function () {
try {
var pro = new util.RationalNumber()
pro.parseRationalNumber('str', 2)
var res = pro.createRationalFromString('+2:-4')
var result1 = res.valueOf()
expect(result1).assertEqual(-0.5)
var pro = util.RationalNumber.parseRationalNumber('str', 2)
var result = res.valueOf()
expect(result).assertEqual(2)
} catch (e) {
expect(e.toString()).assertEqual("BusinessError: Parameter error.The type of str must be number");
}
......@@ -3543,11 +3575,9 @@ describe('RationalNumberTest', function () {
* @tc.desc: Creates a RationalNumber object based on a given string.
*/
it('test_createRationalFromString_001', 0, function () {
var pro = new util.RationalNumber()
pro.parseRationalNumber(1,2)
var res = pro.createRationalFromString('-1:2')
var result1 = res.valueOf()
expect(result1).assertEqual(-0.5)
var res = util.RationalNumber.createRationalFromString('-1:2')
var result = res.valueOf()
expect(result).assertEqual(-0.5)
})
/**
......@@ -3555,11 +3585,9 @@ describe('RationalNumberTest', function () {
* @tc.desc: Creates a RationalNumber object based on a given string.
*/
it('test_createRationalFromString_002', 0, function () {
var pro = new util.RationalNumber()
pro.parseRationalNumber(1,2)
var res = pro.createRationalFromString('+3/4')
var result1 = res.valueOf()
expect(result1).assertEqual(0.75)
var res = util.RationalNumber.createRationalFromString('+3/4')
var result = res.valueOf()
expect(result).assertEqual(0.75)
})
/**
......@@ -3567,11 +3595,9 @@ describe('RationalNumberTest', function () {
* @tc.desc: Creates a RationalNumber object based on a given string.
*/
it('test_createRationalFromString_003', 0, function () {
var pro = new util.RationalNumber()
pro.parseRationalNumber(1,2)
var res = pro.createRationalFromString('+3:-4')
var result1 = res.valueOf()
expect(result1).assertEqual(-0.75)
var res = util.RationalNumber.createRationalFromString('+3:-4')
var result = res.valueOf()
expect(result).assertEqual(-0.75)
})
/**
......@@ -3579,11 +3605,9 @@ describe('RationalNumberTest', function () {
* @tc.desc: Creates a RationalNumber object based on a given string.
*/
it('test_createRationalFromString_004', 0, function () {
var pro = new util.RationalNumber()
pro.parseRationalNumber(1,2)
var res = pro.createRationalFromString('+2:4')
var result1 = res.valueOf()
expect(result1).assertEqual(0.5)
var res = util.RationalNumber.createRationalFromString('+2:4')
var result = res.valueOf()
expect(result).assertEqual(0.5)
})
/**
......@@ -3591,11 +3615,9 @@ describe('RationalNumberTest', function () {
* @tc.desc: Creates a RationalNumber object based on a given string.
*/
it('test_createRationalFromString_005', 0, function () {
var pro = new util.RationalNumber()
pro.parseRationalNumber(1,2)
var res = pro.createRationalFromString('+2:-4')
var result1 = res.valueOf()
expect(result1).assertEqual(-0.5)
var res = util.RationalNumber.createRationalFromString('+2:-4')
var result = res.valueOf()
expect(result).assertEqual(-0.5)
})
/**
......@@ -3604,11 +3626,9 @@ describe('RationalNumberTest', function () {
*/
it('test_createRationalFromStringThrowError_001', 0, function () {
try {
var pro = new util.RationalNumber()
pro.parseRationalNumber(1, 2)
var res = pro.createRationalFromString(123)
var result1 = res.valueOf()
expect(result1).assertEqual(-0.5)
var res = util.RationalNumber.createRationalFromString(123)
var result = res.valueOf()
expect(result).assertEqual(-0.5)
} catch (e) {
expect(e.toString()).assertEqual("BusinessError: Parameter error.The type of 123 must be string");
}
......@@ -3619,10 +3639,8 @@ describe('RationalNumberTest', function () {
* @tc.desc: Compares the current RationalNumber object with a given object.
*/
it('test_compare_001', 0, function () {
var pro = new util.RationalNumber()
pro.parseRationalNumber(2, 1)
var proc = new util.RationalNumber()
proc.parseRationalNumber(3, 4)
var pro = util.RationalNumber.parseRationalNumber(2, 1)
var proc = util.RationalNumber.parseRationalNumber(3, 4)
var res = pro.compare(proc)
expect(res).assertEqual(1)
})
......@@ -3632,10 +3650,8 @@ describe('RationalNumberTest', function () {
* @tc.desc: Compares the current RationalNumber object with a given object.
*/
it('test_compare_002', 0, function () {
var pro = new util.RationalNumber()
pro.parseRationalNumber(2, 1)
var proc = new util.RationalNumber()
proc.parseRationalNumber(0, 0)
var pro = util.RationalNumber.parseRationalNumber(2, 1)
var proc = util.RationalNumber.parseRationalNumber(0, 0)
var res = pro.compare(proc)
expect(res).assertEqual(-1)
})
......@@ -3645,10 +3661,8 @@ describe('RationalNumberTest', function () {
* @tc.desc: Compares the current RationalNumber object with a given object.
*/
it('test_compare_003', 0, function () {
var pro = new util.RationalNumber()
pro.parseRationalNumber(2, 1)
var proc = new util.RationalNumber()
proc.parseRationalNumber(8, 3)
var pro = util.RationalNumber.parseRationalNumber(2, 1)
var proc = util.RationalNumber.parseRationalNumber(8, 3)
var res = pro.compare(proc)
expect(res).assertEqual(-1)
})
......@@ -3658,10 +3672,8 @@ describe('RationalNumberTest', function () {
* @tc.desc: Compares the current RationalNumber object with a given object.
*/
it('test_compare_004', 0, function () {
var pro = new util.RationalNumber()
pro.parseRationalNumber(2, 1)
var proc = new util.RationalNumber()
proc.parseRationalNumber(2, 1)
var pro = util.RationalNumber.parseRationalNumber(2, 1)
var proc = util.RationalNumber.parseRationalNumber(2, 1)
var res = pro.compare(proc)
expect(res).assertEqual(0)
})
......@@ -3671,10 +3683,8 @@ describe('RationalNumberTest', function () {
* @tc.desc: Compares the current RationalNumber object with a given object.
*/
it('test_compare_005', 0, function () {
var pro = new util.RationalNumber()
pro.parseRationalNumber(0, 0)
var proc = new util.RationalNumber()
proc.parseRationalNumber(2, 1)
var pro = util.RationalNumber.parseRationalNumber(0, 0)
var proc = util.RationalNumber.parseRationalNumber(2, 1)
var res = pro.compare(proc)
expect(res).assertEqual(1)
})
......@@ -3685,8 +3695,7 @@ describe('RationalNumberTest', function () {
*/
it('test_compareThrowError_001', 0, function () {
try {
var pro = new util.RationalNumber()
pro.parseRationalNumber(2, 1)
var pro = util.RationalNumber.parseRationalNumber(2, 1)
var proc = 'str'
var res = pro.compare(proc)
expect(res).assertEqual(1)
......@@ -3700,9 +3709,7 @@ describe('RationalNumberTest', function () {
* @tc.desc: Obtains the greatest common divisor of two specified numbers.
*/
it('testgetCommonFactor001', 0, function () {
var pro = new util.RationalNumber()
pro.parseRationalNumber(0, 0)
var res = pro.getCommonFactor(4, 8)
var res = util.RationalNumber.getCommonFactor(4, 8)
expect(res).assertEqual(4)
})
......@@ -3711,9 +3718,7 @@ describe('RationalNumberTest', function () {
* @tc.desc: Obtains the greatest common divisor of two specified numbers.
*/
it('testgetCommonFactor002', 0, function () {
var pro = new util.RationalNumber()
pro.parseRationalNumber(0, 0)
var res = pro.getCommonFactor(10, 15)
var res = util.RationalNumber.getCommonFactor(10, 15)
expect(res).assertEqual(5)
})
......@@ -3722,9 +3727,7 @@ describe('RationalNumberTest', function () {
* @tc.desc: Obtains the greatest common divisor of two specified numbers.
*/
it('testgetCommonFactor003', 0, function () {
var pro = new util.RationalNumber()
pro.parseRationalNumber(0, 0)
var res = pro.getCommonFactor(8, 4)
var res = util.RationalNumber.getCommonFactor(8, 4)
expect(res).assertEqual(4)
})
......@@ -3733,9 +3736,7 @@ describe('RationalNumberTest', function () {
* @tc.desc: Obtains the greatest common divisor of two specified numbers.
*/
it('testgetCommonFactor004', 0, function () {
var pro = new util.RationalNumber()
pro.parseRationalNumber(0, 0)
var res = pro.getCommonFactor(8, 16)
var res = util.RationalNumber.getCommonFactor(8, 16)
expect(res).assertEqual(8)
})
......@@ -3744,9 +3745,7 @@ describe('RationalNumberTest', function () {
* @tc.desc: Obtains the greatest common divisor of two specified numbers.
*/
it('testgetCommonFactor005', 0, function () {
var pro = new util.RationalNumber()
pro.parseRationalNumber(0, 0)
var res = pro.getCommonFactor(2, 16)
var res = util.RationalNumber.getCommonFactor(2, 16)
expect(res).assertEqual(2)
})
......@@ -3756,9 +3755,7 @@ describe('RationalNumberTest', function () {
*/
it('testgetCommonFactorThrowError001', 0, function () {
try {
var pro = new util.RationalNumber()
pro.parseRationalNumber(0, 0)
var res = pro.getCommonFactor('str', 8)
var res = util.RationalNumber.getCommonFactor('str', 8)
expect(res).assertEqual(4)
} catch (e) {
expect(e.toString()).assertEqual("BusinessError: Parameter error.The type of str must be number");
......@@ -4166,11 +4163,11 @@ describe('Base64HelperTest', function () {
})
/**
* @tc.name: test_encodeSync_base64_005
* @tc.name: test_encodeSync_base64_throwError_001
* @tc.desc: Asynchronously encodes all bytes in the specified u8 array into the newly allocated u8
array using the Base64 encoding scheme.
*/
it('test_encodeSync_base64_005', 0, async function () {
it('test_encodeSync_base64_throwError_001', 0, async function () {
try {
var that = new util.Base64Helper()
var array = new Uint32Array([66, 97, 115, 101, 54, 52]);
......@@ -4419,11 +4416,11 @@ describe('Base64HelperTest', function () {
})
/**
* @tc.name: test_decode_base64_011
* @tc.name: test_decode_base64_throwError_001
* @tc.desc: Use the Base64 encoding scheme to asynchronously decode a Base64-encoded string or input u8
array into a newly allocated u8 array.
*/
it('test_decode_base64_006', 0, async function () {
it('test_decode_base64_throwError_001', 0, async function () {
try {
var that = new util.Base64Helper()
var array = new Uint16Array([99,122,69,122]);
......@@ -4440,8 +4437,7 @@ describe('DecodeEncodeTest', function () {
* @tc.desc: The source encoding's name, lowercased.
*/
it('testencoding_textdecoder_001', 0, function () {
var that = new util.TextDecoder()
that.create('utf-8', { ignoreBOM : true })
var that = util.TextDecoder.create('utf-8', { ignoreBOM : true })
var retStr = that.encoding
expect(retStr).assertEqual('utf-8')
})
......@@ -4451,8 +4447,7 @@ describe('DecodeEncodeTest', function () {
* @tc.desc: The source encoding's name, lowercased.
*/
it('testencoding_textdecoder_002', 0, function () {
var that = new util.TextDecoder()
that.create('utf-16le')
var that = util.TextDecoder.create('utf-16le')
var encodingStr = that.encoding
expect(encodingStr).assertEqual('utf-16le')
})
......@@ -4462,8 +4457,7 @@ describe('DecodeEncodeTest', function () {
* @tc.desc: The source encoding's name, lowercased.
*/
it('testencoding_textdecoder_003', 0, function () {
var that = new util.TextDecoder()
that.create('utf-16be')
var that = util.TextDecoder.create('utf-16be')
var encodingStr = that.encoding
expect(encodingStr).assertEqual('utf-16be')
})
......@@ -4473,8 +4467,7 @@ describe('DecodeEncodeTest', function () {
* @tc.desc: The source encoding's name, lowercased.
*/
it('testencoding_textdecoder_004', 0, function () {
var that = new util.TextDecoder()
that.create('utf-16be', { ignoreBOM : true })
var that = util.TextDecoder.create('utf-16be', { ignoreBOM : true })
var encodingStr = that.encoding
expect(encodingStr).assertEqual('utf-16be')
})
......@@ -4484,8 +4477,7 @@ describe('DecodeEncodeTest', function () {
* @tc.desc: The source encoding's name, lowercased.
*/
it('testencoding_textdecoder_005', 0, function () {
var that = new util.TextDecoder()
that.create('utf-16be', { ignoreBOM : false })
var that = util.TextDecoder.create('utf-16be', { ignoreBOM : false })
var encodingStr = that.encoding
expect(encodingStr).assertEqual('utf-16be')
})
......@@ -4496,8 +4488,7 @@ describe('DecodeEncodeTest', function () {
*/
it('testencoding_textdecoder_ThrowError_001', 0, function () {
try {
var that = new util.TextDecoder()
that.create(123, { ignoreBOM : false })
var that = util.TextDecoder.create(123, { ignoreBOM : false })
var encodingStr = that.encoding
expect(encodingStr).assertEqual('utf-16be')
} catch (e) {
......@@ -4511,8 +4502,7 @@ describe('DecodeEncodeTest', function () {
*/
it('testencoding_textdecoder_ThrowError_002', 0, function () {
try {
var that = new util.TextDecoder()
that.create('utf-16be', 'ignoreBOM')
var that = util.TextDecoder.create('utf-16be', 'ignoreBOM')
var encodingStr = that.encoding
expect(encodingStr).assertEqual('utf-16be')
} catch (e) {
......@@ -4521,13 +4511,12 @@ describe('DecodeEncodeTest', function () {
})
/**
* @tc.name: testencoding_textdecoder_ThrowError_002
* @tc.name: testencoding_textdecoder_ThrowError_003
* @tc.desc: The source encoding's name, lowercased.
*/
it('testencoding_textdecoder_ThrowError_002', 0, function () {
it('testencoding_textdecoder_ThrowError_003', 0, function () {
try {
var that = new util.TextDecoder()
that.create('utf-16be', 123)
var that = util.TextDecoder.create('utf-16be', 123)
var encodingStr = that.encoding
expect(encodingStr).assertEqual('utf-16be')
} catch (e) {
......@@ -4652,7 +4641,7 @@ describe('DecodeEncodeTest', function () {
* @tc.name: testEncodeInto010
* @tc.desc: Returns the result of encoder for GB18030.
*/
it('testEncodeInto0010', 0, function () {
it('testEncodeInto010', 0, function () {
let that = new util.TextEncoder('GB18030')
let buffer = new ArrayBuffer(20)
let result = new Uint8Array(buffer)
......
......@@ -2403,8 +2403,7 @@ describe('RationalNumberFunTest', function () {
* @tc.desc: Creates a RationalNumber object based on a given string.
*/
it('test_createRationalFromString_001', 0, function () {
var pro = new util.RationalNumber(1, 2)
var res = pro.createRationalFromString('-1:2')
var res = util.RationalNumber.createRationalFromString('-1:2')
var result1 = res.valueOf()
expect(result1).assertEqual(-0.5)
})
......@@ -2414,8 +2413,7 @@ describe('RationalNumberFunTest', function () {
* @tc.desc: Creates a RationalNumber object based on a given string.
*/
it('test_createRationalFromString_002', 0, function () {
var pro = new util.RationalNumber(1, 2)
var res = pro.createRationalFromString('+3/4')
var res = util.RationalNumber.createRationalFromString('+3/4')
var result1 = res.valueOf()
expect(result1).assertEqual(0.75)
})
......@@ -2425,8 +2423,7 @@ describe('RationalNumberFunTest', function () {
* @tc.desc: Creates a RationalNumber object based on a given string.
*/
it('test_createRationalFromString_003', 0, function () {
var pro = new util.RationalNumber(1, 2)
var res = pro.createRationalFromString('+3:-4')
var res = util.RationalNumber.createRationalFromString('+3:-4')
var result1 = res.valueOf()
expect(result1).assertEqual(-0.75)
})
......@@ -2436,8 +2433,7 @@ describe('RationalNumberFunTest', function () {
* @tc.desc: Creates a RationalNumber object based on a given string.
*/
it('test_createRationalFromString_004', 0, function () {
var pro = new util.RationalNumber(1, 2)
var res = pro.createRationalFromString('+2:4')
var res = util.RationalNumber.createRationalFromString('+2:4')
var result1 = res.valueOf()
expect(result1).assertEqual(0.5)
})
......@@ -2447,10 +2443,9 @@ describe('RationalNumberFunTest', function () {
* @tc.desc: Creates a RationalNumber object based on a given string.
*/
it('test_createRationalFromString_005', 0, function () {
var pro = new util.RationalNumber(1, 2)
var res = pro.createRationalFromString('+2:-4')
var res = util.RationalNumber.createRationalFromString('-2:-4')
var result1 = res.valueOf()
expect(result1).assertEqual(-0.5)
expect(result1).assertEqual(0.5)
})
/**
......
......@@ -56,7 +56,7 @@ export default function pasteBoardTest(){
var systemPasteBoard = pasteboard.getSystemPasteboard();
await systemPasteBoard.clear().then(async () => {
let prop = pasteData.getProperty();
prop.shareOption = pasteboard.ShareOption.InApp;
prop.shareOption = pasteboard.ShareOption.INAPP;
pasteData.setProperty(prop);
var property = pasteData.getProperty();
expect(0).assertEqual(property.shareOption)
......@@ -78,7 +78,7 @@ export default function pasteBoardTest(){
var systemPasteBoard = pasteboard.getSystemPasteboard();
await systemPasteBoard.clear().then(async () => {
let prop = pasteData.getProperty();
prop.shareOption = pasteboard.ShareOption.LocalDevice;
prop.shareOption = pasteboard.ShareOption.LOCALDEVICE;
pasteData.setProperty(prop);
var property = pasteData.getProperty();
expect(1).assertEqual(property.shareOption)
......@@ -100,7 +100,7 @@ export default function pasteBoardTest(){
var systemPasteBoard = pasteboard.getSystemPasteboard();
await systemPasteBoard.clear().then(async () => {
let prop = pasteData.getProperty();
prop.shareOption = pasteboard.ShareOption.CrossDevice;
prop.shareOption = pasteboard.ShareOption.CROSSDEVICE;
pasteData.setProperty(prop);
var property = pasteData.getProperty();
expect(2).assertEqual(property.shareOption)
......@@ -206,17 +206,17 @@ export default function pasteBoardTest(){
})
/**
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0100
* @tc.name convertToTextV9
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0100
* @tc.name coerceToText
* @tc.desc Successfully cast string record to text
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0100', 0, async function (done) {
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0100 start")
it('SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0100', 0, async function (done) {
console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0100 start")
let pasteDataRecord = pasteboard.createRecord(pasteboard.MIMETYPE_TEXT_PLAIN,"valueType")
await pasteDataRecord.convertToTextV9((err, data) => {
await pasteDataRecord.coerceToText((err, data) => {
if(err != null){
console.info("Cast string record to text error, error message is: " + err)
expect(false).assertTrue();
......@@ -225,25 +225,25 @@ export default function pasteBoardTest(){
expect(data).assertEqual("valueType")
}
})
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0100 end")
console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0100 end")
done();
})
/**
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0200
* @tc.name convertToTextV9
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0200
* @tc.name coerceToText
* @tc.desc Successfully cast pixelMap record to text
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0200', 0, async function (done) {
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0200 start")
it('SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0200', 0, async function (done) {
console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0200 start")
let pasteDataRecord =undefined;
await image.createPixelMap(color, opt).then((pixelMap) => {
pasteDataRecord = pasteboard.createRecord(pasteboard.MIMETYPE_PIXELMAP,pixelMap);
})
await pasteDataRecord.convertToTextV9((err, data) => {
await pasteDataRecord.coerceToText((err, data) => {
if(err != null){
console.info("Cast pixelMap record to text error, error message is: " + err)
expect(false).assertTrue();
......@@ -252,22 +252,22 @@ export default function pasteBoardTest(){
expect(data).assertEqual("")
}
})
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0200 end")
console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0200 end")
done();
})
/**
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0300
* @tc.name convertToTextV9
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0300
* @tc.name coerceToText
* @tc.desc Successfully cast want record to text
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0300', 0, async function (done) {
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0300 start")
it('SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0300', 0, async function (done) {
console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0300 start")
let pasteDataRecord = pasteboard.createRecord(pasteboard.MIMETYPE_TEXT_WANT,WANT)
await pasteDataRecord.convertToTextV9((err, data) => {
await pasteDataRecord.coerceToText((err, data) => {
if(err != null){
console.info("Cast want record to text error, error message is: " + err)
expect(false).assertTrue();
......@@ -276,22 +276,22 @@ export default function pasteBoardTest(){
expect(data).assertEqual("")
}
})
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0300 end")
console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0300 end")
done();
})
/**
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0400
* @tc.name convertToTextV9
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0400
* @tc.name coerceToText
* @tc.desc Successfully cast arrayBuffer record to text
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0400', 0, async function (done) {
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0400 start")
it('SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0400', 0, async function (done) {
console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0400 start")
let pasteDataRecord = pasteboard.createRecord("ArrayBuffer",ARRAY_BUFFER)
await pasteDataRecord.convertToTextV9((err, data) => {
await pasteDataRecord.coerceToText((err, data) => {
if(err != null){
console.info("Cast arrayBuffer record to text error, error message is: " + err)
expect(false).assertTrue();
......@@ -300,23 +300,23 @@ export default function pasteBoardTest(){
expect(data).assertEqual("")
}
})
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0400 end")
console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0400 end")
done();
})
/**
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0500
* @tc.name convertToTextV9
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0500
* @tc.name coerceToText
* @tc.desc Cast arrayBuffer record to text failed,
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0500', 0, async function (done) {
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0500 start")
it('SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0500', 0, async function (done) {
console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0500 start")
let pasteDataRecord = pasteboard.createRecord("string",ARRAY_BUFFER)
function convert(callBack){
pasteDataRecord.convertToTextV9(callBack)
pasteDataRecord.coerceToText(callBack)
}
try{
convert("callback")
......@@ -326,98 +326,98 @@ export default function pasteBoardTest(){
expect(err.code).assertEqual("401")
}
expect(error != undefined).assertTrue();
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_CALLBACK_0500 end")
console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_CALLBACK_0500 end")
done();
})
/**
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_PROMISE_0100
* @tc.name convertToTextV9
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_PROMISE_0100
* @tc.name coerceToText
* @tc.desc Successfully cast string record to text
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_PROMISE_0100', 0, async function (done) {
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_PROMISE_0100 start")
it('SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_PROMISE_0100', 0, async function (done) {
console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_PROMISE_0100 start")
let pasteDataRecord = pasteboard.createRecord(pasteboard.MIMETYPE_TEXT_PLAIN,"valueType")
await pasteDataRecord.convertToTextV9().then((data) => {
await pasteDataRecord.coerceToText().then((data) => {
console.info("Cast string record to text success,result is: " + data)
expect(data).assertEqual("valueType")
}).catch((err) => {
console.info("Cast string record to text error, error message is: " + err)
expect(false).assertTrue();
})
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_PROMISE_0100 end")
console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_PROMISE_0100 end")
done();
})
/**
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_PROMISE_0200
* @tc.name convertToTextV9
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_PROMISE_0200
* @tc.name coerceToText
* @tc.desc Successfully cast pixelMap record to text
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_PROMISE_0200', 0, async function (done) {
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_PROMISE_0200 start")
it('SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_PROMISE_0200', 0, async function (done) {
console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_PROMISE_0200 start")
let pasteDataRecord =undefined;
await image.createPixelMap(color, opt).then((pixelMap) => {
pasteDataRecord = pasteboard.createRecord(pasteboard.MIMETYPE_PIXELMAP,pixelMap);
})
await pasteDataRecord.convertToTextV9().then((data) => {
await pasteDataRecord.coerceToText().then((data) => {
console.info("Cast pixelMap record to text success,result is: " + data)
expect(data).assertEqual("")
}).catch((err) => {
console.info("Cast pixelMap record to text error, error message is: " + err)
expect(false).assertTrue();
})
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_PROMISE_0200 end")
console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_PROMISE_0200 end")
done();
})
/**
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_PROMISE_0300
* @tc.name convertToTextV9
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_PROMISE_0300
* @tc.name coerceToText
* @tc.desc Successfully cast want record to text
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_PROMISE_0300', 0, async function (done) {
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_PROMISE_0300 start")
it('SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_PROMISE_0300', 0, async function (done) {
console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_PROMISE_0300 start")
let pasteDataRecord = pasteboard.createRecord(pasteboard.MIMETYPE_TEXT_WANT,WANT)
await pasteDataRecord.convertToTextV9().then((data) => {
await pasteDataRecord.coerceToText().then((data) => {
console.info("Cast want record to text success,result is: " + data)
expect(data).assertEqual("")
}).catch(err => {
console.info("Cast want record to text error, error message is: " + err)
expect(false).assertTrue();
})
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_PROMISE_0300 end")
console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_PROMISE_0300 end")
done();
})
/**
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_PROMISE_0400
* @tc.name convertToTextV9
* @tc.number SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_PROMISE_0400
* @tc.name coerceToText
* @tc.desc Successfully cast arrayBuffer record to text
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it('SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_PROMISE_0400', 0, async function (done) {
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_PROMISE_0400 start")
it('SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_PROMISE_0400', 0, async function (done) {
console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_PROMISE_0400 start")
let pasteDataRecord = pasteboard.createRecord("ArrayBuffer",ARRAY_BUFFER)
await pasteDataRecord.convertToTextV9().then((data) => {
await pasteDataRecord.coerceToText().then((data) => {
console.info("Cast arrayBuffer record to text success,result is: " + data)
expect(data).assertEqual("")
}).catch(err => {
console.info("Cast arrayBuffer record to text error, error message is: " + err)
expect(false).assertTrue();
})
console.info("SUB_PASTEBOARD_FUNCTION_ETS_CONVERTTOTEXTV9_PROMISE_0400 end")
console.info("SUB_PASTEBOARD_FUNCTION_ETS_COERCETOTEXT_PROMISE_0400 end")
done();
})
......
......@@ -426,7 +426,7 @@ describe('HidebugJsTest', function () {
}
hidebug.stopJsCpuProfiling();
var pid = process.pid;
let path = "/proc/" + pid + "/root/data/storage/el2/base/files/" + filename + ".cpuprofile";
let path = "/proc/" + pid + "/root/data/storage/el2/base/files/" + filename + ".json";
let data = fileio.readTextSync(path);
if (data.includes("napi")) {
expect(true).assertTrue();
......
......@@ -17,7 +17,7 @@ import audio from '@ohos.multimedia.audio';
import fileio from '@ohos.fileio';
import featureAbility from '@ohos.ability.featureAbility';
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it } from '@ohos/hypium';
import { UiDriver, BY } from '@ohos.uitest'
import { UiDriver, BY } from '@ohos.UiTest'
export default function audioCapturer() {
describe('audioCapturer', function () {
......
......@@ -16,7 +16,7 @@
import audio from '@ohos.multimedia.audio';
import featureAbility from '@ohos.ability.featureAbility';
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it } from '@ohos/hypium';
import { UiDriver, BY } from '@ohos.uitest'
import { UiDriver, BY } from '@ohos.UiTest'
export default function audioCapturerChange() {
describe('audioCapturerChange', function () {
......
......@@ -16,7 +16,7 @@
import audio from '@ohos.multimedia.audio';
import featureAbility from '@ohos.ability.featureAbility';
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it } from '@ohos/hypium';
import { UiDriver, BY } from '@ohos.uitest'
import { UiDriver, BY } from '@ohos.UiTest'
export default function audioFramework() {
......
......@@ -18,7 +18,7 @@ import fileio from '@ohos.fileio';
import featureAbility from '@ohos.ability.featureAbility'
import resourceManager from '@ohos.resourceManager';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import { UiDriver, BY} from '@ohos.uitest'
import { UiDriver, BY} from '@ohos.UiTest'
export default function audioVoip() {
describe('audioVoip', function () {
......
......@@ -19,7 +19,7 @@ import router from '@system.router'
import mediaLibrary from '@ohos.multimedia.mediaLibrary'
import fileio from '@ohos.fileio'
import featureAbility from '@ohos.ability.featureAbility'
import { UiDriver, BY, PointerMatrix } from '@ohos.uitest'
import { UiDriver, BY, PointerMatrix } from '@ohos.UiTest'
const context = featureAbility.getContext();
......
......@@ -15,7 +15,7 @@
import mediaLibrary from "@ohos.multimedia.mediaLibrary";
import abilityAccessCtrl from "@ohos.abilityAccessCtrl";
import bundle from "@ohos.bundle";
import uitest from "@ohos.uitest";
import uitest from "@ohos.UiTest";
const presetsCount = {
ActsMediaLibraryAlbumTest: { albumsCount: 15, assetsCount: 27 },
ActsMediaLibraryBaseTest: { albumsCount: 11, assetsCount: 14 },
......
......@@ -12,7 +12,7 @@ import {
ResizeDirection,
WindowMode,
PointerMatrix,
} from "@ohos.uitest";
} from "@ohos.UiTest";
export default class MainAbility extends Ability {
onCreate(want, launchParam) {
// Ability is creating, initialize resources for this ability
......
......@@ -105,7 +105,6 @@ export default function ActscommonEventSupportTest() {
console.info(`${TAG} SUB_NOTIFICATION_CES_SUPPORT_ENUM_TEST_0600 START`)
expect(commonEvent.Support.COMMON_EVENT_PACKAGE_RESTARTED).assertEqual('usual.event.PACKAGE_RESTARTED')
expect(commonEvent.Support.COMMON_EVENT_PACKAGE_DATA_CLEARED).assertEqual('usual.event.PACKAGE_DATA_CLEARED')
expect(commonEvent.Support.COMMON_EVENT_PACKAGE_CACHE_CLEARED).assertEqual('usual.event.PACKAGE_CACHE_CLEARED')
expect(commonEvent.Support.COMMON_EVENT_PACKAGES_SUSPENDED).assertEqual('usual.event.PACKAGES_SUSPENDED')
expect(commonEvent.Support.COMMON_EVENT_PACKAGES_UNSUSPENDED).assertEqual('usual.event.PACKAGES_UNSUSPENDED')
expect(commonEvent.Support.COMMON_EVENT_MY_PACKAGE_SUSPENDED).assertEqual('usual.event.MY_PACKAGE_SUSPENDED')
......@@ -317,8 +316,6 @@ export default function ActscommonEventSupportTest() {
*/
it('SUB_NOTIFICATION_CES_SUPPORT_ENUM_TEST_1800', 0, async function () {
console.info(`${TAG} SUB_NOTIFICATION_CES_SUPPORT_ENUM_TEST_1800 START`)
expect(commonEvent.Support.COMMON_EVENT_USB_STATE).assertEqual('usual.event.hardware.usb.action.USB_STATE')
expect(commonEvent.Support.COMMON_EVENT_USB_PORT_CHANGED).assertEqual('usual.event.hardware.usb.action.USB_PORT_CHANGED')
expect(commonEvent.Support.COMMON_EVENT_USB_DEVICE_ATTACHED).assertEqual('usual.event.hardware.usb.action.USB_DEVICE_ATTACHED')
expect(commonEvent.Support.COMMON_EVENT_USB_DEVICE_DETACHED).assertEqual('usual.event.hardware.usb.action.USB_DEVICE_DETACHED')
expect(commonEvent.Support.COMMON_EVENT_USB_ACCESSORY_ATTACHED).assertEqual('usual.event.hardware.usb.action.USB_ACCESSORY_ATTACHED')
......@@ -339,11 +336,6 @@ export default function ActscommonEventSupportTest() {
expect(commonEvent.Support.COMMON_EVENT_DISK_BAD_REMOVAL).assertEqual('usual.event.data.DISK_BAD_REMOVAL')
expect(commonEvent.Support.COMMON_EVENT_DISK_UNMOUNTABLE).assertEqual('usual.event.data.DISK_UNMOUNTABLE')
expect(commonEvent.Support.COMMON_EVENT_DISK_EJECT).assertEqual('usual.event.data.DISK_EJECT')
expect(commonEvent.Support.COMMON_EVENT_VOLUME_REMOVED).assertEqual('usual.event.data.VOLUME_REMOVED')
expect(commonEvent.Support.COMMON_EVENT_VOLUME_UNMOUNTED).assertEqual('usual.event.data.VOLUME_UNMOUNTED')
expect(commonEvent.Support.COMMON_EVENT_VOLUME_MOUNTED).assertEqual('usual.event.data.VOLUME_MOUNTED')
expect(commonEvent.Support.COMMON_EVENT_VOLUME_BAD_REMOVAL).assertEqual('usual.event.data.VOLUME_BAD_REMOVAL')
expect(commonEvent.Support.COMMON_EVENT_VOLUME_EJECT).assertEqual('usual.event.data.VOLUME_EJECT')
expect(commonEvent.Support.COMMON_EVENT_VISIBLE_ACCOUNTS_UPDATED ).assertEqual('usual.event.data.VISIBLE_ACCOUNTS_UPDATED')
expect(commonEvent.Support.COMMON_EVENT_ACCOUNT_DELETED).assertEqual('usual.event.data.ACCOUNT_DELETED')
console.info(`${TAG} SUB_NOTIFICATION_CES_SUPPORT_ENUM_TEST_1900 END`)
......@@ -359,9 +351,6 @@ export default function ActscommonEventSupportTest() {
expect(commonEvent.Support.COMMON_EVENT_FOUNDATION_READY).assertEqual('common.event.FOUNDATION_READY')
expect(commonEvent.Support.COMMON_EVENT_AIRPLANE_MODE_CHANGED).assertEqual('usual.event.AIRPLANE_MODE')
expect(commonEvent.Support.COMMON_EVENT_SPLIT_SCREEN).assertEqual('common.event.SPLIT_SCREEN')
expect(commonEvent.Support.COMMON_EVENT_SLOT_CHANGE).assertEqual('usual.event.SLOT_CHANGE')
expect(commonEvent.Support.COMMON_EVENT_SPN_INFO_CHANGED).assertEqual('usual.event.SPN_INFO_CHANGED')
expect(commonEvent.Support.COMMON_EVENT_QUICK_FIX_APPLY_RESULT).assertEqual('usual.event.QUICK_FIX_APPLY_RESULT')
console.info(`${TAG} SUB_NOTIFICATION_CES_SUPPORT_ENUM_TEST_2000 END`)
})
......
......@@ -1009,8 +1009,8 @@ describe("SensorJsTest_sensor_1", function () {
it('SensorJsTest_107', TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info("---------------------------SensorJsTest_107----------------------------------");
sensor.transformCoordinateSystem([1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5], {
'axisX': 1,
'axisY': 2
'x': 1,
'y': 2
}, (error, data) => {
if (error) {
console.info('SensorJsTest_107 failed');
......@@ -1031,7 +1031,7 @@ describe("SensorJsTest_sensor_1", function () {
it('SensorJsTest_108', TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info("---------------------------SensorJsTest_108----------------------------------");
sensor.transformCoordinateSystem([3.40282e+38, 3.40282e+38, 3.40282e+38, 3.40282e+38, 3.40282e+38, 3.40282e+38,
3.40282e+38, 3.40282e+38, 3.40282e+38], { 'axisX': 1, 'axisY': 2 }, (error, data) => {
3.40282e+38, 3.40282e+38, 3.40282e+38], { 'x': 1, 'y': 2 }, (error, data) => {
if (error) {
console.info('SensorJsTest_108 failed');
expect(false).assertTrue();
......@@ -1051,8 +1051,8 @@ describe("SensorJsTest_sensor_1", function () {
it("SensorJsTest_109", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info("---------------------------SensorJsTest_109----------------------------------");
sensor.transformCoordinateSystem([1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5], {
'axisX': 1,
'axisY': 2
'x': 1,
'y': 2
}).then((data) => {
for (let i = 0; i < data.length; i++) {
console.info("SensorJsTest_109 data[ " + i + "] = " + data[i]);
......@@ -1074,7 +1074,7 @@ describe("SensorJsTest_sensor_1", function () {
it("SensorJsTest_110", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info("---------------------------SensorJsTest_110----------------------------------");
sensor.transformCoordinateSystem([3.40282e+39, 3.40282e+39, 3.40282e+39, 3.40282e+39, 3.40282e+39,
3.40282e+39, 3.40282e+39, 3.40282e+39, 3.40282e+39], { 'axisX': 1, 'axisY': 3 }).then((data) => {
3.40282e+39, 3.40282e+39, 3.40282e+39, 3.40282e+39], { 'x': 1, 'y': 3 }).then((data) => {
for (let i = 0; i < data.length; i++) {
console.info("SensorJsTest_110 data[ " + i + "] = " + data[i]);
expect(data[i]).assertEqual(transformCoordinateSystemResult[2][i]);
......
......@@ -66,7 +66,7 @@ describe("SensorJsTest_sensor_39", function () {
})
const PARAMETER_ERROR_CODE = 401
const SERVICE_EXCEPTION_CODE = 141000101
const SERVICE_EXCEPTION_CODE = 14500101
const PARAMETER_ERROR_MSG = 'The parameter invalid.'
const SERVICE_EXCEPTION_MSG = 'Service exception.'
let invalid = -1;
......
......@@ -2916,7 +2916,7 @@ describe("SensorJsTest_sensor_60", function () {
*/
it('Sensor_TransformCoordinateSystem_001', 0, async function (done) {
console.info("---------------------------Sensor_TransformCoordinateSystem_001----------------------------------");
sensor.transformRotationMatrix([1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5], {'axisX':1, 'axisY':2}, (error, data) => {
sensor.transformRotationMatrix([1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5], {'x':1, 'y':2}, (error, data) => {
if (error) {
console.info('Sensor_TransformCoordinateSystem_001 failed');
expect(false).assertTrue();
......@@ -2936,7 +2936,7 @@ describe("SensorJsTest_sensor_60", function () {
it('Sensor_TransformCoordinateSystem_002', 0, async function (done) {
console.info("---------------------------Sensor_TransformCoordinateSystem_002----------------------------------");
sensor.transformRotationMatrix([3.40282e+38, 3.40282e+38, 3.40282e+38, 3.40282e+38,
3.40282e+38, 3.40282e+38, 3.40282e+38, 3.40282e+38, 3.40282e+38], {'axisX':1, 'axisY':2}, (error, data) => {
3.40282e+38, 3.40282e+38, 3.40282e+38, 3.40282e+38, 3.40282e+38], {'x':1, 'y':2}, (error, data) => {
if (error) {
console.info('Sensor_TransformCoordinateSystem_002 failed');
expect(false).assertTrue();
......@@ -2955,7 +2955,7 @@ describe("SensorJsTest_sensor_60", function () {
*/
it("Sensor_TransformCoordinateSystem_003", 0, async function (done) {
console.info("---------------------------Sensor_TransformCoordinateSystem_003----------------------------------");
sensor.transformRotationMatrix([1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5], {'axisX':1, 'axisY':2}).then((data) => {
sensor.transformRotationMatrix([1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5], {'x':1, 'y':2}).then((data) => {
for (var i = 0; i < data.length; i++) {
console.info("Sensor_TransformCoordinateSystem_003 data[ " + i + "] = " + data[i]);
expect(data[i]).assertEqual(transformCoordinateSystemResult[0][i]);
......@@ -2976,7 +2976,7 @@ describe("SensorJsTest_sensor_60", function () {
it("Sensor_TransformCoordinateSystem_004", 0, async function (done) {
console.info("---------------------------Sensor_TransformCoordinateSystem_004----------------------------------");
sensor.transformRotationMatrix([3.40282e+39, 3.40282e+39, 3.40282e+39, 3.40282e+39, 3.40282e+39,
3.40282e+39, 3.40282e+39, 3.40282e+39, 3.40282e+39],{'axisX':1, 'axisY':3}).then((data) => {
3.40282e+39, 3.40282e+39, 3.40282e+39, 3.40282e+39],{'x':1, 'y':3}).then((data) => {
for (var i = 0; i < data.length; i++) {
console.info("Sensor_TransformCoordinateSystem_004 data[ " + i + "] = " + data[i]);
expect(data[i]).assertEqual(transformCoordinateSystemResult[2][i]);
......@@ -3093,7 +3093,7 @@ describe("SensorJsTest_sensor_60", function () {
console.info('Sensor_TransformCoordinateSystem_008 start')
try {
sensor.transformRotationMatrix([0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
{'axisX':1, 'axisY':1}).then((data)=>{
{'x':1, 'y':1}).then((data)=>{
console.info("Sensor_TransformCoordinateSystem_009" + data)
expect(true).assertfalse()
done()
......@@ -3119,7 +3119,7 @@ describe("SensorJsTest_sensor_60", function () {
console.info('Sensor_TransformCoordinateSystem_010 start')
try {
sensor.transformRotationMatrix([0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
{'axisX':1, 'axisY':1}, (error, data) => {
{'x':1, 'y':1}, (error, data) => {
if (error) {
console.info('Sensor_TransformCoordinateSystem_010 failed');
expect(false).assertTrue();
......
......@@ -17,7 +17,7 @@ import contact from '@ohos.contact';
import sms from '@ohos.telephony.sms';
import featureAbility from '@ohos.ability.featureAbility';
import { afterAll, beforeAll, describe, expect, it } from '@ohos/hypium';
import { BY, UiDriver } from '@ohos.uitest';
import { BY, UiDriver } from '@ohos.UiTest';
export default function ObjectInterfaceTest() {
......
......@@ -35,7 +35,7 @@ export default function Telephony_NetworkManagerRegisterTest() {
console.log("Telephony_NetworkManager_register_Async_0100 register ");
if (error) {
console.info(caseName + " register fail: " + JSON.stringify(error));
expect().assertFail();
expect(true).assertFalse();
done();
return;
}
......@@ -57,7 +57,7 @@ export default function Telephony_NetworkManagerRegisterTest() {
console.log("Telephony_NetworkManager_register_Async_0100 unregister ");
if (error) {
console.info(caseName + " register fail: " + JSON.stringify(error));
expect().assertFail();
expect(true).assertFalse();
done();
}
done();
......@@ -106,7 +106,7 @@ export default function Telephony_NetworkManagerRegisterTest() {
netConn.unregister((error) => {
if (error) {
console.info(caseName + " unregisterresult: " + JSON.stringify(error));
expect().assertFail();
expect(true).assertFalse();
done();
}
done();
......@@ -158,7 +158,7 @@ export default function Telephony_NetworkManagerRegisterTest() {
netConn.unregister((error) => {
if (error) {
console.info(caseName + " unregister result: " + JSON.stringify(error));
expect().assertFail();
expect(true).assertFalse();
done();
}
done();
......@@ -210,7 +210,7 @@ export default function Telephony_NetworkManagerRegisterTest() {
netConn.unregister((error) => {
if (error) {
console.info(caseName + " unregisterresult: " + JSON.stringify(error));
expect().assertFail();
expect(true).assertFalse();
done();
}
done();
......@@ -262,7 +262,7 @@ export default function Telephony_NetworkManagerRegisterTest() {
netConn.unregister((error) => {
if (error) {
console.info(caseName + " unregister result: " + JSON.stringify(error));
expect().assertFail();
expect(true).assertFalse();
done();
}
done();
......@@ -314,7 +314,7 @@ export default function Telephony_NetworkManagerRegisterTest() {
netConn.unregister((error) => {
if (error) {
console.info(caseName + " unregisterresult: " + JSON.stringify(error));
expect().assertFail();
expect(true).assertFalse();
done();
}
done();
......@@ -366,7 +366,7 @@ export default function Telephony_NetworkManagerRegisterTest() {
netConn.unregister((error) => {
if (error) {
console.info(caseName + " unregister result: " + JSON.stringify(error));
expect().assertFail();
expect(true).assertFalse();
done();
}
done();
......@@ -418,7 +418,7 @@ export default function Telephony_NetworkManagerRegisterTest() {
netConn.unregister((error) => {
if (error) {
console.info(caseName + " unregister result: " + JSON.stringify(error));
expect().assertFail();
expect(true).assertFalse();
done();
}
done();
......@@ -469,7 +469,7 @@ export default function Telephony_NetworkManagerRegisterTest() {
netConn.unregister((error) => {
if (error) {
console.info(caseName + " unregister result: " + JSON.stringify(error));
expect().assertFail();
expect(true).assertFalse();
done();
}
done();
......@@ -521,7 +521,7 @@ export default function Telephony_NetworkManagerRegisterTest() {
netConn.unregister((error) => {
if (error) {
console.info(caseName + " unregister result: " + JSON.stringify(error));
expect().assertFail();
expect(true).assertFalse();
done();
}
done();
......@@ -574,7 +574,7 @@ export default function Telephony_NetworkManagerRegisterTest() {
netConn.unregister((error) => {
if (error) {
console.info(caseName + " unregister result: " + JSON.stringify(error));
expect().assertFail();
expect(true).assertFalse();
done();
}
done();
......@@ -627,7 +627,7 @@ export default function Telephony_NetworkManagerRegisterTest() {
netConn.unregister((error) => {
if (error) {
console.info(caseName + " unregister result: " + JSON.stringify(error));
expect().assertFail();
expect(true).assertFalse();
done();
}
done();
......@@ -681,7 +681,7 @@ export default function Telephony_NetworkManagerRegisterTest() {
netConn.unregister((error) => {
if (error) {
console.info(caseName + " unregister result: " + JSON.stringify(error));
expect().assertFail();
expect(true).assertFalse();
done();
}
done();
......@@ -735,7 +735,7 @@ export default function Telephony_NetworkManagerRegisterTest() {
netConn.unregister((error) => {
if (error) {
console.info(caseName + " unregister result: " + JSON.stringify(error));
expect().assertFail();
expect(true).assertFalse();
done();
}
done();
......@@ -788,7 +788,7 @@ export default function Telephony_NetworkManagerRegisterTest() {
netConn.unregister((error) => {
if (error) {
console.info(caseName + " unregister result: " + JSON.stringify(error));
expect().assertFail();
expect(true).assertFalse();
done();
}
done();
......@@ -842,7 +842,7 @@ export default function Telephony_NetworkManagerRegisterTest() {
netConn.unregister((error) => {
if (error) {
console.info(caseName + " unregister result: " + JSON.stringify(error));
expect().assertFail();
expect(true).assertFalse();
done();
}
done();
......@@ -895,7 +895,7 @@ export default function Telephony_NetworkManagerRegisterTest() {
netConn.unregister((error) => {
if (error) {
console.info(caseName + " unregister result: " + JSON.stringify(error));
expect().assertFail();
expect(true).assertFalse();
done();
}
done();
......@@ -930,7 +930,7 @@ export default function Telephony_NetworkManagerRegisterTest() {
netConn.unregister((error) => {
if (error) {
console.info(caseName + " unregister result: " + JSON.stringify(error));
expect().assertFail();
expect(true).assertFalse();
done();
return;
}
......@@ -944,7 +944,7 @@ export default function Telephony_NetworkManagerRegisterTest() {
netConn1.unregister((error) => {
if (error) {
console.info(caseName + " unregister result: " + JSON.stringify(error));
expect().assertFail();
expect(true).assertFalse();
done();
}
done();
......@@ -981,7 +981,7 @@ export default function Telephony_NetworkManagerRegisterTest() {
netConn.unregister((error) => {
if (error) {
console.info(caseName + " unregister result: " + JSON.stringify(error));
expect().assertFail();
expect(true).assertFalse();
done();
}
done();
......@@ -1034,7 +1034,7 @@ export default function Telephony_NetworkManagerRegisterTest() {
netConn.unregister((error) => {
if (error) {
console.info(caseName + " unregister fail " + error);
expect().assertFail();
expect(true).assertFalse();
done();
}
done();
......@@ -1068,7 +1068,7 @@ export default function Telephony_NetworkManagerRegisterTest() {
netConn.unregister((error) => {
if (error) {
console.info(caseName + " unregister result: " + JSON.stringify(error));
expect().assertFail();
expect(true).assertFalse();
done();
return;
}
......@@ -1084,14 +1084,14 @@ export default function Telephony_NetworkManagerRegisterTest() {
netConn1.register(function (error) {
if (error) {
console.info(caseName + " register fail: " + JSON.stringify(error));
expect().assertFail();
expect(true).assertFalse();
done();
return;
}
netConn1.unregister((error) => {
if (error) {
console.info(caseName + " unregister result: " + JSON.stringify(error));
expect().assertFail();
expect(true).assertFalse();
done();
}
done();
......@@ -1127,7 +1127,7 @@ export default function Telephony_NetworkManagerRegisterTest() {
netConn.unregister((error) => {
if (error) {
console.info(caseName + " unregister result: " + JSON.stringify(error));
expect().assertFail();
expect(true).assertFalse();
done();
return;
}
......@@ -1143,14 +1143,14 @@ export default function Telephony_NetworkManagerRegisterTest() {
netConn1.register(function (error) {
if (error) {
console.info(caseName + " register fail: " + JSON.stringify(error));
expect().assertFail();
expect(true).assertFalse();
done();
return;
}
netConn1.unregister((error) => {
if (error) {
console.info(caseName + " unregister result: " + JSON.stringify(error));
expect().assertFail();
expect(true).assertFalse();
done();
}
done();
......@@ -1172,7 +1172,7 @@ export default function Telephony_NetworkManagerRegisterTest() {
netConn.register(function (error) {
if (error) {
console.info(caseName + " register fail: " + JSON.stringify(error));
expect().assertFail();
expect(true).assertFalse();
done();
return;
}
......@@ -1197,7 +1197,7 @@ export default function Telephony_NetworkManagerRegisterTest() {
netConn.unregister((error) => {
if (error) {
console.info(caseName + " unregister result: " + JSON.stringify(error));
expect().assertFail();
expect(true).assertFalse();
done();
}
done();
......@@ -1249,7 +1249,7 @@ export default function Telephony_NetworkManagerRegisterTest() {
netConn.unregister((error) => {
if (error) {
console.info(caseName + " unregister result: " + JSON.stringify(error));
expect().assertFail();
expect(true).assertFalse();
done();
}
done();
......@@ -1270,7 +1270,7 @@ export default function Telephony_NetworkManagerRegisterTest() {
netConn.register(function (error) {
if (error) {
console.info(caseName + " register fail: " + JSON.stringify(error));
expect().assertFail();
expect(true).assertFalse();
done();
return;
}
......@@ -1295,7 +1295,7 @@ export default function Telephony_NetworkManagerRegisterTest() {
netConn.unregister((error) => {
if (error) {
console.info(caseName + " unregister result: " + JSON.stringify(error));
expect().assertFail();
expect(true).assertFalse();
done();
}
done();
......@@ -1315,7 +1315,7 @@ export default function Telephony_NetworkManagerRegisterTest() {
netConn.register(function (error) {
if (error) {
console.info(caseName + " register fail: " + JSON.stringify(error));
expect().assertFail();
expect(true).assertFalse();
done();
return;
}
......@@ -1341,7 +1341,7 @@ export default function Telephony_NetworkManagerRegisterTest() {
netConn.unregister((error) => {
if (error) {
console.info(caseName + " unregister result: " + JSON.stringify(error));
expect().assertFail();
expect(true).assertFalse();
done();
}
done();
......
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import { UiDriver } from '@ohos.uitest'
import { UiDriver } from '@ohos.UiTest'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import prompt from '@ohos.prompt'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册