提交 5b9957a3 编写于 作者: Y ywx1211260

revise_file

Signed-off-by: Nywx1211260 <yupeng78@huawei-partners.com>
上级 557f2a19
......@@ -66,12 +66,12 @@ export default function imageJsunit() {
let obj = JSON.parse(strJson);
console.info("imageTest_0200 obj.$attrs.src is: " + obj.$attrs.src);
console.info("imageTest_0200 obj.obj.$type is: " + obj.$type);
var res = obj.$attrs.src.indexOf('RAWFILE/test.png');
var res = obj.$attrs.src.indexOf('rawfile/test.png');
console.info("imageTest_0200 result is: " + res);
var sres = obj.$attrs.src.slice(res, res + 16);
console.info("imageTest_0200 slice result is: " + sres);
expect(obj.$type).assertEqual('Image');
expect(obj.$attrs.src.slice(res, res + 16)).assertEqual('RAWFILE/test.png');
expect(obj.$attrs.src.slice(res, res + 16)).assertEqual('rawfile/test.png');
console.info('imageTest_0200 END');
done();
});
......
......@@ -70,7 +70,7 @@ export default function buttonJsunit() {
let obj = JSON.parse(strJson);
console.info("[testButton02] component obj is: " + JSON.stringify(obj));
expect(obj.$type).assertEqual('Button');
expect(obj.$attrs.type).assertEqual('ButtonType.Capsule');
expect(obj.$attrs.type).assertEqual('ButtonType.Normal');
done();
});
......
......@@ -72,7 +72,7 @@ struct Index {
case "emitLoadUrl":{
try {
setTimeout(()=>{
this.controller.loadUrl('www.baidu.com');
this.controller.loadUrl($rawfile("index.html"));
setTimeout(()=>{
let title = this.controller.getTitle();
Utils.emitEvent(title,1)
......@@ -150,7 +150,7 @@ struct Index {
this.controller.onInactive();
setTimeout(()=>{
setTimeout(()=>{
this.controller.loadUrl("file:///data/storage/el1/bundle/phone/resources/rawfile/index.html")
this.controller.loadUrl("resource://rawfile/index.html")
},3000)
var title4 = this.controller.getTitle();
Utils.emitEvent(title4,7)
......@@ -263,7 +263,7 @@ struct Index {
}
case "emitSearchAllAsync":{
try {
this.controller.loadUrl("file:///data/storage/el1/bundle/phone/resources/rawfile/index.html")
this.controller.loadUrl("resource://rawfile/index.html")
setTimeout(()=>{
this.controller.searchAllAsync("首页");
},3000)
......
......@@ -29,9 +29,13 @@ export default class Utils {
console.info(`[${testCaseName}] START`);
try{
let callBack=(backData)=>{
try{
console.info(`${testCaseName} get result is:`+JSON.stringify(backData));
expect(backData.data.ACTION).assertEqual(expectedValue);
console.info(`[${testCaseName}] END`);
}catch(err){
console.info(`[${testCaseName}] err:`+JSON.stringify(err));
}
done()
}
let innerEvent = {
......@@ -64,10 +68,14 @@ export default class Utils {
console.info(`[${testCaseName}] START`);
try{
let callBack=(backData)=>{
try{
console.info(`${testCaseName} get result is:`+JSON.stringify(backData));
expect(backData.data.actualValue).assertLarger(backData.data.expectedValue-100);
expect(backData.data.actualValue).assertLess(backData.data.expectedValue-(-100));
console.info(`[${testCaseName}] END`);
}catch(err){
console.info(`[${testCaseName}] err:`+JSON.stringify(err));
}
done()
}
let innerEvent = {
......@@ -101,9 +109,13 @@ export default class Utils {
console.info(`[${testCaseName}] START`);
try{
let callBack=(backData)=>{
try{
console.info(`${testCaseName} get result is:`+JSON.stringify(backData));
expect(backData.data.ACTION).assertContain(expectedValue);
console.info(`[${testCaseName}] END`);
}catch(err){
console.info(`[${testCaseName}] err:`+JSON.stringify(err));
}
done()
}
let innerEvent = {
......
......@@ -51,7 +51,7 @@ export default function webJsunit() {
*/
it('LoadUrl',0,async function(done){
emitKey="emitLoadData";
Utils.registerContainEvent("LoadUrl","百度一下,你就知道",1,done);
Utils.registerContainEvent("LoadUrl","index",1,done);
sendEventByKey('webcomponent',10,'');
})
/*
......@@ -71,7 +71,7 @@ export default function webJsunit() {
*/
it('Backward',0,async function(done){
emitKey="emitForward";
Utils.registerEvent("Backward","百度一下,你就知道",3,done);
Utils.registerEvent("Backward","index",3,done);
sendEventByKey('webcomponent',10,'');
})
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册