提交 2dc690eb 编写于 作者: Y ywx1211260

revise_file

Signed-off-by: Nywx1211260 <yupeng78@huawei-partners.com>
上级 6b494082
...@@ -32,7 +32,7 @@ struct Index { ...@@ -32,7 +32,7 @@ struct Index {
host: string = "www.spincast.org" host: string = "www.spincast.org"
realm: string = "protected example" realm: string = "protected example"
username_password: string[] username_password: string[]
origin: string="file:///" origin: string="resource://rawfile/"
onPageShow(){ onPageShow(){
let valueChangeEvent={ let valueChangeEvent={
eventId:10, eventId:10,
...@@ -84,8 +84,12 @@ struct Index { ...@@ -84,8 +84,12 @@ struct Index {
}) })
break; break;
} }
case "emitAllowGeolocation":{ case "emitAllowGeolocation":{
web_webview.GeolocationPermissions.allowGeolocation("file:///") try {
web_webview.GeolocationPermissions.allowGeolocation("resource://rawfile/");
} catch (error) {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
}
web_webview.GeolocationPermissions.getAccessibleGeolocation(this.origin, (error, result) => { web_webview.GeolocationPermissions.getAccessibleGeolocation(this.origin, (error, result) => {
if (error) { if (error) {
console.log('error:' + JSON.stringify(error)); console.log('error:' + JSON.stringify(error));
...@@ -98,7 +102,7 @@ struct Index { ...@@ -98,7 +102,7 @@ struct Index {
break; break;
} }
case "emitDeleteGeolocation":{ case "emitDeleteGeolocation":{
web_webview.GeolocationPermissions.deleteGeolocation("file:///") web_webview.GeolocationPermissions.deleteGeolocation("resource://rawfile/")
web_webview.GeolocationPermissions.getStoredGeolocation((error,origins) => { web_webview.GeolocationPermissions.getStoredGeolocation((error,origins) => {
if (error) { if (error) {
console.log('error:' + JSON.stringify(error)); console.log('error:' + JSON.stringify(error));
...@@ -111,7 +115,7 @@ struct Index { ...@@ -111,7 +115,7 @@ struct Index {
break; break;
} }
case "emitDeleteAllGeolocation":{ case "emitDeleteAllGeolocation":{
web_webview.GeolocationPermissions.allowGeolocation("file:///") web_webview.GeolocationPermissions.allowGeolocation("resource://rawfile/")
web_webview.GeolocationPermissions.deleteAllGeolocation() web_webview.GeolocationPermissions.deleteAllGeolocation()
web_webview.GeolocationPermissions.getStoredGeolocation((error,origins) => { web_webview.GeolocationPermissions.getStoredGeolocation((error,origins) => {
if (error) { if (error) {
...@@ -160,7 +164,7 @@ struct Index { ...@@ -160,7 +164,7 @@ struct Index {
break; break;
} }
case "emitLoaData":{ case "emitLoaData":{
this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/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><title>index</title></html>",
......
...@@ -29,9 +29,13 @@ export default class Utils { ...@@ -29,9 +29,13 @@ export default class Utils {
console.info(`[${testCaseName}] START`); console.info(`[${testCaseName}] START`);
try{ try{
let callBack=(backData)=>{ let callBack=(backData)=>{
try{
console.info(`${testCaseName} get result is:`+JSON.stringify(backData)); console.info(`${testCaseName} get result is:`+JSON.stringify(backData));
expect(backData.data.ACTION).assertEqual(expectedValue); expect(backData.data.ACTION).assertEqual(expectedValue);
console.info(`[${testCaseName}] END`); console.info(`[${testCaseName}] END`);
}catch(err){
console.info(`[${testCaseName}] err:`+JSON.stringify(err));
}
done() done()
} }
let innerEvent = { let innerEvent = {
...@@ -64,10 +68,14 @@ export default class Utils { ...@@ -64,10 +68,14 @@ export default class Utils {
console.info(`[${testCaseName}] START`); console.info(`[${testCaseName}] START`);
try{ try{
let callBack=(backData)=>{ let callBack=(backData)=>{
try{
console.info(`${testCaseName} get result is:`+JSON.stringify(backData)); console.info(`${testCaseName} get result is:`+JSON.stringify(backData));
expect(backData.data.actualValue).assertLarger(backData.data.expectedValue-100); expect(backData.data.actualValue).assertLarger(backData.data.expectedValue-100);
expect(backData.data.actualValue).assertLess(backData.data.expectedValue-(-100)); expect(backData.data.actualValue).assertLess(backData.data.expectedValue-(-100));
console.info(`[${testCaseName}] END`); console.info(`[${testCaseName}] END`);
}catch(err){
console.info(`[${testCaseName}] err:`+JSON.stringify(err));
}
done() done()
} }
let innerEvent = { let innerEvent = {
...@@ -101,9 +109,13 @@ export default class Utils { ...@@ -101,9 +109,13 @@ export default class Utils {
console.info(`[${testCaseName}] START`); console.info(`[${testCaseName}] START`);
try{ try{
let callBack=(backData)=>{ let callBack=(backData)=>{
try{
console.info(`${testCaseName} get result is:`+JSON.stringify(backData)); console.info(`${testCaseName} get result is:`+JSON.stringify(backData));
expect(backData.data.ACTION).assertContain(expectedValue); expect(backData.data.ACTION).assertContain(expectedValue);
console.info(`[${testCaseName}] END`); console.info(`[${testCaseName}] END`);
}catch(err){
console.info(`[${testCaseName}] err:`+JSON.stringify(err));
}
done() done()
} }
let innerEvent = { let innerEvent = {
......
...@@ -61,7 +61,7 @@ export default function webJsunit() { ...@@ -61,7 +61,7 @@ export default function webJsunit() {
*/ */
it('allowGeolocation',0,async function(done){ it('allowGeolocation',0,async function(done){
emitKey="emitDeleteGeolocation"; emitKey="emitDeleteGeolocation";
Utils.registerEvent("allowGeolocation","file:///, result: true",402,done); Utils.registerEvent("allowGeolocation","resource://rawfile/, result: true",402,done);
sendEventByKey('webcomponent',10,''); sendEventByKey('webcomponent',10,'');
}) })
/* /*
...@@ -69,19 +69,19 @@ export default function webJsunit() { ...@@ -69,19 +69,19 @@ export default function webJsunit() {
*tc.name deleteGeolocation *tc.name deleteGeolocation
*tc.desic delete specific restored geolocation *tc.desic delete specific restored geolocation
*/ */
it('deletGeolocation',0,async function(done){ it('deleteGeolocation',0,async function(done){
emitKey="emitDeleteAllGeolocation"; emitKey="emitDeleteAllGeolocation";
Utils.registerEvent("deletGeolocation","",404,done); Utils.registerEvent("deleteGeolocation","",404,done);
sendEventByKey('webcomponent',10,''); sendEventByKey('webcomponent',10,'');
}) })
/* /*
*tc.number SUB_ACE_BASIC_ETS_API_069 *tc.number SUB_ACE_BASIC_ETS_API_069
*tc.name deletAllGeolocation *tc.name deleteAllGeolocation
*tc.desic delete all restored geolocation *tc.desic delete all restored geolocation
*/ */
it('deletAllGeolocation',0,async function(done){ it('deleteAllGeolocation',0,async function(done){
emitKey="emitIsCookieAllowed"; emitKey="emitIsCookieAllowed";
Utils.registerEvent("deletAllGeolocation","",406,done); Utils.registerEvent("deleteAllGeolocation","",406,done);
sendEventByKey('webcomponent',10,''); sendEventByKey('webcomponent',10,'');
}) })
/* /*
...@@ -141,7 +141,7 @@ export default function webJsunit() { ...@@ -141,7 +141,7 @@ export default function webJsunit() {
*/ */
it('getSourceId',0,async function(done){ it('getSourceId',0,async function(done){
emitKey="emitLoaData"; emitKey="emitLoaData";
Utils.registerEvent("getSourceId","file:///data/storage/el1/bundle/phone/resources/rawfile/index.html",422,done); Utils.registerEvent("getSourceId","resource://rawfile/index.html",422,done);
sendEventByKey('webcomponent',10,''); sendEventByKey('webcomponent',10,'');
}) })
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册