提交 2e471480 编写于 作者: Z zhangjing 提交者: jiangkaixuan

部分接口废弃,相关用例移除

Signed-off-by: Nzhangjing <zhangjing403@huawei.com>
上级 106d75fa
......@@ -42,7 +42,6 @@ struct Index {
@State imageAccess:boolean=true
@State geolocationAccess:boolean=true
@State onlineImageAccess:boolean=true
@State fileFromUrlAccess:boolean=true
@State databaseAccess:boolean=true
@State overviewModeAccess:boolean=false
@State initialScale:number=100
......@@ -101,7 +100,6 @@ struct Index {
.domStorageAccess(this.domStorageAccess)
.geolocationAccess(this.geolocationAccess)
.onlineImageAccess(this.onlineImageAccess)
.fileFromUrlAccess(this.fileFromUrlAccess)
.databaseAccess(this.databaseAccess)
.cacheMode(this.cacheMode)
.initialScale(this.initialScale)
......@@ -472,30 +470,6 @@ struct Index {
},3000)
break;
}
case "emitFileFromUrlAccessFalse":{
this.fileFromUrlAccess=false
await Utils.sleep(2000)
this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/fileFromUrlAccess.html"})
setTimeout(()=>{
this.controller.runJavaScript({script:"getFileResult()",callback:(res)=>{
console.info("getFileResult==>"+res)
Utils.emitEvent(res,160)
}})
},3000)
break;
}
case "emitFileFromUrlAccessTrue":{
this.fileFromUrlAccess=true
await Utils.sleep(2000)
this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/fileFromUrlAccess.html"})
setTimeout(()=>{
this.controller.runJavaScript({script:"getFileResult()",callback:(res)=>{
console.info("getFileResult==>"+res)
Utils.emitEvent(res,162)
}})
},3000)
break;
}
case "emitDatabaseAccessTrue":{
this.databaseAccess=true
await Utils.sleep(2000)
......
<!DOCTYPE html>
<html>
<head>
<title>fileFromUrlAccess</title>
<meta charset="utf-8">
</head>
<body>
<div id="result">fileFromUrlAccess</div>
</body>
<script type="text/javascript">
function load(name){
let xhr=new XMLHttpRequest(),
okStatus=document.location.protocol==="file:" ? 0 : 200;
console.log("okStatus:"+okStatus);
xhr.open("GET",name,false);
xhr.overrideMimeType("text/html;charset=utf-8")
xhr.send(null);
return xhr.status===okStatus?xhr.responseText:null;
}
let text=load("file:///data/storage/el1/bundle/phone/resources/rawfile/fileFromUrlAccess.html");
document.getElementById("result").innerHTML=text;
function getFileResult(){
let text=document.getElementById("result").innerHTML;
return text
}
</script>
</html>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册