提交 1f76cb71 编写于 作者: G guoenquan

Change test cover of Page

Signed-off-by: Nguoenquan <guoenquan1@huawei-partners.com>
上级 98b1ed51
...@@ -40,6 +40,7 @@ struct promptExample { ...@@ -40,6 +40,7 @@ struct promptExample {
], ],
success: function(data) { success: function(data) {
console.log('dialog success callback,click button : ' + data.tapIndex); console.log('dialog success callback,click button : ' + data.tapIndex);
Utils.emitEvent(this.text,404)
}, },
fail: function(data) { fail: function(data) {
console.log('dialog fail callback' + data.errMsg); console.log('dialog fail callback' + data.errMsg);
...@@ -63,6 +64,7 @@ struct promptExample { ...@@ -63,6 +64,7 @@ struct promptExample {
], ],
success: function(data) { success: function(data) {
console.log('dialog success callback,click button : ' + data.index); console.log('dialog success callback,click button : ' + data.index);
Utils.emitEvent(this.text,404)
}, },
cancel: function() { cancel: function() {
console.log('dialog cancel callback'); console.log('dialog cancel callback');
...@@ -97,7 +99,6 @@ struct promptExample { ...@@ -97,7 +99,6 @@ struct promptExample {
console.info('showDialog error: ' + err); console.info('showDialog error: ' + err);
}) })
}) })
Button('showActionMenu2') Button('showActionMenu2')
.key('button6') .key('button6')
.backgroundColor('#ffe20b48') .backgroundColor('#ffe20b48')
...@@ -118,6 +119,7 @@ struct promptExample { ...@@ -118,6 +119,7 @@ struct promptExample {
] ]
}) })
.then(data => { .then(data => {
Utils.emitEvent(this.text,404)
console.info('showActionMenu success, click button: ' + data.index); console.info('showActionMenu success, click button: ' + data.index);
}) })
.catch(err => { .catch(err => {
...@@ -185,7 +187,6 @@ struct promptExample { ...@@ -185,7 +187,6 @@ struct promptExample {
.fontSize(20) .fontSize(20)
.margin({top: 20}) .margin({top: 20})
.onClick(()=> { .onClick(()=> {
try { try {
promptAction.showActionMenu({ promptAction.showActionMenu({
title: 'showActionMenu Title Info', title: 'showActionMenu Title Info',
...@@ -211,6 +212,7 @@ struct promptExample { ...@@ -211,6 +212,7 @@ struct promptExample {
}; };
}) })
Button('showDialog2') Button('showDialog2')
.key('button5') .key('button5')
.backgroundColor('#ffe20b56') .backgroundColor('#ffe20b56')
...@@ -241,10 +243,6 @@ struct promptExample { ...@@ -241,10 +243,6 @@ struct promptExample {
console.error(`showActionMenu args error code is ${error.code}, message is ${error.message}`); console.error(`showActionMenu args error code is ${error.code}, message is ${error.message}`);
}; };
}) })
} }
} }
} }
\ No newline at end of file
...@@ -196,12 +196,13 @@ struct OhosRouterA { ...@@ -196,12 +196,13 @@ struct OhosRouterA {
.fontSize(20) .fontSize(20)
.margin({top: 20}) .margin({top: 20})
.onClick(() => { .onClick(() => {
routery.push({ try {
uri: 'pages/ohosRouterB', router.enableBackPageAlert({
params: { message: 'Message Info'
data: 'B Page' });
} catch(error) {
console.error(`enableBackPageAlert failed, code is ${error.code}, message is ${error.message}`);
} }
});
}); });
Button('disableAlertBeforeBackPage') Button('disableAlertBeforeBackPage')
......
...@@ -23,6 +23,8 @@ let loadedUrl; ...@@ -23,6 +23,8 @@ let loadedUrl;
@Entry @Entry
@Component @Component
struct Index { struct Index {
controllerhandler :ControllerHandler = new ControllerHandler();
fullscreenexithandler :FullScreenExitHandler = new FullScreenExitHandler();
ConsoleMessage:ConsoleMessage=new ConsoleMessage(); ConsoleMessage:ConsoleMessage=new ConsoleMessage();
webconTextmenuparam:webConTextMenuParam = new webConTextMenuParam(); webconTextmenuparam:webConTextMenuParam = new webConTextMenuParam();
controllerhader: ControllerHandler = new ControllerHandler(); controllerhader: ControllerHandler = new ControllerHandler();
...@@ -111,6 +113,9 @@ struct Index { ...@@ -111,6 +113,9 @@ struct Index {
this.handler.constructor(); this.handler.constructor();
this.handler.exitFullScreen(); this.handler.exitFullScreen();
}) })
.onFileSelectorShow((event) => {
this.handler = event.handler;
})
.onSslErrorEventReceive((event) => { .onSslErrorEventReceive((event) => {
AlertDialog.show({ AlertDialog.show({
title: 'onSslErrorEventReceive', title: 'onSslErrorEventReceive',
...@@ -133,9 +138,9 @@ struct Index { ...@@ -133,9 +138,9 @@ struct Index {
}) })
return true; return true;
}) })
.onFullScreenEnter((event) => { .onFullScreenEnter((event) => {
this.handler = event.handler; this.handler = event.handler;
}) })
Row(){ Row(){
Button("web click").key('webcomponent').onClick(async ()=>{ Button("web click").key('webcomponent').onClick(async ()=>{
console.info("key==>"+this.str) console.info("key==>"+this.str)
...@@ -618,6 +623,62 @@ struct Index { ...@@ -618,6 +623,62 @@ struct Index {
break; break;
} }
case "emitfullscreenexithandler":{
setTimeout(()=>{
fullscreenexithandler.constructor()
Utils.emitEvent('succesful',69)
},3000)
break;
}
case "emitcontrollerhandler":{
setTimeout(()=>{
controllerhandler.constructor()
Utils.emitEvent('succesful',69)
},3000)
break;
}
case "emitwebconTextmenuparam":{
setTimeout(()=>{
webconTextmenuparam.constructor()
Utils.emitEvent('succesful',69)
},3000)
break;
}
case "emitportsonMessageEvent":{
setTimeout(()=>{
this.ports[0].onMessageEvent((result: string) => {
console.log("received message from html5, on message:" + result);
Utils.emitEvent('succesful',69)
})
},3000)
break;
}
case "emitportsonMessageEvent":{
setTimeout(()=>{
this.ports[0].onMessageEvent((result: string) => {
console.log("received message from html5, on message:" + result);
Utils.emitEvent('succesful',69)
})
},3000)
break;
}
case "emitportsonMessageEvent":{
setTimeout(()=>{
this.ports[0].onMessageEvent((result: string) => {
console.log("received message from html5, on message:" + result);
Utils.emitEvent('succesful',69)
})
},3000)
break;
}
}
default: default:
console.info("can not match case") console.info("can not match case")
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册