提交 6c3ca987 编写于 作者: X xinking129

fix code check

Signed-off-by: Nxinking129 <xinxin13@huawei.com>
上级 b02c7e67
......@@ -13,19 +13,15 @@
* limitations under the License.
*/
import ActionExtensionAbility from '@ohos.app.ability.ActionExtensionAbility';
import wantConstant from '@ohos.app.ability.wantConstant';
import commonEvent from '@ohos.commonEventManager';
import hilog from '@ohos.hilog';
export default class UiExtAbility extends ActionExtensionAbility {
onCreate() {
hilog.info(0x0000, 'testTag', 'UIExtAbility onCreate want: %{public}s');
console.info('=======>UIExtAbility onCreate======>');
}
onSessionCreate(want, session) {
console.log(`want: ${JSON.stringify(want)}}`);
var storage: LocalStorage = new LocalStorage({
let storage: LocalStorage = new LocalStorage({
'session': session
});
session.loadContent('pages/Page', storage);
......
......@@ -15,7 +15,7 @@
import ActionExtensionAbility from '@ohos.app.ability.ActionExtensionAbility';
import commonEventManager from '@ohos.commonEventManager';
var count = 0;
let count = 0;
const TIME_OUT = 500;
export default class ActsActionExtensionAbility extends ActionExtensionAbility {
storage: LocalStorage;
......@@ -28,18 +28,18 @@ export default class ActsActionExtensionAbility extends ActionExtensionAbility {
onForeground() {
console.log('====>ActsActionExtensionAbility onForeground called');
count++;
var options = {
let options = {
parameters: {
'count': count
}
}
commonEventManager.publish('ACTS_TEST_FOREGROUND', options, function (){});
};
commonEventManager.publish('ACTS_TEST_FOREGROUND', options, function () {});
}
onBackground() {
console.log('====>ActsActionExtensionAbility onBackground called');
count++;
commonEventManager.publish('ACTS_TEST_BACKGROUND', function (){});
commonEventManager.publish('ACTS_TEST_BACKGROUND', function () {});
setTimeout(() => {
globalThis.session.terminateSelf();
}, TIME_OUT);
......@@ -61,12 +61,12 @@ export default class ActsActionExtensionAbility extends ActionExtensionAbility {
onDestroy() {
console.log('====>ActsActionExtensionAbility onDestroy called');
count++;
var options = {
let options = {
parameters: {
'count': count
}
}
commonEventManager.publish('ACTS_TEST_DESTROY', options, function (){});
};
commonEventManager.publish('ACTS_TEST_DESTROY', options, function () {});
}
onSessionDestroy(session) {
......
......@@ -29,8 +29,8 @@ export default class EntryAbility extends UIAbility {
'ability.want.params.uiExtensionType': 'action'
}
}).catch((err)=>{
console.info('====>ActionExtensionAbility_0100 err:'+ JSON.stringify(err));
})
console.info('====>ActionExtensionAbility_0100 err:' + JSON.stringify(err));
});
}
if (want.action === 'AsyncCallback_0200') {
......
......@@ -25,7 +25,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
onSessionCreate(want, session) {
console.log(`want: ${JSON.stringify(want)}}`);
var storage: LocalStorage = new LocalStorage({
let storage: LocalStorage = new LocalStorage({
'session': session
});
session.loadContent('pages/Page', storage);
......@@ -42,7 +42,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
}
}, (error) => {
console.info('=======>Acts_ActionExtensionAbility_1000 error.code ======>' + error.code);
var commonEventData = {
let commonEventData = {
parameters: {
num: error.code
}
......@@ -64,7 +64,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
}
}).then(() => {
console.info('=======>Acts_ActionExtensionAbility_1100 UIExtAbility startAbility success ======>');
var commonEventData = {
let commonEventData = {
parameters: {
str: 'success'
}
......@@ -74,7 +74,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
});
}).catch((err) => {
console.debug('====>Acts_ActionExtensionAbility_1100 UIExtAbility startAbility err:' + JSON.stringify(err));
})
});
}
if (want.action === 'Acts_ActionExtensionAbility_1200') {
......@@ -88,7 +88,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
}
}, (error) => {
console.info('=======>Acts_ActionExtensionAbility_1200 error.code ======>' + error.code);
var commonEventData = {
let commonEventData = {
parameters: {
num: error.code
}
......@@ -112,7 +112,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
console.info('=======>Acts_ActionExtensionAbility_1300 error.code ======>' + error.code);
console.info('=======>Acts_ActionExtensionAbility_1300 data.resultCode ======>' + data.resultCode);
console.info('=======>Acts_ActionExtensionAbility_1300 data.action ======>' + data.want.parameters.action);
var commonEventData = {
let commonEventData = {
parameters: {
num: error.code,
str: data.want.parameters.action,
......@@ -137,7 +137,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
}).then((data) => {
console.info('=======>Acts_ActionExtensionAbility_1400 data.resultCode ======>' + data.resultCode);
console.info('=======>Acts_ActionExtensionAbility_1400 data.action ======>' + data.want.parameters.action);
var commonEventData = {
let commonEventData = {
parameters: {
str: data.want.parameters.action,
result: data.resultCode
......@@ -162,7 +162,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
}
}, (error, data) => {
console.info('=======>Acts_ActionExtensionAbility_1500 first from own error.code ======>' + error.code);
var commonEventData = {
let commonEventData = {
parameters: {
num: error.code
}
......@@ -179,7 +179,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
parameters: {
'result': data
}
}
};
commonEvent.publish('setReceiveDataCallback', options, (err) => {
console.log('Acts_ActionExtensionAbility_1600');
});
......@@ -194,7 +194,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
abilityName: 'ActsActionExtensionAbility'
}, (error, data) => {
console.info('=======>Acts_ActionExtensionAbility_1800 first from own error.code ======>' + error.code);
var commonEventData = {
let commonEventData = {
parameters: {
num: error.code
}
......@@ -210,7 +210,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
parameters: {
'context': this.context
}
}
};
commonEvent.publish('ACTS_TEST_CONTEXT', options, (err) => {
console.log('Acts_ActionExtensionAbility_context');
});
......@@ -330,24 +330,24 @@ export default class UiExtAbility extends ActionExtensionAbility {
}
if (want.action === 'Acts_ActionExtensionAbility_3000') {
var moduleContext = this.context.createModuleContext('entry');
let moduleContext = this.context.createModuleContext('entry');
let options = {
parameters: {
'bundleName': moduleContext.applicationInfo.name
}
}
};
commonEvent.publish('ACTS_TEST_CONTEXT', options, (err) => {
console.log('Acts_ActionExtensionAbility_context');
});
}
if (want.action === 'Acts_ActionExtensionAbility_3100') {
var moduleContext = this.context.createModuleContext('entry_test');
let moduleContext = this.context.createModuleContext('entry_test');
let options = {
parameters: {
'bundleName': moduleContext.applicationInfo.name
}
}
};
commonEvent.publish('ACTS_TEST_CONTEXT', options, (err) => {
console.log('Acts_ActionExtensionAbility_context');
});
......@@ -355,7 +355,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
if (want.action === 'Acts_ActionExtensionAbility_3200') {
try {
var moduleContext = this.context.createModuleContext('entry_assist');
let moduleContext = this.context.createModuleContext('entry_assist');
} catch {
console.log('createModuleContext err');
}
......@@ -363,7 +363,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
parameters: {
'moduleContext': moduleContext
}
}
};
commonEvent.publish('ACTS_TEST_CONTEXT', options, (err) => {
console.log('Acts_ActionExtensionAbility_context');
});
......@@ -371,7 +371,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
if (want.action === 'Acts_ActionExtensionAbility_3300') {
try {
var moduleContext = this.context.createModuleContext('abc');
let moduleContext = this.context.createModuleContext('abc');
} catch {
console.log('createModuleContext err');
}
......@@ -379,7 +379,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
parameters: {
'moduleContext': moduleContext
}
}
};
commonEvent.publish('ACTS_TEST_CONTEXT', options, (err) => {
console.log('Acts_ActionExtensionAbility_context');
});
......@@ -387,7 +387,7 @@ export default class UiExtAbility extends ActionExtensionAbility {
if (want.action === 'Acts_ActionExtensionAbility_3400') {
try {
var moduleContext = this.context.createModuleContext(undefined);
let moduleContext = this.context.createModuleContext(undefined);
} catch {
console.log('createModuleContext err');
}
......@@ -395,19 +395,19 @@ export default class UiExtAbility extends ActionExtensionAbility {
parameters: {
'moduleContext': moduleContext
}
}
};
commonEvent.publish('ACTS_TEST_CONTEXT', options, (err) => {
console.log('Acts_ActionExtensionAbility_context');
});
}
if (want.action === 'Acts_ActionExtensionAbility_3500') {
var applicationContext = this.context.getApplicationContext();
let applicationContext = this.context.getApplicationContext();
let options = {
parameters: {
'applicationContext': applicationContext
}
}
};
commonEvent.publish('ACTS_TEST_CONTEXT', options, (err) => {
console.log('Acts_ActionExtensionAbility_context');
});
......
......@@ -15,7 +15,7 @@
import ActionExtensionAbility from '@ohos.app.ability.ActionExtensionAbility';
import commonEventManager from '@ohos.commonEventManager';
var count = 0;
let count = 0;
const TIME_OUT = 500;
export default class ActsActionExtensionAbility extends ActionExtensionAbility {
storage: LocalStorage;
......@@ -32,14 +32,14 @@ export default class ActsActionExtensionAbility extends ActionExtensionAbility {
parameters: {
'count': count
}
}
commonEventManager.publish('ACTS_TEST_FOREGROUND', options, function (){});
};
commonEventManager.publish('ACTS_TEST_FOREGROUND', options, function () {});
}
onBackground() {
console.log('====>ActsActionExtensionAbility onBackground called');
count++;
commonEventManager.publish('ACTS_TEST_BACKGROUND', function (){});
commonEventManager.publish('ACTS_TEST_BACKGROUND', function () {});
setTimeout(() => {
globalThis.session.terminateSelf();
}, TIME_OUT);
......@@ -61,12 +61,12 @@ export default class ActsActionExtensionAbility extends ActionExtensionAbility {
onDestroy() {
console.log('====>ActsActionExtensionAbility onDestroy called');
count++;
var options = {
let options = {
parameters: {
'count': count
}
}
commonEventManager.publish('ACTS_TEST_DESTROY', options, function (){});
};
commonEventManager.publish('ACTS_TEST_DESTROY', options, function () {});
}
onSessionDestroy(session) {
......
......@@ -31,7 +31,7 @@ export default class FeatureActionExtensionAbility extends ActionExtensionAbilit
onSessionCreate(want, session) {
console.log('====>FeatureActionExtensionAbility onSessionCreate called');
commonEventManager.publish('ACTS_FEATURE_CREATE', function (){});
commonEventManager.publish('ACTS_FEATURE_CREATE', function () {});
if (want.action === 'Acts_ActionExtensionAbility_0400') {
this.context.startAbility({
bundleName: 'com.example.actsactionextensionabilitytest',
......
......@@ -14,7 +14,7 @@
*/
import UIAbility from '@ohos.app.ability.UIAbility';
import hilog from '@ohos.hilog';
import window from '@ohos.window';
import type window from '@ohos.window';
export default class FeatureAbility extends UIAbility {
onCreate(want, launchParam) {
......
......@@ -16,8 +16,8 @@ import hilog from '@ohos.hilog';
import TestRunner from '@ohos.application.testRunner';
import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry';
var abilityDelegator = undefined;
var abilityDelegatorArguments = undefined;
let abilityDelegator = undefined;
let abilityDelegatorArguments = undefined;
async function onAbilityCreateCallback() {
hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback');
......@@ -39,14 +39,14 @@ export default class OpenHarmonyTestRunner implements TestRunner {
hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run');
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments();
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility';
var lMonitor = {
let testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility';
let lMonitor = {
abilityName: testAbilityName,
onAbilityCreate: onAbilityCreateCallback,
};
abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback);
var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName;
var debug = abilityDelegatorArguments.parameters['-D'];
let cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName;
let debug = abilityDelegatorArguments.parameters['-D'];
if (debug == 'true') {
cmd += ' -D';
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册