Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
4be57fe0
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
4be57fe0
编写于
10月 08, 2022
作者:
O
openharmony_ci
提交者:
Gitee
10月 08, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5803 部分接口废弃,相关用例移除
Merge pull request !5803 from 章靖/master
上级
6f976da7
2e471480
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
34 addition
and
107 deletion
+34
-107
arkui/ace_ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets
..._ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets
+0
-26
arkui/ace_ets_web_dev/entry/src/main/ets/test/WebJsunit.test.ets
...ce_ets_web_dev/entry/src/main/ets/test/WebJsunit.test.ets
+34
-54
arkui/ace_ets_web_dev/entry/src/main/resources/rawfile/fileFromUrlAccess.html
...v/entry/src/main/resources/rawfile/fileFromUrlAccess.html
+0
-27
未找到文件。
arkui/ace_ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets
浏览文件 @
4be57fe0
...
...
@@ -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)
...
...
arkui/ace_ets_web_dev/entry/src/main/ets/test/WebJsunit.test.ets
浏览文件 @
4be57fe0
...
...
@@ -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="emit
FileFromUrlAccessFals
e";
emitKey="emit
DatabaseAccessTru
e";
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_03
4
*tc.number SUB_ACE_BASIC_ETS_API_03
2
*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_03
5
*tc.number SUB_ACE_BASIC_ETS_API_03
3
*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_03
6
*tc.number SUB_ACE_BASIC_ETS_API_03
4
*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_03
7
*tc.number SUB_ACE_BASIC_ETS_API_03
5
*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_03
8
*tc.number SUB_ACE_BASIC_ETS_API_03
6
*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_03
9
*tc.number SUB_ACE_BASIC_ETS_API_03
7
*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_0
40
*tc.number SUB_ACE_BASIC_ETS_API_0
38
*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_0
41
*tc.number SUB_ACE_BASIC_ETS_API_0
39
*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_04
2
*tc.number SUB_ACE_BASIC_ETS_API_04
0
*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_04
3
*tc.number SUB_ACE_BASIC_ETS_API_04
1
*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_04
4
*tc.number SUB_ACE_BASIC_ETS_API_04
2
*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_04
5
*tc.number SUB_ACE_BASIC_ETS_API_04
3
*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_04
6
*tc.number SUB_ACE_BASIC_ETS_API_04
4
*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_04
7
*tc.number SUB_ACE_BASIC_ETS_API_04
5
*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_04
8
*tc.number SUB_ACE_BASIC_ETS_API_04
6
*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_04
9
*tc.number SUB_ACE_BASIC_ETS_API_04
7
*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_0
50
*tc.number SUB_ACE_BASIC_ETS_API_0
48
*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_0
51
*tc.number SUB_ACE_BASIC_ETS_API_0
49
*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_05
2
*tc.number SUB_ACE_BASIC_ETS_API_05
0
*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_05
3
*tc.number SUB_ACE_BASIC_ETS_API_05
1
*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_05
4
*tc.number SUB_ACE_BASIC_ETS_API_05
2
*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_05
5
*tc.number SUB_ACE_BASIC_ETS_API_05
3
*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_05
6
*tc.number SUB_ACE_BASIC_ETS_API_05
4
*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_05
7
*tc.number SUB_ACE_BASIC_ETS_API_05
5
*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_05
8
*tc.number SUB_ACE_BASIC_ETS_API_05
6
*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_05
9
*tc.number SUB_ACE_BASIC_ETS_API_05
7
*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_0
60
*tc.number SUB_ACE_BASIC_ETS_API_0
58
*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_0
61
*tc.number SUB_ACE_BASIC_ETS_API_0
59
*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_06
2
*tc.number SUB_ACE_BASIC_ETS_API_06
0
*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_06
3
*tc.number SUB_ACE_BASIC_ETS_API_06
1
*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_06
4
*tc.number SUB_ACE_BASIC_ETS_API_06
2
*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_06
5
*tc.number SUB_ACE_BASIC_ETS_API_06
3
*tc.name getCookieManager
*tc.desic Gets network cookie manager
*/
...
...
arkui/ace_ets_web_dev/entry/src/main/resources/rawfile/fileFromUrlAccess.html
已删除
100644 → 0
浏览文件 @
6f976da7
<!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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录