Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
542ff113
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看板
提交
542ff113
编写于
2月 10, 2023
作者:
W
wang-xupeng2
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
delete api
Signed-off-by:
N
wang-xupeng2
<
wangxupeng2@huawei.com
>
上级
a65b05a5
变更
23
隐藏空白更改
内联
并排
Showing
23 changed file
with
89 addition
and
277 deletion
+89
-277
arkui/ace_ets_component_attrlack/BUILD.gn
arkui/ace_ets_component_attrlack/BUILD.gn
+1
-1
arkui/ace_ets_component_attrlack/Test.json
arkui/ace_ets_component_attrlack/Test.json
+3
-2
arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/web.ets
...ent_attrlack/entry/src/main/ets/MainAbility/pages/web.ets
+0
-2
arkui/ace_ets_component_attrlack/entry/src/main/ets/test/alertDialog.test.ets
...ent_attrlack/entry/src/main/ets/test/alertDialog.test.ets
+1
-0
arkui/ace_ets_web_dev/BUILD.gn
arkui/ace_ets_web_dev/BUILD.gn
+1
-1
arkui/ace_ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets
..._ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets
+31
-100
arkui/ace_ets_web_dev/entry/src/main/ets/MainAbility/pages/webTwo.ets
...s_web_dev/entry/src/main/ets/MainAbility/pages/webTwo.ets
+1
-1
arkui/ace_ets_web_dev/entry/src/main/ets/test/List.test.ets
arkui/ace_ets_web_dev/entry/src/main/ets/test/List.test.ets
+0
-0
arkui/ace_ets_web_dev/entry/src/main/ets/test/Utils.ets
arkui/ace_ets_web_dev/entry/src/main/ets/test/Utils.ets
+1
-1
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
+8
-109
arkui/ace_ets_web_dev/entry/src/main/ets/test/WebTwoJsunit.test.ets
...ets_web_dev/entry/src/main/ets/test/WebTwoJsunit.test.ets
+1
-1
arkui/ace_ets_web_dev/entry/src/main/module.json
arkui/ace_ets_web_dev/entry/src/main/module.json
+1
-1
arkui/ace_ets_web_dev/entry/src/main/resources/base/profile/main_pages.json
...dev/entry/src/main/resources/base/profile/main_pages.json
+0
-0
arkui/ace_ets_web_dev/entry/src/main/resources/rawfile/index.html
...e_ets_web_dev/entry/src/main/resources/rawfile/index.html
+4
-1
arkui/ace_ets_web_dev/entry/src/main/resources/rawfile/overview.html
...ts_web_dev/entry/src/main/resources/rawfile/overview.html
+0
-0
arkui/ace_ets_web_dev/entry/src/main/resources/rawfile/second.html
..._ets_web_dev/entry/src/main/resources/rawfile/second.html
+5
-0
arkui/ace_ets_web_dev_two/BUILD.gn
arkui/ace_ets_web_dev_two/BUILD.gn
+1
-1
arkui/ace_ets_web_dev_two/entry/src/main/ets/MainAbility/pages/web.ets
..._web_dev_two/entry/src/main/ets/MainAbility/pages/web.ets
+16
-30
arkui/ace_ets_web_dev_two/entry/src/main/ets/test/Utils.ets
arkui/ace_ets_web_dev_two/entry/src/main/ets/test/Utils.ets
+1
-1
arkui/ace_ets_web_dev_two/entry/src/main/ets/test/WebJsunit.test.ets
...ts_web_dev_two/entry/src/main/ets/test/WebJsunit.test.ets
+3
-23
arkui/ace_ets_web_dev_two/entry/src/main/module.json
arkui/ace_ets_web_dev_two/entry/src/main/module.json
+1
-1
arkui/ace_ets_web_dev_two/entry/src/main/resources/rawfile/index.html
...s_web_dev_two/entry/src/main/resources/rawfile/index.html
+4
-1
arkui/ace_ets_web_dev_two/entry/src/main/resources/rawfile/second.html
..._web_dev_two/entry/src/main/resources/rawfile/second.html
+5
-0
未找到文件。
arkui/ace_ets_component_attrlack/BUILD.gn
浏览文件 @
542ff113
...
@@ -33,4 +33,4 @@ ohos_js_assets("ace_ets_dev_test_assets") {
...
@@ -33,4 +33,4 @@ ohos_js_assets("ace_ets_dev_test_assets") {
ohos_resources("ace_ets_dev_resources") {
ohos_resources("ace_ets_dev_resources") {
sources = [ "./entry/src/main/resources" ]
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
hap_profile = "./entry/src/main/config.json"
}
}
\ No newline at end of file
arkui/ace_ets_component_attrlack/Test.json
浏览文件 @
542ff113
...
@@ -5,7 +5,8 @@
...
@@ -5,7 +5,8 @@
"test-timeout"
:
"600000"
,
"test-timeout"
:
"600000"
,
"bundle-name"
:
"com.open.harmony.aceEtsAttrLack"
,
"bundle-name"
:
"com.open.harmony.aceEtsAttrLack"
,
"package-name"
:
"com.open.harmony.aceEtsAttrLack"
,
"package-name"
:
"com.open.harmony.aceEtsAttrLack"
,
"shell-timeout"
:
"600000"
"shell-timeout"
:
"600000"
,
"testcase-timeout"
:
"10000"
},
},
"kits"
:
[
"kits"
:
[
{
{
...
@@ -16,4 +17,4 @@
...
@@ -16,4 +17,4 @@
"cleanup-apps"
:
true
"cleanup-apps"
:
true
}
}
]
]
}
}
\ No newline at end of file
arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/web.ets
浏览文件 @
542ff113
...
@@ -79,8 +79,6 @@ struct WebEditText {
...
@@ -79,8 +79,6 @@ struct WebEditText {
})
})
.onHttpErrorReceive((event) => {
.onHttpErrorReceive((event) => {
console.log('setResponseHeader:' + event.response.setResponseHeader([]));
console.log('setResponseHeader:' + event.response.setResponseHeader([]));
console.log('web getExtra:' + this.controller.getHitTestValue().getExtra());
console.log('web getType:' + this.controller.getHitTestValue().getType());
let result = event.request.getRequestHeader();
let result = event.request.getRequestHeader();
console.log('The request header result size is ' + result.length);
console.log('The request header result size is ' + result.length);
for (let i of result) {
for (let i of result) {
...
...
arkui/ace_ets_component_attrlack/entry/src/main/ets/test/alertDialog.test.ets
浏览文件 @
542ff113
...
@@ -84,6 +84,7 @@ export default function alertDialogCenterStartJsunit() {
...
@@ -84,6 +84,7 @@ export default function alertDialogCenterStartJsunit() {
try {
try {
let measureOptions = {textContent : "alertDialog-CenterStart"};
let measureOptions = {textContent : "alertDialog-CenterStart"};
let width = measure.measureText(measureOptions);
let width = measure.measureText(measureOptions);
console.info("++++++++++++++++++++++" + width.toString());
expect(width > 0).assertFalse();
expect(width > 0).assertFalse();
done();
done();
} catch (err) {
} catch (err) {
...
...
arkui/ace_ets_web_dev/BUILD.gn
浏览文件 @
542ff113
...
@@ -38,4 +38,4 @@ ohos_resources("ace_ets_web_dev_resources") {
...
@@ -38,4 +38,4 @@ ohos_resources("ace_ets_web_dev_resources") {
sources = [ "entry/src/main/resources" ]
sources = [ "entry/src/main/resources" ]
deps = [ ":ace_ets_web_dev_app_profile" ]
deps = [ ":ace_ets_web_dev_app_profile" ]
hap_profile = "entry/src/main/module.json"
hap_profile = "entry/src/main/module.json"
}
}
\ No newline at end of file
arkui/ace_ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets
100755 → 100644
浏览文件 @
542ff113
...
@@ -127,10 +127,12 @@ struct Index {
...
@@ -127,10 +127,12 @@ struct Index {
break;
break;
}
}
case "emitLoadUrl":{
case "emitLoadUrl":{
this.controller.loadUrl({url:"
https://gitee.com/
"})
this.controller.loadUrl({url:"
resource://rawfile/index.html
"})
setTimeout(()=>{
setTimeout(()=>{
let webTitle=this.controller.getTitle()
this.controller.runJavaScript({script:"gettitle()",callback:(res)=>{
Utils.emitEvent(webTitle,110)
console.info("gettitle1==>"+res)
Utils.emitEvent(res,110)
}})
},3000)
},3000)
break;
break;
}
}
...
@@ -165,25 +167,6 @@ struct Index {
...
@@ -165,25 +167,6 @@ struct Index {
Utils.emitEvent("webId",120)
Utils.emitEvent("webId",120)
break;
break;
}
}
case "emitGetTitle":{
this.controller.loadUrl({url:"resource://rawfile/index.html"});
setTimeout(()=>{
let webTitle=this.controller.getTitle()
Utils.emitEvent(webTitle,122)
},3000)
break;
}
case "emitGetPageHeight":{
this.controller.loadUrl({url:"resource://rawfile/index.html"});
let webPageHeight=this.controller.getPageHeight()+""
setTimeout(()=>{
this.controller.runJavaScript({script:"getPageHeight()",callback:(res)=>{
console.info("getPageHeight==>"+res)
Utils.emitEventTwo(res,webPageHeight,124)
}})
},3000)
break;
}
case "emitGetRequestFocus":{
case "emitGetRequestFocus":{
this.controller.loadUrl({url:"resource://rawfile/second.html"});
this.controller.loadUrl({url:"resource://rawfile/second.html"});
await Utils.sleep(2000)
await Utils.sleep(2000)
...
@@ -207,25 +190,18 @@ struct Index {
...
@@ -207,25 +190,18 @@ struct Index {
}
}
case "emitBackward":{
case "emitBackward":{
this.controller.backward()
this.controller.backward()
this.controller.loadUrl({url:"resource://rawfile/index.html"});
setTimeout(()=>{
setTimeout(()=>{
let webTitle=this.controller.getTitle()
this.controller.runJavaScript({script:"gettitle()",callback:(res)=>{
Utils.emitEvent(webTitle,134)
Utils.emitEvent(res,134)
}})
},3000)
},3000)
break;
break;
}
}
case "emitForward":{
case "emitForward":{
this.controller.forward()
this.controller.forward()
setTimeout(()=>{
setTimeout(()=>{
let webTitle=this.controller.getTitle()
Utils.emitEvent(this.newUrl,136)
Utils.emitEvent(webTitle,136)
},3000)
break;
}
case "emitBackOrForward":{
this.controller.backOrForward(-1)
setTimeout(()=>{
let webTitle=this.controller.getTitle()
Utils.emitEvent(webTitle,138)
},3000)
},3000)
break;
break;
}
}
...
@@ -363,10 +339,11 @@ struct Index {
...
@@ -363,10 +339,11 @@ struct Index {
case "emitCacheModeDefault":{
case "emitCacheModeDefault":{
this.cacheMode=CacheMode.Default
this.cacheMode=CacheMode.Default
await Utils.sleep(2000)
await Utils.sleep(2000)
this.controller.loadUrl({url:"
https://www.openharmony.cn/mainPlay
"})
this.controller.loadUrl({url:"
resource://rawfile/index.html
"})
setTimeout(()=>{
setTimeout(()=>{
let webTitle=this.controller.getTitle()
this.controller.runJavaScript({script:"gettitle()",callback:(res)=>{
Utils.emitEvent(webTitle,184)
Utils.emitEvent(res,184)
}})
},3000)
},3000)
break;
break;
}
}
...
@@ -389,8 +366,9 @@ struct Index {
...
@@ -389,8 +366,9 @@ struct Index {
this.controller.loadUrl({url:"resource://rawfile/index.html"});
this.controller.loadUrl({url:"resource://rawfile/index.html"});
this.controller.runJavaScript({script:"openRawFile()"})
this.controller.runJavaScript({script:"openRawFile()"})
setTimeout(()=>{
setTimeout(()=>{
let webTitle=this.controller.getTitle()
this.controller.runJavaScript({script:"gettitle()",callback:(res)=>{
Utils.emitEvent(webTitle,190)
Utils.emitEvent(res,190)
}})
},3000)
},3000)
break;
break;
}
}
...
@@ -452,62 +430,20 @@ struct Index {
...
@@ -452,62 +430,20 @@ struct Index {
this.controller.loadUrl({url:"https://consumer.huawei.com/content/dam/huawei-cbg-site/cn/mkt/mobileservices/2022/download/PC107f1b3947c942ffaa14334a879065d8.2107261020.exe"})
this.controller.loadUrl({url:"https://consumer.huawei.com/content/dam/huawei-cbg-site/cn/mkt/mobileservices/2022/download/PC107f1b3947c942ffaa14334a879065d8.2107261020.exe"})
break;
break;
}
}
case "emitSetCookie":{
this.controller.getCookieManager().setCookie('http://www.baidu.com','e=f')
setTimeout(()=>{
let setCookieCalled = this.controller.getCookieManager().getCookie('http://www.baidu.com')
Utils.emitEvent(setCookieCalled,76)
},3000)
break;
}
case "emitGetCookie":{
this.controller.getCookieManager().setCookie('https://www.bilibili.com/','e=f')
setTimeout(()=>{
let getCookieCalled = this.controller.getCookieManager().getCookie('https://www.bilibili.com/')
Utils.emitEvent(getCookieCalled,69)
},3000)
break;
}
case "emitZoom":{
case "emitZoom":{
this.controller.loadUrl({url:"resource://rawfile/index.html"});
this.controller.loadUrl({url:"resource://rawfile/index.html"});
setTimeout(()=>{
this.controller.zoom(2)
this.controller.zoom(2)
setTimeout(()=>{
setTimeout(() => {
this.controller.runJavaScript({script:"getPageHeight()",callback:(res)=>{
if(this.controller.getPageHeight() > 1400){
console.info("getPageHeight++++++"+res)
var zoomCalled = true
if(Number(res) > 1400){
}
var zoomCalled = true
Utils.emitEvent(zoomCalled,77)
}
},3000)
Utils.emitEvent(zoomCalled,77)
}})
},5000)
},5000)
break;
break;
}
}
case "emitZoomOut":{
setTimeout(()=>{
var zoomOutCalled = true
Utils.emitEvent(zoomOutCalled,78)
},3000)
break;
}
case "emitZoomIn":{
setTimeout(()=>{
var zoomInCalled = false
Utils.emitEvent(zoomInCalled,79)
},3000)
break;
}
case "emitDeleteEntireCookie":{
this.controller.getCookieManager().deleteEntireCookie()
setTimeout(()=>{
let deleteEntireCookieCalled = this.controller.getCookieManager().getCookie('http://www.baidu.com')
Utils.emitEvent(deleteEntireCookieCalled,80)
},3000)
break;
}
case "emitSaveCookieSync":{
let saveCookieSyncCalled = this.controller.getCookieManager().saveCookieSync()
Utils.emitEvent(saveCookieSyncCalled,81)
break;
}
case "emitClearHistory":{
case "emitClearHistory":{
this.controller.loadUrl({url:"http://www.baidu.com/"})
this.controller.loadUrl({url:"http://www.baidu.com/"})
setTimeout(()=>{
setTimeout(()=>{
...
@@ -532,14 +468,17 @@ struct Index {
...
@@ -532,14 +468,17 @@ struct Index {
break;
break;
}
}
case "emitOnInactive":{
case "emitOnInactive":{
this.controller.loadUrl({url:"resource://rawfile/index.html"});
this.controller.onInactive()
this.controller.onInactive()
this.controller.zoomOut()
setTimeout(()=>{
setTimeout(()=>{
var onInactiveCalled = false
var onInactiveCalled = false
if(this.controller.getPageHeight() < 2600){
this.controller.runJavaScript({script:"gettitle()",callback:(res)=>{
console.info("gettitle++++++"+res)
if(res == "\"index\""){
onInactiveCalled = true
onInactiveCalled = true
}
}
Utils.emitEvent(onInactiveCalled,84)
Utils.emitEvent(onInactiveCalled,84)
}})
},3000)
},3000)
break;
break;
}
}
...
@@ -584,14 +523,6 @@ struct Index {
...
@@ -584,14 +523,6 @@ struct Index {
},3000)
},3000)
break;
break;
}
}
case "emitGetCookieManager":{
this.controller.getCookieManager().setCookie("https://weibo.com","a=b")
setTimeout(()=>{
let getCookieManagerCalled = this.controller.getCookieManager().getCookie('https://weibo.com')
Utils.emitEvent(getCookieManagerCalled,89)
},3000)
break;
}
case "emitWebVisibility":{
case "emitWebVisibility":{
this.webVisibility = Visibility.Hidden;
this.webVisibility = Visibility.Hidden;
setTimeout(()=>{
setTimeout(()=>{
...
...
arkui/ace_ets_web_dev/entry/src/main/ets/MainAbility/pages/webTwo.ets
100755 → 100644
浏览文件 @
542ff113
...
@@ -70,4 +70,4 @@ struct Second {
...
@@ -70,4 +70,4 @@ struct Second {
.overviewModeAccess(this.overviewModeAccess)
.overviewModeAccess(this.overviewModeAccess)
}
}
}
}
}
}
\ No newline at end of file
arkui/ace_ets_web_dev/entry/src/main/ets/test/List.test.ets
100755 → 100644
浏览文件 @
542ff113
文件模式从 100755 更改为 100644
arkui/ace_ets_web_dev/entry/src/main/ets/test/Utils.ets
100755 → 100644
浏览文件 @
542ff113
...
@@ -166,4 +166,4 @@ export default class Utils {
...
@@ -166,4 +166,4 @@ export default class Utils {
console.info(`[${testCaseName}] err:`+JSON.stringify(err));
console.info(`[${testCaseName}] err:`+JSON.stringify(err));
}
}
}
}
}
}
\ No newline at end of file
arkui/ace_ets_web_dev/entry/src/main/ets/test/WebJsunit.test.ets
100755 → 100644
浏览文件 @
542ff113
...
@@ -101,7 +101,7 @@ export default function webJsunit() {
...
@@ -101,7 +101,7 @@ export default function webJsunit() {
*/
*/
it('loadUrl',0,async function(done){
it('loadUrl',0,async function(done){
emitKey="emitRunJavaScript";
emitKey="emitRunJavaScript";
Utils.registerContainEvent("loadUrl","
代码托管和研发协作平台
",110,done);
Utils.registerContainEvent("loadUrl","
index
",110,done);
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
...
@@ -148,28 +148,8 @@ export default function webJsunit() {
...
@@ -148,28 +148,8 @@ export default function webJsunit() {
*tc.desic Gets the id for the current Web
*tc.desic Gets the id for the current Web
*/
*/
it('getWebId',0,async function(done){
it('getWebId',0,async function(done){
emitKey="emitGetTitle";
Utils.registerEvent("getWebId","webId",120,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_012
*tc.name getTitle
*tc.desic Gets the title of current Web page
*/
it('getTitle',0,async function(done){
emitKey="emitGetPageHeight";
Utils.registerEvent("getTitle","index",122,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_013
*tc.name getPageHeight
*tc.desic Gets the content height of current Web page
*/
it('getPageHeight',0,async function(done){
emitKey="emitGetRequestFocus";
emitKey="emitGetRequestFocus";
Utils.registerEvent
Two("getPageHeight",124
,done);
Utils.registerEvent
("getWebId","webId",120
,done);
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
...
@@ -219,7 +199,7 @@ export default function webJsunit() {
...
@@ -219,7 +199,7 @@ export default function webJsunit() {
*/
*/
it('backward',0,async function(done){
it('backward',0,async function(done){
emitKey="emitForward";
emitKey="emitForward";
Utils.registerEvent("backward","
index
",134,done);
Utils.registerEvent("backward","
\"index\"
",134,done);
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
...
@@ -228,18 +208,8 @@ export default function webJsunit() {
...
@@ -228,18 +208,8 @@ export default function webJsunit() {
*tc.desic Goes forward in the history of the web page
*tc.desic Goes forward in the history of the web page
*/
*/
it('forward',0,async function(done){
it('forward',0,async function(done){
emitKey="emitBackOrForward";
Utils.registerEvent("forward","second",136,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_020
*tc.name backOrForward
*tc.desic Goes forward or back backOrForward in the history of the web page
*/
it('backOrForward',0,async function(done){
emitKey="emitGeolocationAccessFalse";
emitKey="emitGeolocationAccessFalse";
Utils.registerEvent("
backOrForward","index",138
,done);
Utils.registerEvent("
forward","resource://rawfile/index.html",136
,done);
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
...
@@ -379,7 +349,7 @@ export default function webJsunit() {
...
@@ -379,7 +349,7 @@ export default function webJsunit() {
*/
*/
it('cacheModeDefault',0,async function(done){
it('cacheModeDefault',0,async function(done){
emitKey="emitMixedModeNone";
emitKey="emitMixedModeNone";
Utils.registerContainEvent("cacheModeDefault","
OpenHarmony
",184,done);
Utils.registerContainEvent("cacheModeDefault","
index
",184,done);
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
...
@@ -498,28 +468,8 @@ export default function webJsunit() {
...
@@ -498,28 +468,8 @@ export default function webJsunit() {
*tc.desic Triggered when starting to download
*tc.desic Triggered when starting to download
*/
*/
it('onDownloadStart',0,async function(done){
it('onDownloadStart',0,async function(done){
emitKey="emitSetCookie";
Utils.registerEvent("onDownloadStart","https://consumer.huawei.com/content/dam/huawei-cbg-site/cn/mkt/mobileservices/2022/download/PC107f1b3947c942ffaa14334a879065d8.2107261020.exe",68,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_047
*tc.name setCookie
*tc.desic Sets the cookie
*/
it('setCookie',0,async function(done){
emitKey="emitGetCookie";
Utils.registerEvent("setCookie","e=f",76,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_048
*tc.name getCookie
*tc.desic Gets all cookies for the given URL
*/
it('getCookie',0,async function(done){
emitKey="emitZoom";
emitKey="emitZoom";
Utils.registerEvent("
getCookie","e=f",69
,done);
Utils.registerEvent("
onDownloadStart","https://consumer.huawei.com/content/dam/huawei-cbg-site/cn/mkt/mobileservices/2022/download/PC107f1b3947c942ffaa14334a879065d8.2107261020.exe",68
,done);
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
...
@@ -528,48 +478,8 @@ export default function webJsunit() {
...
@@ -528,48 +478,8 @@ export default function webJsunit() {
*tc.desic Let the Web zoom by
*tc.desic Let the Web zoom by
*/
*/
it('zoom',0,async function(done){
it('zoom',0,async function(done){
emitKey="emitZoomOut";
Utils.registerEvent("zoom",true,77,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_050
*tc.name zoomOut
*tc.desic Let the Web zoom out
*/
it('zoomOut',0,async function(done){
emitKey="emitZoomIn";
Utils.registerEvent("zoomOut",true,78,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_051
*tc.name zoomIn
*tc.desic Let the Web zoom in
*/
it('zoomIn',0,async function(done){
emitKey="emitDeleteEntireCookie";
Utils.registerEvent("zoomIn",false,79,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_052
*tc.name deleteEntireCookie
*tc.desic Delete all cookies
*/
it('deleteEntireCookie',0,async function(done){
emitKey="emitSaveCookieSync";
Utils.registerEvent("deleteEntireCookie","",80,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_053
*tc.name saveCookieSync
*tc.desic Saves the cookies
*/
it('saveCookieSync',0,async function(done){
emitKey="emitClearHistory";
emitKey="emitClearHistory";
Utils.registerEvent("
saveCookieSync",true,81
,done);
Utils.registerEvent("
zoom",true,77
,done);
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
...
@@ -638,21 +548,10 @@ export default function webJsunit() {
...
@@ -638,21 +548,10 @@ export default function webJsunit() {
*tc.desic Sets whether the Web allows JavaScript scripts to execute
*tc.desic Sets whether the Web allows JavaScript scripts to execute
*/
*/
it('javaScriptAccess',0,async function(done){
it('javaScriptAccess',0,async function(done){
emitKey="emitGetCookieManager";
Utils.registerEvent("javaScriptAccess",true,88,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_061
*tc.name getCookieManager
*tc.desic Gets network cookie manager
*/
it('getCookieManager',0,async function(done){
emitKey="emitWebVisibility";
emitKey="emitWebVisibility";
Utils.registerEvent("
getCookieManager","a=b",89
,done);
Utils.registerEvent("
javaScriptAccess",true,88
,done);
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
*tc.number SUB_ACE_BASIC_ETS_API_062
*tc.number SUB_ACE_BASIC_ETS_API_062
*tc.name webVisibility
*tc.name webVisibility
...
...
arkui/ace_ets_web_dev/entry/src/main/ets/test/WebTwoJsunit.test.ets
100755 → 100644
浏览文件 @
542ff113
...
@@ -85,4 +85,4 @@ export default function webTwoJsunit() {
...
@@ -85,4 +85,4 @@ export default function webTwoJsunit() {
sendEventByKey('webcomponenttwo',10,'');
sendEventByKey('webcomponenttwo',10,'');
})
})
})
})
}
}
\ No newline at end of file
arkui/ace_ets_web_dev/entry/src/main/module.json
浏览文件 @
542ff113
...
@@ -46,4 +46,4 @@
...
@@ -46,4 +46,4 @@
}
}
]
]
}
}
}
}
\ No newline at end of file
arkui/ace_ets_web_dev/entry/src/main/resources/base/profile/main_pages.json
100755 → 100644
浏览文件 @
542ff113
文件模式从 100755 更改为 100644
arkui/ace_ets_web_dev/entry/src/main/resources/rawfile/index.html
浏览文件 @
542ff113
...
@@ -66,5 +66,8 @@
...
@@ -66,5 +66,8 @@
function
openRawFile
(){
function
openRawFile
(){
document
.
getElementById
(
"
fileAccess
"
).
click
()
document
.
getElementById
(
"
fileAccess
"
).
click
()
}
}
function
gettitle
(){
return
document
.
title
}
</script>
</script>
</html>
</html>
\ No newline at end of file
arkui/ace_ets_web_dev/entry/src/main/resources/rawfile/overview.html
100755 → 100644
浏览文件 @
542ff113
文件模式从 100755 更改为 100644
arkui/ace_ets_web_dev/entry/src/main/resources/rawfile/second.html
浏览文件 @
542ff113
...
@@ -9,4 +9,9 @@
...
@@ -9,4 +9,9 @@
<body>
<body>
<div
style=
"height: 1300px;background-color: #999999;"
>
second pages
</div>
<div
style=
"height: 1300px;background-color: #999999;"
>
second pages
</div>
</body>
</body>
<script>
function
gettitle
(){
return
document
.
title
}
</script>
</html>
</html>
\ No newline at end of file
arkui/ace_ets_web_dev_two/BUILD.gn
浏览文件 @
542ff113
...
@@ -38,4 +38,4 @@ ohos_resources("ace_ets_web_dev_resources") {
...
@@ -38,4 +38,4 @@ ohos_resources("ace_ets_web_dev_resources") {
sources = [ "entry/src/main/resources" ]
sources = [ "entry/src/main/resources" ]
deps = [ ":ace_ets_web_dev_app_profile" ]
deps = [ ":ace_ets_web_dev_app_profile" ]
hap_profile = "entry/src/main/module.json"
hap_profile = "entry/src/main/module.json"
}
}
\ No newline at end of file
arkui/ace_ets_web_dev_two/entry/src/main/ets/MainAbility/pages/web.ets
浏览文件 @
542ff113
...
@@ -25,7 +25,7 @@ let loadedUrl;
...
@@ -25,7 +25,7 @@ let loadedUrl;
struct Index {
struct Index {
controller:WebController = new WebController()
controller:WebController = new WebController()
responseweb: WebResourceResponse = new WebResourceResponse()
responseweb: WebResourceResponse = new WebResourceResponse()
@State str:string="emit
StoreWebArchive
"
@State str:string="emit
AllowGeolocation
"
@State text:string=""
@State text:string=""
@State textRatio:number=100
@State textRatio:number=100
@State zoomAccessValue:boolean=true
@State zoomAccessValue:boolean=true
...
@@ -74,16 +74,7 @@ struct Index {
...
@@ -74,16 +74,7 @@ struct Index {
Row(){
Row(){
Button("web click").key('webcomponent').onClick(async ()=>{
Button("web click").key('webcomponent').onClick(async ()=>{
console.info("key==>"+this.str)
console.info("key==>"+this.str)
switch(this.str){
switch(this.str){
case "emitStoreWebArchive":{
let webAsyncController = new web_webview.WebAsyncController(this.controller)
webAsyncController.storeWebArchive("/data/storage/el2/base/",true,(filename) => {
if(filename != null) {
Utils.emitEvent(filename,400)
}
})
break;
}
case "emitAllowGeolocation":{
case "emitAllowGeolocation":{
try {
try {
web_webview.GeolocationPermissions.allowGeolocation("resource://rawfile/");
web_webview.GeolocationPermissions.allowGeolocation("resource://rawfile/");
...
@@ -150,15 +141,6 @@ struct Index {
...
@@ -150,15 +141,6 @@ struct Index {
},3000)
},3000)
break;
break;
}
}
case "emitExistCookie":{
this.controller.getCookieManager().deleteEntireCookie();
setTimeout(()=>{
var result = web_webview.WebCookieManager.existCookie();
console.log(result.toString());
Utils.emitEvent(result,414)
},3000)
break ;
}
case "emitOnConsole":{
case "emitOnConsole":{
this.controller.runJavaScript({script:"consoleTest()"})
this.controller.runJavaScript({script:"consoleTest()"})
break;
break;
...
@@ -167,28 +149,32 @@ struct Index {
...
@@ -167,28 +149,32 @@ struct Index {
this.controller.loadUrl({url:"resource://rawfile/index.html"})
this.controller.loadUrl({url:"resource://rawfile/index.html"})
setTimeout(()=>{
setTimeout(()=>{
this.controller.loadData({
this.controller.loadData({
data: "
<html><
title>
index
</title
></html>
",
data: "
<html><
head><title>
index
</title></head><body
bgcolor=
\"white\"
>
Source:
<pre>
source
</pre
</body
><script>
function
gettitle
(){
return
document
.
title
}
</script
></html>
",
mimeType: "text/html",
mimeType: "text/html",
encoding: "UTF-8"
encoding: "UTF-8"
})
})
},3000)
},3000)
setTimeout(()=>{
setTimeout(()=>{
this.text = this.controller.getTitle();
this.controller.runJavaScript({script:"gettitle()",callback:(res)=>{
Utils.emitEvent(this.text,424)
Utils.emitEvent(res,424)
}})
},4000)
},4000)
break ;
break ;
}
}
case "emitZoomAccess":{
case "emitZoomAccess":{
this.zoomAccessValue = false
this.zoomAccessValue = false
this.controller.refresh()
this.controller.refresh()
var origin = this.controller.getPageHeight()
setTimeout(()=>{
var zoomInCalled = false
this.controller.runJavaScript({script:"getPageHeight()",callback:(res1)=>{
setTimeout(()=>{
var zoomInCalled = false
if (this.controller.getPageHeight() > origin) {
this.controller.runJavaScript({script:"getPageHeight()",callback:(res)=>{
console.info("getPageHeight==>"+res)
if (Number(res) > Number(res1)) {
zoomInCalled = true
zoomInCalled = true
}
}
console.log("final" + this.controller.getPageHeight())
Utils.emitEvent(zoomInCalled,428);
Utils.emitEvent(zoomInCalled,428);
}})
}})
},3000);
},3000);
break ;
break ;
}
}
...
...
arkui/ace_ets_web_dev_two/entry/src/main/ets/test/Utils.ets
浏览文件 @
542ff113
...
@@ -144,4 +144,4 @@ export default class Utils {
...
@@ -144,4 +144,4 @@ export default class Utils {
console.info("emit emitKey err: " + JSON.stringify(err));
console.info("emit emitKey err: " + JSON.stringify(err));
}
}
}
}
}
}
\ No newline at end of file
arkui/ace_ets_web_dev_two/entry/src/main/ets/test/WebJsunit.test.ets
浏览文件 @
542ff113
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
import { describe, beforeEach, afterEach, it, expect } from "@ohos/hypium";
import { describe, beforeEach, afterEach, it, expect } from "@ohos/hypium";
import events_emitter from '@ohos.events.emitter';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils.ets';
import Utils from './Utils.ets';
let emitKey = "emit
UserAgent
";
let emitKey = "emit
AllowGeolocation
";
export default function webJsunit() {
export default function webJsunit() {
describe('ActsAceWebDevTest', function () {
describe('ActsAceWebDevTest', function () {
beforeEach(async function (done) {
beforeEach(async function (done) {
...
@@ -44,16 +44,6 @@ export default function webJsunit() {
...
@@ -44,16 +44,6 @@ export default function webJsunit() {
await Utils.sleep(2000);
await Utils.sleep(2000);
done();
done();
})
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_066
*tc.name storeWebArchive
*tc.desic Save current page
*/
it('storeWebArchive',0,async function(done){
emitKey="emitAllowGeolocation";
Utils.registerContainEvent("storeWebArchive","/data/storage/el2/base/",400,done);
sendEventByKey('webcomponent',10,'');
})
/*
/*
*tc.number SUB_ACE_BASIC_ETS_API_067
*tc.number SUB_ACE_BASIC_ETS_API_067
*tc.name allowGeolocation
*tc.name allowGeolocation
...
@@ -110,18 +100,8 @@ export default function webJsunit() {
...
@@ -110,18 +100,8 @@ export default function webJsunit() {
*tc.desic return whether the third party cookie is allowed
*tc.desic return whether the third party cookie is allowed
*/
*/
it('isThirdPartyCookieAllowed',0,async function(done){
it('isThirdPartyCookieAllowed',0,async function(done){
emitKey="emitExistCookie";
Utils.registerEvent("isThirdPartyCookieAllowed",false,412,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_073
*tc.name existCookie
*tc.desic return whether there exits cookie
*/
it('existCookie',0,async function(done){
emitKey="emitOnConsole";
emitKey="emitOnConsole";
Utils.registerEvent("
existCookie",false,414
,done);
Utils.registerEvent("
isThirdPartyCookieAllowed",false,412
,done);
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
/*
/*
...
@@ -195,4 +175,4 @@ export default function webJsunit() {
...
@@ -195,4 +175,4 @@ export default function webJsunit() {
sendEventByKey('webcomponent',10,'');
sendEventByKey('webcomponent',10,'');
})
})
})
})
}
}
\ No newline at end of file
arkui/ace_ets_web_dev_two/entry/src/main/module.json
浏览文件 @
542ff113
...
@@ -46,4 +46,4 @@
...
@@ -46,4 +46,4 @@
}
}
]
]
}
}
}
}
\ No newline at end of file
arkui/ace_ets_web_dev_two/entry/src/main/resources/rawfile/index.html
浏览文件 @
542ff113
...
@@ -66,5 +66,8 @@
...
@@ -66,5 +66,8 @@
function
openRawFile
(){
function
openRawFile
(){
document
.
getElementById
(
"
fileAccess
"
).
click
()
document
.
getElementById
(
"
fileAccess
"
).
click
()
}
}
function
gettitle
(){
return
document
.
title
}
</script>
</script>
</html>
</html>
\ No newline at end of file
arkui/ace_ets_web_dev_two/entry/src/main/resources/rawfile/second.html
浏览文件 @
542ff113
...
@@ -9,4 +9,9 @@
...
@@ -9,4 +9,9 @@
<body>
<body>
<div
style=
"height: 1300px;background-color: #999999;"
>
second pages
</div>
<div
style=
"height: 1300px;background-color: #999999;"
>
second pages
</div>
</body>
</body>
<script>
function
gettitle
(){
return
document
.
title
}
</script>
</html>
</html>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录