未验证 提交 83a6e6ec 编写于 作者: O openharmony_ci 提交者: Gitee

!9496 【OpenHarmony 4.0.9.3】【Master】【Web子系统】【TOD】【rk3568】【必现】修改xts用例

Merge pull request !9496 from yupeng/master
...@@ -36,6 +36,7 @@ struct OnWindowNew { ...@@ -36,6 +36,7 @@ struct OnWindowNew {
@State imageAccess:boolean=true; @State imageAccess:boolean=true;
@State onlineImageAccess:boolean=true; @State onlineImageAccess:boolean=true;
@State databaseAccess:boolean=true; @State databaseAccess:boolean=true;
@State arr:boolean = true;
onPageShow(){ onPageShow(){
let valueChangeEvent={ let valueChangeEvent={
eventId:10, eventId:10,
...@@ -78,9 +79,11 @@ struct OnWindowNew { ...@@ -78,9 +79,11 @@ struct OnWindowNew {
this.javaScriptAccess = true; this.javaScriptAccess = true;
this.testAllowWindowOpenMethod = false; this.testAllowWindowOpenMethod = false;
this.testMultiWindowAccess = true; this.testMultiWindowAccess = true;
this.controller.runJavaScript("OpenNewWindow()", (res) => { setTimeout(()=> {
Utils.emitEvent(this.ref, 7102) this.controller.runJavaScript("OpenNewWindow()", (res) => {
}) Utils.emitEvent(this.ref, 7102)
})
},2000)
} catch (error) { } catch (error) {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`); console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
} }
...@@ -154,19 +157,20 @@ struct OnWindowNew { ...@@ -154,19 +157,20 @@ struct OnWindowNew {
break; break;
} }
case "emitGetOriginsPromiseLoadLocalHtml01": { case "emitGetOriginsPromiseLoadLocalHtml01": {
this.arr = false
let length = -1; let length = -1;
try { try {
this.controller.loadUrl($rawfile('getOrigins.html')); this.controller.loadUrl($rawfile('getOrigins.html'));
web_webview.WebStorage.getOrigins() setTimeout(()=> {
.then(origins => { web_webview.WebStorage.getOrigins()
console.log(`getOrigins call`); .then(origins => {
if (origins) { console.log(`getOrigins call`);
length = origins.length; length = origins.length;
console.log(`length is: ${length}`); console.log(`length is: ${length}`);
} Utils.emitEvent(length, 7166);
console.log(`getOrigins call end`); console.log(`getOrigins call end`);
Utils.emitEvent(length, 7166);
}) })
},2000)
} catch (error) { } catch (error) {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`); console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
Utils.emitEvent(length, 7166); Utils.emitEvent(length, 7166);
...@@ -189,10 +193,12 @@ struct OnWindowNew { ...@@ -189,10 +193,12 @@ struct OnWindowNew {
} }
}) })
.onPageVisible((event) => { .onPageVisible((event) => {
if (event) { if (this.arr) {
console.log('onWindowNew onPageVisible url:' + event.url); if (event) {
Utils.emitEvent(event.url, this.eventId); console.log('onWindowNew onPageVisible url:' + event.url);
} Utils.emitEvent(event.url, this.eventId);
}
}
}) })
.blockNetwork(this.block) .blockNetwork(this.block)
.onErrorReceive((event) => { .onErrorReceive((event) => {
......
...@@ -124,7 +124,7 @@ struct Index { ...@@ -124,7 +124,7 @@ struct Index {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`); console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
} }
this.controller.runJavaScript("test()",(res) => { this.controller.runJavaScript("test()",(res) => {
Utils.emitEvent(this.userAgentAll, 102) Utils.emitEvent(this.userAgentAll, 1020)
}) })
break; break;
} }
......
...@@ -74,8 +74,8 @@ struct webViewOnScroll { ...@@ -74,8 +74,8 @@ struct webViewOnScroll {
try { try {
this.firstId = 316; this.firstId = 316;
this.secondId = 318; this.secondId = 318;
this.textX = -100; this.textX = -50;
this.textY = -100; this.textY = -50;
this.controller.scrollBy(this.textX, this.textY); this.controller.scrollBy(this.textX, this.textY);
await Utils.sleep(1000) await Utils.sleep(1000)
console.log("action of emitOnscroll is scrollBy" + this.textX + this.textY); console.log("action of emitOnscroll is scrollBy" + this.textX + this.textY);
......
...@@ -60,9 +60,8 @@ export default function webViewControllerJsunit() { ...@@ -60,9 +60,8 @@ export default function webViewControllerJsunit() {
*/ */
it('testGetUserAgent',0,async function(done){ it('testGetUserAgent',0,async function(done){
emitKey="emitgetUserAgentAgain"; emitKey="emitgetUserAgentAgain";
let userAgent= "Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.88 Mobile" + let userAgent= "Mozilla/5.0 (OpenHarmony 4; ohos) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.0.0 Mobile Safari/537.36Mozilla/5.0 (OpenHarmony 4; ohos) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.0.0 Mobile Safari/537.36";
" Safari/537.36Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.88 Mobile Safari/537.36"; Utils.registerEvent("testGetUserAgent",userAgent,1020,done);
Utils.registerEvent("testGetUserAgent",userAgent,102,done);
sendEventByKey('webcomponent',10,''); sendEventByKey('webcomponent',10,'');
}) })
/* /*
...@@ -72,8 +71,7 @@ export default function webViewControllerJsunit() { ...@@ -72,8 +71,7 @@ export default function webViewControllerJsunit() {
*/ */
it('testGetUserAgentAgain',0,async function(done){ it('testGetUserAgentAgain',0,async function(done){
emitKey="emitpageDown"; emitKey="emitpageDown";
let userAgent= "\"Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.88" + let userAgent= "\"Mozilla/5.0 (OpenHarmony 4; ohos) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.0.0 Mobile Safari/537.36\"";
" Mobile Safari/537.36\"";
Utils.registerEvent("testGetUserAgentAgain",userAgent,104,done); Utils.registerEvent("testGetUserAgentAgain",userAgent,104,done);
sendEventByKey('webcomponent',10,''); sendEventByKey('webcomponent',10,'');
}) })
......
...@@ -82,8 +82,8 @@ export default function webViewOnScroll() { ...@@ -82,8 +82,8 @@ export default function webViewOnScroll() {
*/ */
it('testOnscrollAgain',0,async function(done){ it('testOnscrollAgain',0,async function(done){
emitKey="emitOnscrollAgain"; emitKey="emitOnscrollAgain";
Utils.registerEvent("testOnscrollAgain",0,316,done); Utils.registerEvent("testOnscrollAgain",50,316,done);
Utils.registerEvent("testOnscrollAgain",0,318,done); Utils.registerEvent("testOnscrollAgain",50,318,done);
sendEventByKey('webViewOnScroll',10,''); sendEventByKey('webViewOnScroll',10,'');
}) })
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册