未验证 提交 4be57fe0 编写于 作者: O openharmony_ci 提交者: Gitee

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

Merge pull request !5803 from 章靖/master
......@@ -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)
......
......@@ -338,32 +338,12 @@ export default function webJsunit() {
*tc.desic Sets allow image resources to be loaded from the network
*/
it('onlineImageAccessTrue',0,async function(done){
emitKey="emitFileFromUrlAccessFalse";
emitKey="emitDatabaseAccessTrue";
Utils.registerContainEvent("onlineImageAccessTrue","load image complete",158,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_031
*tc.name fileFromUrlAccessFalse
*tc.desic Sets javaScript can not running in the context of a file URL can access content from other file URLs.
*/
it('fileFromUrlAccessFalse',0,async function(done){
emitKey="emitFileFromUrlAccessTrue";
Utils.registerContainEvent("fileFromUrlAccessFalse","fileFromUrlAccess",160,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_032
*tc.name fileFromUrlAccessTrue
*tc.desic Sets javaScript can running in the context of a file URL can access content from other file URLs.
*/
it('fileFromUrlAccessTrue',0,async function(done){
emitKey="emitDatabaseAccessTrue";
Utils.registerContainEvent("fileFromUrlAccessTrue","okStatus",162,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_033
*tc.name databaseAccessTrue
*tc.desic Sets allow the Web access the database
*/
......@@ -373,7 +353,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_034
*tc.number SUB_ACE_BASIC_ETS_API_032
*tc.name overviewModeAccessFalse
*tc.desic Sets not allow the Web access overview mode
*/
......@@ -383,7 +363,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_035
*tc.number SUB_ACE_BASIC_ETS_API_033
*tc.name overviewModeAccessTrue
*tc.desic Sets allow the Web access overview mode
*/
......@@ -393,7 +373,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_036
*tc.number SUB_ACE_BASIC_ETS_API_034
*tc.name onPrompt
*tc.desic Triggered when the web page wants to display a JavaScript prompt() dialog
*/
......@@ -403,7 +383,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_037
*tc.number SUB_ACE_BASIC_ETS_API_035
*tc.name cacheModeOnly
*tc.desic load cache and not online
*/
......@@ -413,7 +393,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_038
*tc.number SUB_ACE_BASIC_ETS_API_036
*tc.name cacheModeDefault
*tc.desic load cache when they are available and not expired, otherwise load online
*/
......@@ -423,17 +403,17 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_039
*tc.number SUB_ACE_BASIC_ETS_API_037
*tc.name mixedModeNone
*tc.desic Sets Don't allow unsecure sources from a secure origin
*/
it('mixedModeNone',0,async function(done){
emitKey="emitMixedModeAll";
Utils.registerContainEvent("mixedModeNone","insecure image",186,done);
Utils.registerContainEvent("mixedModeNone","insecure",186,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_040
*tc.number SUB_ACE_BASIC_ETS_API_038
*tc.name mixedModeAll
*tc.desic Sets Allows all HTTP and HTTPS content can be loaded
*/
......@@ -443,7 +423,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_041
*tc.number SUB_ACE_BASIC_ETS_API_039
*tc.name fileAccessTrue
*tc.desic Sets enable local file system access in Web
*/
......@@ -453,7 +433,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_042
*tc.number SUB_ACE_BASIC_ETS_API_040
*tc.name onPageBegin
*tc.desic Triggered when the page loading progress changes
*/
......@@ -463,7 +443,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_043
*tc.number SUB_ACE_BASIC_ETS_API_041
*tc.name onPageEnd
*tc.desic Triggered at the begin of web page loading
*/
......@@ -473,7 +453,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_044
*tc.number SUB_ACE_BASIC_ETS_API_042
*tc.name onConsole
*tc.desic Triggered when the web page receives a JavaScript console message
*/
......@@ -483,7 +463,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_045
*tc.number SUB_ACE_BASIC_ETS_API_043
*tc.name onAlert
*tc.desic Triggered when the Web wants to display a JavaScript alert() dialog
*/
......@@ -493,7 +473,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_046
*tc.number SUB_ACE_BASIC_ETS_API_044
*tc.name onConfirm
*tc.desic Triggered when the web page wants to display a JavaScript confirm() dialog
*/
......@@ -503,7 +483,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_047
*tc.number SUB_ACE_BASIC_ETS_API_045
*tc.name onErrorReceive
*tc.desic Triggered when the web page receives a web resource loading error
*/
......@@ -513,7 +493,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_048
*tc.number SUB_ACE_BASIC_ETS_API_046
*tc.name onHttpErrorReceive
*tc.desic Triggered when the web page receives a web resource loading HTTP error
*/
......@@ -523,7 +503,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_049
*tc.number SUB_ACE_BASIC_ETS_API_047
*tc.name onTitleReceive
*tc.desic Triggered when the title of the main application document changes
*/
......@@ -533,7 +513,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_050
*tc.number SUB_ACE_BASIC_ETS_API_048
*tc.name onDownloadStart
*tc.desic Triggered when starting to download
*/
......@@ -543,7 +523,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_051
*tc.number SUB_ACE_BASIC_ETS_API_049
*tc.name setCookie
*tc.desic Sets the cookie
*/
......@@ -553,7 +533,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_052
*tc.number SUB_ACE_BASIC_ETS_API_050
*tc.name getCookie
*tc.desic Gets all cookies for the given URL
*/
......@@ -563,7 +543,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_053
*tc.number SUB_ACE_BASIC_ETS_API_051
*tc.name zoom
*tc.desic Let the Web zoom by
*/
......@@ -573,7 +553,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_054
*tc.number SUB_ACE_BASIC_ETS_API_052
*tc.name zoomOut
*tc.desic Let the Web zoom out
*/
......@@ -583,7 +563,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_055
*tc.number SUB_ACE_BASIC_ETS_API_053
*tc.name zoomIn
*tc.desic Let the Web zoom in
*/
......@@ -593,7 +573,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_056
*tc.number SUB_ACE_BASIC_ETS_API_054
*tc.name deleteEntireCookie
*tc.desic Delete all cookies
*/
......@@ -603,7 +583,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_057
*tc.number SUB_ACE_BASIC_ETS_API_055
*tc.name saveCookieSync
*tc.desic Saves the cookies
*/
......@@ -613,7 +593,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_058
*tc.number SUB_ACE_BASIC_ETS_API_056
*tc.name clearHistory
*tc.desic Clears the history in the Web
*/
......@@ -623,7 +603,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_059
*tc.number SUB_ACE_BASIC_ETS_API_057
*tc.name stop
*tc.desic Stops the current load
*/
......@@ -633,7 +613,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_060
*tc.number SUB_ACE_BASIC_ETS_API_058
*tc.name onInactive
*tc.desic Let the Web inactive.
*/
......@@ -643,7 +623,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_061
*tc.number SUB_ACE_BASIC_ETS_API_059
*tc.name onActive
*tc.desic Let the Web active
*/
......@@ -653,7 +633,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_062
*tc.number SUB_ACE_BASIC_ETS_API_060
*tc.name registerJavaScriptProxy
*tc.desic Registers the JavaScript object and method list
*/
......@@ -663,7 +643,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_063
*tc.number SUB_ACE_BASIC_ETS_API_061
*tc.name deleteJavaScriptRegister
*tc.desic Deletes a registered JavaScript object with given name
*/
......@@ -673,7 +653,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_064
*tc.number SUB_ACE_BASIC_ETS_API_062
*tc.name javaScriptAccess
*tc.desic Sets whether the Web allows JavaScript scripts to execute
*/
......@@ -683,7 +663,7 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_065
*tc.number SUB_ACE_BASIC_ETS_API_063
*tc.name getCookieManager
*tc.desic Gets network cookie manager
*/
......
<!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.
先完成此消息的编辑!
想要评论请 注册