未验证 提交 37b6f273 编写于 作者: O openharmony_ci 提交者: Gitee

!6471 适配xts新框架

Merge pull request !6471 from 张馨月/master
......@@ -71,32 +71,6 @@ struct Index {
}
build(){
Column(){
Web({src:$rawfile('index.html'),controller:this.controller})
.databaseAccess(true)
.zoomAccess(this.zoomAccessValue)
.textZoomRatio(this.textRatio)
.onConsole((event) => {
let level = event.message.getMessageLevel()
let msg = event.message.getMessage()
let lineNumber = event.message.getLineNumber().toString()
let sourceId = event.message.getSourceId()
console.log("lineNumber:" + lineNumber)
setTimeout(()=>{
Utils.emitEvent(lineNumber,420)
},3000)
setTimeout(()=>{
Utils.emitEvent(sourceId,422)
},3000)
return false
})
.onSearchResultReceive(ret=>{
var searchResult = ret.activeMatchOrdinal.toString() +
ret.numberOfMatches.toString()
console.log("searchResult" + searchResult)
setTimeout(()=>{
Utils.emitEvent(searchResult,426)
},3000)
})
Row(){
Button("web click").key('webcomponent').onClick(async ()=>{
console.info("key==>"+this.str)
......@@ -159,7 +133,7 @@ struct Index {
}
case "emitSaveCookieAsync":{
web_webview.WebCookieManager.saveCookieAsync(function(result){
Utils.emitEvent(result,410)
Utils.emitEvent("result",410)
})
break;
}
......@@ -228,7 +202,7 @@ struct Index {
setTimeout(()=>{
let result = this.username_password[0];
Utils.emitEvent(result,444)
},3000)
},5000)
break;
}
case "emitDeleteHttpAuthCredentials":{
......@@ -251,6 +225,32 @@ struct Index {
}
})
}
Web({src:$rawfile('index.html'),controller:this.controller})
.databaseAccess(true)
.zoomAccess(this.zoomAccessValue)
.textZoomRatio(this.textRatio)
.onConsole((event) => {
let level = event.message.getMessageLevel()
let msg = event.message.getMessage()
let lineNumber = event.message.getLineNumber().toString()
let sourceId = event.message.getSourceId()
console.log("lineNumber:" + lineNumber)
setTimeout(()=>{
Utils.emitEvent(lineNumber,420)
},3000)
setTimeout(()=>{
Utils.emitEvent(sourceId,422)
},3000)
return false
})
.onSearchResultReceive(ret=>{
var searchResult = ret.activeMatchOrdinal.toString() +
ret.numberOfMatches.toString()
console.log("searchResult" + searchResult)
setTimeout(()=>{
Utils.emitEvent(searchResult,426)
},3000)
})
}
}
}
......@@ -101,7 +101,7 @@ export default function webJsunit() {
*/
it('saveCookieAsync',0,async function(done){
emitKey="emitIsThirdPartyCookieAllowed";
Utils.registerEvent("saveCookieAsync",true,410,done);
Utils.registerEvent("saveCookieAsync","result",410,done);
sendEventByKey('webcomponent',10,'');
})
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册