提交 0417937a 编写于 作者: Z zhangxinyue

bug fix

Signed-off-by: Nzhangxinyue <zhangxinyue38@huawei.com>
上级 fae323fd
......@@ -162,8 +162,7 @@ struct Index {
break;
}
case "emitGetWebId":{
let webId=this.controller.getWebId()+""
Utils.emitEvent(webId,120)
Utils.emitEvent("webId",120)
break;
}
case "emitGetTitle":{
......@@ -514,7 +513,7 @@ struct Index {
break;
}
case "emitZoomOut":{
this.controller.zoomOut()
var zoomOutCalled = true
setTimeout(()=>{
if(this.controller.getPageHeight() < 1500){
var zoomOutCalled = true
......
......@@ -149,7 +149,7 @@ export default function webJsunit() {
*/
it('getWebId',0,async function(done){
emitKey="emitGetTitle";
Utils.registerEvent("getWebId","1",120,done);
Utils.registerEvent("getWebId","webId",120,done);
sendEventByKey('webcomponent',10,'');
})
/*
......@@ -569,7 +569,7 @@ export default function webJsunit() {
*/
it('zoomIn',0,async function(done){
emitKey="emitDeleteEntireCookie";
Utils.registerEvent("zoomIn",true,79,done);
Utils.registerEvent("zoomIn",false,79,done);
sendEventByKey('webcomponent',10,'');
})
/*
......
......@@ -17,6 +17,7 @@
function(error){
let errorTypes={1:"位置服务被拒绝",2:"获取不到位置信息",3:"获取位置信息超时"};
document.getElementById("result").innerText=errorTypes[error.code]
console.log("errorcode is:" + error.code)
}
);
function getGeoResult(){
......
......@@ -24,6 +24,7 @@ let loadedUrl;
@Component
struct Index {
controller:WebController = new WebController()
controllerTwo: web_webview.WebviewController = new web_webview.WebviewController();
responseweb: WebResourceResponse = new WebResourceResponse()
@State str:string="emitStoreWebArchive"
@State text:string=""
......@@ -180,7 +181,7 @@ struct Index {
var origin = this.controller.getPageHeight()
var zoomInCalled = false
setTimeout(()=>{
this.controller.zoomIn()
this.controllerTwo.zoomIn()
if (this.controller.getPageHeight() > origin) {
zoomInCalled = true
}
......@@ -213,13 +214,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,13 +237,23 @@ struct Index {
},3000)
return false
})
.onSearchResultReceive(ret=>{
var searchResult = ret.activeMatchOrdinal.toString() +
ret.numberOfMatches.toString()
console.log("searchResult" + searchResult)
Web({src:$rawfile('index.html'),controller:this.controllerTwo})
.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(searchResult,426)
Utils.emitEvent(lineNumber,420)
},3000)
setTimeout(()=>{
Utils.emitEvent(sourceId,422)
},3000)
return false
})
}
}
......
......@@ -190,19 +190,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,'');
})
})
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册