Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
f43ae1e6
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看板
提交
f43ae1e6
编写于
4月 24, 2023
作者:
Z
zhanghailin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
webview xts code
Signed-off-by:
N
zhanghailin
<
hlzhangai@isoftstone.com
>
上级
ed6da30f
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
667 addition
and
0 deletion
+667
-0
arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/MainAbility/pages/runJavaScript.ets
...er/entry/src/main/ets/MainAbility/pages/runJavaScript.ets
+111
-0
arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/MainAbility/pages/storeWebArchive.ets
.../entry/src/main/ets/MainAbility/pages/storeWebArchive.ets
+152
-0
arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/MainAbility/pages/storeWebArchiveSaveFail.ets
...rc/main/ets/MainAbility/pages/storeWebArchiveSaveFail.ets
+114
-0
arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/test/runJavaScript.test.ets
...Controller/entry/src/main/ets/test/runJavaScript.test.ets
+88
-0
arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/test/storeWebArchive.test.ets
...ntroller/entry/src/main/ets/test/storeWebArchive.test.ets
+112
-0
arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/test/storeWebArchiveSaveFail.test.ets
.../entry/src/main/ets/test/storeWebArchiveSaveFail.test.ets
+90
-0
未找到文件。
arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/MainAbility/pages/runJavaScript.ets
0 → 100644
浏览文件 @
f43ae1e6
/**
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import events_emitter from '@ohos.events.emitter';
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry';
import { Hypium } from '@ohos/hypium';
import testsuite from '../../test/List.test';
import Utils from '../../test/Utils';
import web_webview from '@ohos.web.webview';
let loadedUrl;
@Entry
@Component
struct Index {
controller: web_webview.WebviewController = new web_webview.WebviewController();
controller2: web_webview.WebviewController = new web_webview.WebviewController();
@State str:string="emitRunJsCallback";
@State webId:number=0;
@State webResult:string=' ';
@State proResult:string=' ';
@State webFilename:string=' ';
@State errorResult:string=' ';
@State userAgent: string = "Mozilla/5.0 (Window NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) CHrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.27";
@State pageResult:boolean=false;
@State javaScriptAccess:boolean=true;
@State fileAccess:boolean=true;
@State domStorageAccess:boolean=false
@State imageAccess:boolean=true
@State onlineImageAccess:boolean=true
@State databaseAccess:boolean=true
onPageShow(){
let valueChangeEvent={
eventId:10,
priority:events_emitter.EventPriority.LOW
}
events_emitter.on(valueChangeEvent,this.valueChangeCallBack)
}
private valueChangeCallBack=(eventData)=>{
console.info("web page valueChangeCallBack");
if(eventData != null){
console.info("valueChangeCallBack:"+ JSON.stringify(eventData));
if(eventData.data.ACTION != null){
this.str = eventData.data.ACTION;
}
}
}
build(){
Column(){
Row() {
Button("web test").key('webcomponent01').onClick(async () => {
console.info("key==>" + this.str)
switch (this.str) {
case "emitRunJsCallback": {
try {
console.info('Running testcaes emitRunJsCallback!!!')
this.controller.runJavaScript(
'testRunJavaScript()',
(error, result) => {
if (error) {
console.info(`run JavaScript error: ` + JSON.stringify(error))
return;
}
if (result) {
this.webResult = 'testRunJavaScript'
Utils.emitEvent(this.webResult, 126)
console.info(`The test() return value is: ${result}`)
}
});
} catch (error) {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
}
}
case "emitRunJsPromise": {
try {
this.controller.runJavaScript('testRunJavaScript()')
.then(function (proResult) {
Utils.emitEvent(proResult, 128)
console.log('proResult: ' + proResult);
})
.catch(function (error) {
console.error("error: " + error);
})
} catch (error) {
console.error(`Errorcode: ${error.code}, Message: ${error.message}`);
}
}
}
})
}
Web({src:$rawfile('index.html'),controller:this.controller})
.javaScriptAccess(this.javaScriptAccess)
.fileAccess(this.fileAccess)
.imageAccess(this.imageAccess)
.domStorageAccess(this.domStorageAccess)
.onlineImageAccess(this.onlineImageAccess)
.databaseAccess(this.databaseAccess)
.userAgent(this.userAgent)
}
}
}
arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/MainAbility/pages/storeWebArchive.ets
0 → 100644
浏览文件 @
f43ae1e6
/**
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import events_emitter from '@ohos.events.emitter';
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry';
import { Hypium } from '@ohos/hypium';
import testsuite from '../../test/List.test';
import Utils from '../../test/Utils';
import web_webview from '@ohos.web.webview';
let loadedUrl;
@Entry
@Component
struct Index {
controller: web_webview.WebviewController = new web_webview.WebviewController();
@State str:string="emitStoreWebArchiveCallback";
@State webId:number=0;
@State webResult:string=' ';
@State proResult:string=' ';
@State webFilename:string=' ';
@State errorResult:string=' ';
@State userAgent: string = "Mozilla/5.0 (Window NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) CHrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.27";
@State pageResult:boolean=false;
@State javaScriptAccess:boolean=true;
@State fileAccess:boolean=true;
@State domStorageAccess:boolean=false
@State imageAccess:boolean=true
@State onlineImageAccess:boolean=true
@State databaseAccess:boolean=true
onPageShow(){
let valueChangeEvent={
eventId:10,
priority:events_emitter.EventPriority.LOW
}
events_emitter.on(valueChangeEvent,this.valueChangeCallBack)
}
private valueChangeCallBack=(eventData)=>{
console.info("web page valueChangeCallBack");
if(eventData != null){
console.info("valueChangeCallBack:"+ JSON.stringify(eventData));
if(eventData.data.ACTION != null){
this.str = eventData.data.ACTION;
}
}
}
build(){
Column(){
Row() {
Button("web test").key('webcomponent02').onClick( () => {
console.info("key==>" + this.str)
switch (this.str) {
case "emitStoreWebArchiveCallback": {
try {
console.info("testoooooooooooooooooooooooooooooooooooo");
this.controller.storeWebArchive("/data/storage/el2/base/", true, (error, filename) => {
if (error) {
console.info(`save web archive error: ` + JSON.stringify(error))
return;
}
if (filename != null) {
console.info(`save web archive success: ${filename}`)
this.webFilename = filename
Utils.emitEvent(this.webFilename, 130)
}
});
}catch (error) {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
}
break;
}
case "emitStoreWebArchiveCallbackFalse": {
try {
console.info("testAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
this.controller.storeWebArchive("/data/storage/el2/base/index.html.mht", false, (error, filename) => {
if (error) {
console.info(`save web archive error: ` + JSON.stringify(error))
return;
}
if (filename != null) {
console.info(`save web archive success: ${filename}`)
this.webFilename = filename
Utils.emitEvent(this.webFilename, 132)
}
});
}catch (error) {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
}
break;
}
case "emitStoreWebArchivePromise": {
try {
console.info("testBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB");
this.controller.storeWebArchive("/data/storage/el2/base/", true)
.then(filename => {
if (filename != null) {
this.webFilename = filename
Utils.emitEvent(this.webFilename, 134)
console.info(`save web archive success: ${filename}`)
}
})
.catch(error => {
console.log('error: ' + JSON.stringify(error));
})
} catch (error) {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
}
break;
}
case "emitStoreWebArchivePromiseFlase": {
try {
console.info("testCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC");
this.controller.storeWebArchive("/data/storage/el2/base/index.html-2.mht", false)
.then(filename => {
if (filename != null) {
this.webFilename = filename
Utils.emitEvent(this.webFilename, 136)
console.info(`save web archive success: ${filename}`)
}
})
.catch(error => {
console.log('error: ' + JSON.stringify(error));
})
} catch (error) {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
}
break;
}
}
})
}
Web({src:$rawfile('index.html'),controller:this.controller})
.javaScriptAccess(this.javaScriptAccess)
.fileAccess(this.fileAccess)
.imageAccess(this.imageAccess)
.domStorageAccess(this.domStorageAccess)
.onlineImageAccess(this.onlineImageAccess)
.databaseAccess(this.databaseAccess)
.userAgent(this.userAgent)
}
}
}
arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/MainAbility/pages/storeWebArchiveSaveFail.ets
0 → 100644
浏览文件 @
f43ae1e6
/**
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import events_emitter from '@ohos.events.emitter';
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry';
import { Hypium } from '@ohos/hypium';
import testsuite from '../../test/List.test';
import Utils from '../../test/Utils';
import web_webview from '@ohos.web.webview';
let loadedUrl;
@Entry
@Component
struct Index {
controller: web_webview.WebviewController = new web_webview.WebviewController();
@State str:string="emitStoreWebArchiveCallbackSaveFail";
@State webId:number=0;
@State webResult:string=' ';
@State proResult:string=' ';
@State webFilename:string=' ';
@State errorResult:string=' ';
@State userAgent: string = "Mozilla/5.0 (Window NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) CHrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.27";
@State pageResult:boolean=false;
@State javaScriptAccess:boolean=true;
@State fileAccess:boolean=true;
@State domStorageAccess:boolean=false
@State imageAccess:boolean=true
@State onlineImageAccess:boolean=true
@State databaseAccess:boolean=true
onPageShow(){
let valueChangeEvent={
eventId:10,
priority:events_emitter.EventPriority.LOW
}
events_emitter.on(valueChangeEvent,this.valueChangeCallBack)
}
private valueChangeCallBack=(eventData)=>{
console.info("web page valueChangeCallBack");
if(eventData != null){
console.info("valueChangeCallBack:"+ JSON.stringify(eventData));
if(eventData.data.ACTION != null){
this.str = eventData.data.ACTION;
}
}
}
build(){
Column(){
Row() {
Button("web test").key('webcomponent03').onClick(async () => {
console.info("key==>" + this.str)
switch (this.str) {
case "emitStoreWebArchiveCallbackSaveFail": {
try {
this.controller.loadUrl($rawfile('blanknull.html'))
this.controller.storeWebArchive("/data/storage/el2/base/", true, (error, filename) => {
if (error) {
console.info(`save web archive error: ` + JSON.stringify(error))
return;
}
if (filename != null) {
console.info(`save web archive success: ${filename}`)
this.webFilename = filename
Utils.emitEvent(this.webFilename, 138)
}
});
}catch (error) {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
}
break;
}
case "emitStoreWebArchivePromiseSaveFail": {
try {
this.controller.loadUrl($rawfile('blanknull.html'))
this.controller.storeWebArchive("/data/storage/el2/base/", true)
.then(filename => {
if (filename != null) {
this.webFilename = filename
Utils.emitEvent(this.webFilename, 140)
console.info(`save web archive success: ${filename}`)
}
})
.catch(error => {
console.log('error: ' + JSON.stringify(error));
})
} catch (error) {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
}
break;
}
}
})
}
Web({src:$rawfile('blanknull.html'),controller:this.controller})
.javaScriptAccess(this.javaScriptAccess)
.fileAccess(this.fileAccess)
.imageAccess(this.imageAccess)
.domStorageAccess(this.domStorageAccess)
.onlineImageAccess(this.onlineImageAccess)
.databaseAccess(this.databaseAccess)
.userAgent(this.userAgent)
}
}
}
arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/test/runJavaScript.test.ets
0 → 100644
浏览文件 @
f43ae1e6
/**
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils.ets';
import router from '@system.router';
let emitKey = "emitRunJsCallback";
export default function runJavaScript() {
describe('ActsAceWebControllerTest', function () {
beforeAll(async function (done) {
let options = {
uri: "MainAbility/pages/runJavaScript"
}
try {
router.clear();
let pages = router.getState();
console.info("get runJavaScript state success " + JSON.stringify(pages));
if (!("runJavaScript" == pages.name)) {
console.info("get runJavaScript state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push runJavaScript page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push runJavaScript page error: " + err);
}
await Utils.sleep(2000);
done()
})
beforeEach(async function (done) {
console.info("web beforeEach start");
done();
})
afterEach(async function (done) {
console.info("ActsAceWebControllerTest afterEach start:"+emitKey);
try {
let backData = {
data: {
"ACTION": emitKey
}
}
let backEvent = {
eventId:10,
priority:events_emitter.EventPriority.LOW
}
console.info("start send emitKey");
events_emitter.emit(backEvent, backData);
} catch (err) {
console.info("emit emitKey err: " + JSON.stringify(err));
}
await Utils.sleep(2000);
console.info("ActsAceWebControllerTest afterEach end");
done();
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_001
*tc.name RunJsCallback
*tc.desic test RunJavascrit interface when choose callback mode.
*/
it('RunJsCallback',0,async function(done){
emitKey="emitRunJsPromise";
Utils.registerEvent("testRunJsCallback",'testRunJavaScript',126,done);
sendEventByKey('webcomponent01',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_002
*tc.name RunJsPromise
*tc.desic test RunJavascrit interface when choose promise mode.
*/
it('RunJsPromise',0,async function(done){
Utils.registerEvent("testRunJsPromise",'\"testRunJavaScript\"',128,done);
sendEventByKey('webcomponent01',10,'');
})
})
}
arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/test/storeWebArchive.test.ets
0 → 100644
浏览文件 @
f43ae1e6
/**
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils.ets';
import router from '@system.router';
let emitKey = "emitStoreWebArchiveCallback";
export default function storeWebArchive() {
describe('ActsAceWebControllerTest', function () {
beforeAll(async function (done) {
let options = {
uri: "MainAbility/pages/storeWebArchive"
}
try {
router.clear();
let pages = router.getState();
console.info("get storeWebArchive state success " + JSON.stringify(pages));
if (!("storeWebArchive" == pages.name)) {
console.info("get storeWebArchive state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push storeWebArchive page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push storeWebArchive page error: " + err);
}
await Utils.sleep(2000);
done()
})
beforeEach(async function (done) {
console.info("web beforeEach start");
done();
})
afterEach(async function (done) {
console.info("ActsAceWebControllerTest afterEach start:"+emitKey);
try {
let backData = {
data: {
"ACTION": emitKey
}
}
let backEvent = {
eventId:10,
priority:events_emitter.EventPriority.LOW
}
console.info("start send emitKey");
events_emitter.emit(backEvent, backData);
} catch (err) {
console.info("emit emitKey err: " + JSON.stringify(err));
}
await Utils.sleep(2000);
console.info("ActsAceWebViewOnWindowNewJsunitTest afterEach end");
done();
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_003
*tc.name testStoreWebArchiveCallback
*tc.desic test storeWebArchive interface when choose Callback mode and autoName parameter is ture.
*/
it('testStoreWebArchiveCallback',0,async function(done){
emitKey="emitStoreWebArchiveCallbackFalse";
Utils.registerEvent("testStoreWebArchiveCallback","/data/storage/el2/base/index.html.mht",130,done);
sendEventByKey('webcomponent02',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_004
*tc.name testStoreWebArchiveCallbackFalse
*tc.desic test storeWebArchive interface when choose Callback mode and autoName parameter is false.
*/
it('testStoreWebArchiveCallbackFalse',0,async function(done){
emitKey="emitStoreWebArchivePromise";
Utils.registerEvent("testStoreWebArchiveCallbackFalse","/data/storage/el2/base/index.html.mht",132,done);
sendEventByKey('webcomponent02',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_005
*tc.name testStoreWebArchivePromise
*tc.desic test storeWebArchive interface when choose Promise mode and autoName parameter is ture.
*/
it('testStoreWebArchivePromise',0,async function(done){
emitKey="emitStoreWebArchivePromiseFlase";
Utils.registerEvent("testStoreWebArchivePromise","/data/storage/el2/base/index.html-0.mht",134,done);
sendEventByKey('webcomponent02',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_006
*tc.name testStoreWebArchivePromiseFalse
*tc.desic test storeWebArchive interface when choose Promise mode and autoName parameter is false.
*/
it('testStoreWebArchivePromiseFalse',0,async function(done){
Utils.registerEvent("testStoreWebArchivePromiseFalse","/data/storage/el2/base/index.html-2.mht",136,done);
sendEventByKey('webcomponent02',10,'');
})
})
}
\ No newline at end of file
arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/test/storeWebArchiveSaveFail.test.ets
0 → 100644
浏览文件 @
f43ae1e6
/**
* Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils.ets';
import router from '@system.router';
let emitKey = "emitStoreWebArchiveCallbackSaveFail";
export default function storeWebArchiveSaveFail() {
describe('ActsAceWebControllerTest', function () {
beforeAll(async function (done) {
let options = {
uri: "MainAbility/pages/storeWebArchiveSaveFail"
}
try {
router.clear();
let pages = router.getState();
console.info("get storeWebArchiveSaveFail state success " + JSON.stringify(pages));
if (!("storeWebArchiveSaveFail" == pages.name)) {
console.info("get storeWebArchiveSaveFail state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push storeWebArchiveSaveFail page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push storeWebArchiveSaveFail page error: " + err);
}
await Utils.sleep(2000);
done()
})
beforeEach(async function (done) {
console.info("web beforeEach start");
done();
})
afterEach(async function (done) {
console.info("ActsAceWebControllerTest afterEach start:"+emitKey);
try {
let backData = {
data: {
"ACTION": emitKey
}
}
let backEvent = {
eventId:10,
priority:events_emitter.EventPriority.LOW
}
console.info("start send emitKey");
events_emitter.emit(backEvent, backData);
} catch (err) {
console.info("emit emitKey err: " + JSON.stringify(err));
}
await Utils.sleep(2000);
console.info("ActsAceWebControllerTest afterEach end");
done();
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_007
*tc.name testStoreWebArchiveCallback
*tc.desic test storeWebArchiveCallback interface when save file failed.
*/
it('testStoreWebArchiveCallback',0,async function(done){
emitKey="emitStoreWebArchivePromiseSaveFail";
Utils.registerEvent("testStoreWebArchiveCallback","/data/storage/el2/base/blanknull.html.mht",138,done);
sendEventByKey('webcomponent03',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_008
*tc.name testStoreWebArchivePromise
*tc.desic test storeWebArchivePromise interface when save file failed.
*/
it('testStoreWebArchivePromise',0,async function(done){
Utils.registerEvent("testStoreWebArchivePromise","/data/storage/el2/base/blanknull.html-0.mht",140,done);
sendEventByKey('webcomponent03',10,'');
})
})
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录