提交 829d6f21 编写于 作者: Z zhangfuzhi

语句增加分号

Signed-off-by: Nzhangfuzhi <zhangfuzhi1@huawei.com>
上级 a7431ea4
...@@ -12,13 +12,13 @@ ...@@ -12,13 +12,13 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import { describe, expect, it } from '@ohos/hypium' import { describe, expect, it } from '@ohos/hypium';
import cellular from '@ohos.telephony.data' import cellular from '@ohos.telephony.data';
import observer from '@ohos.telephony.observer'; import observer from '@ohos.telephony.observer';
export default function ObserverJsunit() { export default function ObserverJsunit() {
describe('ObserverJsunit', function () { describe('ObserverJsunit', function () {
console.log("************* Observer Test start *************") console.log("************* Observer Test start *************");
let envReady = false; let envReady = false;
/* /*
...@@ -27,7 +27,7 @@ export default function ObserverJsunit() { ...@@ -27,7 +27,7 @@ export default function ObserverJsunit() {
* @tc.desc : check the getCellularDataState callback to verify the call back data * @tc.desc : check the getCellularDataState callback to verify the call back data
*/ */
it('Telephony_observer_observer_DataConnectState_0100', 0, function (done) { it('Telephony_observer_observer_DataConnectState_0100', 0, function (done) {
console.log("************* Telephony_observer_observer_DataConnectState_0100 Test start *************") console.log("************* Telephony_observer_observer_DataConnectState_0100 Test start *************");
cellular.getCellularDataState((err, data) => { cellular.getCellularDataState((err, data) => {
if (!err) { if (!err) {
var dataConnectStateList = [cellular.DataConnectState.DATA_STATE_UNKNOWN, var dataConnectStateList = [cellular.DataConnectState.DATA_STATE_UNKNOWN,
...@@ -35,14 +35,14 @@ export default function ObserverJsunit() { ...@@ -35,14 +35,14 @@ export default function ObserverJsunit() {
cellular.DataConnectState.DATA_STATE_CONNECTING, cellular.DataConnectState.DATA_STATE_CONNECTING,
cellular.DataConnectState.DATA_STATE_CONNECTED, cellular.DataConnectState.DATA_STATE_CONNECTED,
cellular.DataConnectState.DATA_STATE_SUSPENDED] cellular.DataConnectState.DATA_STATE_SUSPENDED]
expect(dataConnectStateList.indexOf(data) >= 0).assertTrue() expect(dataConnectStateList.indexOf(data) >= 0).assertTrue();
done(); done();
return; return;
} }
console.log("Telephony_CellularData_getCellularDataState_0100 end"); console.log("Telephony_CellularData_getCellularDataState_0100 end");
done() done();
}) })
console.log("************* Telephony_observer_observer_DataConnectState_0100 Test end *************") console.log("************* Telephony_observer_observer_DataConnectState_0100 Test end *************");
}) })
/* /*
...@@ -51,18 +51,18 @@ export default function ObserverJsunit() { ...@@ -51,18 +51,18 @@ export default function ObserverJsunit() {
* @tc.desc : call the on method of networkStateChange * @tc.desc : call the on method of networkStateChange
*/ */
it('Telephony_observer_observer_on_networkStateChange_0100', 0, async function (done) { it('Telephony_observer_observer_on_networkStateChange_0100', 0, async function (done) {
console.log("************* Telephony_observer_observer_on_networkStateChange_0100 Test start *************") console.log("************* Telephony_observer_observer_on_networkStateChange_0100 Test start *************");
try { try {
observer.on('networkStateChange', NetworkState => { observer.on('networkStateChange', NetworkState => {
console.log("on networkStateChange, NetworkState:" + JSON.stringify(NetworkState)); console.log("on networkStateChange, NetworkState:" + JSON.stringify(NetworkState));
expect(typeof NetworkState === undefined).assertFalse() expect(typeof NetworkState === undefined).assertFalse();
}); });
done() done();
} catch (error) { } catch (error) {
expect(false).assertTrue() expect(false).assertTrue();
done() done();
} }
console.log("************* Telephony_observer_observer_on_networkStateChange_0100 Test end *************") console.log("************* Telephony_observer_observer_on_networkStateChange_0100 Test end *************");
}) })
/* /*
...@@ -71,20 +71,20 @@ export default function ObserverJsunit() { ...@@ -71,20 +71,20 @@ export default function ObserverJsunit() {
* @tc.desc : call the on method of networkStateChange * @tc.desc : call the on method of networkStateChange
*/ */
it('Telephony_observer_observer_on_networkStateChange_0200', 0, async function (done) { it('Telephony_observer_observer_on_networkStateChange_0200', 0, async function (done) {
console.log("************* Telephony_observer_observer_on_networkStateChange_0200 Test start *************") console.log("************* Telephony_observer_observer_on_networkStateChange_0200 Test start *************");
try { try {
observer.on('networkStateChange', { observer.on('networkStateChange', {
slotId: 0 slotId: 0
}, NetworkState => { }, NetworkState => {
console.log("on networkStateChange, NetworkState:" + JSON.stringify(NetworkState)); console.log("on networkStateChange, NetworkState:" + JSON.stringify(NetworkState));
expect(typeof NetworkState === undefined).assertFalse() expect(typeof NetworkState === undefined).assertFalse();
}); });
done() done();
} catch (error) { } catch (error) {
expect(false).assertTrue() expect(false).assertTrue();
done() done();
} }
console.log("************* Telephony_observer_observer_on_networkStateChange_0200 Test end *************") console.log("************* Telephony_observer_observer_on_networkStateChange_0200 Test end *************");
}) })
/* /*
...@@ -93,22 +93,22 @@ export default function ObserverJsunit() { ...@@ -93,22 +93,22 @@ export default function ObserverJsunit() {
* @tc.desc : call the off method of networkStateChange * @tc.desc : call the off method of networkStateChange
*/ */
it('Telephony_observer_observer_off_networkStateChange_0100', 0, async function (done) { it('Telephony_observer_observer_off_networkStateChange_0100', 0, async function (done) {
console.log("************* Telephony_observer_observer_off_networkStateChange_0100 Test start *************") console.log("************* Telephony_observer_observer_off_networkStateChange_0100 Test start *************");
try { try {
let callback = NetworkState => { let callback = NetworkState => {
console.log("on networkStateChange, NetworkState:" + JSON.stringify(NetworkState)); console.log("on networkStateChange, NetworkState:" + JSON.stringify(NetworkState));
expect(typeof NetworkState === undefined).assertFalse() expect(typeof NetworkState === undefined).assertFalse();
} }
observer.on('networkStateChange', callback); observer.on('networkStateChange', callback);
// 可以指定传入on中的callback取消一个订阅,也可以不指定callback清空所有订阅。 // 可以指定传入on中的callback取消一个订阅,也可以不指定callback清空所有订阅。
observer.off('networkStateChange', callback); observer.off('networkStateChange', callback);
observer.off('networkStateChange'); observer.off('networkStateChange');
done() done();
} catch (error) { } catch (error) {
expect(false).assertTrue() expect(false).assertTrue();
done() done();
} }
console.log("************* Telephony_observer_observer_off_networkStateChange_0100 Test end *************") console.log("************* Telephony_observer_observer_off_networkStateChange_0100 Test end *************");
}) })
/* /*
...@@ -117,18 +117,18 @@ export default function ObserverJsunit() { ...@@ -117,18 +117,18 @@ export default function ObserverJsunit() {
* @tc.desc : call the on method of signalInfoChange * @tc.desc : call the on method of signalInfoChange
*/ */
it('Telephony_observer_observer_on_signalInfoChange_0100', 0, async function (done) { it('Telephony_observer_observer_on_signalInfoChange_0100', 0, async function (done) {
console.log("************* Telephony_observer_observer_on_signalInfoChange_0100 Test start *************") console.log("************* Telephony_observer_observer_on_signalInfoChange_0100 Test start *************");
try { try {
observer.on('signalInfoChange', SignalInformation => { observer.on('signalInfoChange', SignalInformation => {
console.log("on signalInfoChange, SignalInformation:" + JSON.stringify(SignalInformation)); console.log("on signalInfoChange, SignalInformation:" + JSON.stringify(SignalInformation));
expect(typeof SignalInformation === undefined).assertFalse() expect(typeof SignalInformation === undefined).assertFalse();
}); });
done() done();
} catch (error) { } catch (error) {
expect(false).assertTrue() expect(false).assertTrue();
done() done();
} }
console.log("************* Telephony_observer_observer_on_signalInfoChange_0100 Test end *************") console.log("************* Telephony_observer_observer_on_signalInfoChange_0100 Test end *************");
}) })
/* /*
...@@ -137,20 +137,20 @@ export default function ObserverJsunit() { ...@@ -137,20 +137,20 @@ export default function ObserverJsunit() {
* @tc.desc : call the on method of signalInfoChange * @tc.desc : call the on method of signalInfoChange
*/ */
it('Telephony_observer_observer_on_signalInfoChange_0200', 0, async function (done) { it('Telephony_observer_observer_on_signalInfoChange_0200', 0, async function (done) {
console.log("************* Telephony_observer_observer_on_signalInfoChange_0200 Test start *************") console.log("************* Telephony_observer_observer_on_signalInfoChange_0200 Test start *************");
try { try {
observer.on('signalInfoChange', { observer.on('signalInfoChange', {
slotId: 0 slotId: 0
}, SignalInformation => { }, SignalInformation => {
console.log("on signalInfoChange, SignalInformation:" + JSON.stringify(SignalInformation)); console.log("on signalInfoChange, SignalInformation:" + JSON.stringify(SignalInformation));
expect(typeof SignalInformation === undefined).assertFalse() expect(typeof SignalInformation === undefined).assertFalse();
}); });
done() done();
} catch (error) { } catch (error) {
expect(false).assertTrue() expect(false).assertTrue();
done() done();
} }
console.log("************* Telephony_observer_observer_on_signalInfoChange_0200 Test end *************") console.log("************* Telephony_observer_observer_on_signalInfoChange_0200 Test end *************");
}) })
/* /*
...@@ -159,22 +159,22 @@ export default function ObserverJsunit() { ...@@ -159,22 +159,22 @@ export default function ObserverJsunit() {
* @tc.desc : call the off method of signalInfoChange * @tc.desc : call the off method of signalInfoChange
*/ */
it('Telephony_observer_observer_off_signalInfoChange_0100', 0, async function (done) { it('Telephony_observer_observer_off_signalInfoChange_0100', 0, async function (done) {
console.log("************* Telephony_observer_observer_off_signalInfoChange_0100 Test start *************") console.log("************* Telephony_observer_observer_off_signalInfoChange_0100 Test start *************");
try { try {
let callback = SignalInformation => { let callback = SignalInformation => {
console.log("on signalInfoChange, SignalInformation:" + JSON.stringify(SignalInformation)); console.log("on signalInfoChange, SignalInformation:" + JSON.stringify(SignalInformation));
expect(typeof SignalInformation === undefined).assertFalse() expect(typeof SignalInformation === undefined).assertFalse();
} }
observer.on('signalInfoChange', callback); observer.on('signalInfoChange', callback);
// 可以指定传入on中的callback取消一个订阅,也可以不指定callback清空所有订阅。 // 可以指定传入on中的callback取消一个订阅,也可以不指定callback清空所有订阅。
observer.off('signalInfoChange', callback); observer.off('signalInfoChange', callback);
observer.off('signalInfoChange'); observer.off('signalInfoChange');
done() done();
} catch (error) { } catch (error) {
expect(false).assertTrue() expect(false).assertTrue();
done() done();
} }
console.log("************* Telephony_observer_observer_off_signalInfoChange_0100 Test end *************") console.log("************* Telephony_observer_observer_off_signalInfoChange_0100 Test end *************");
}) })
...@@ -184,19 +184,19 @@ export default function ObserverJsunit() { ...@@ -184,19 +184,19 @@ export default function ObserverJsunit() {
* @tc.desc : call the on method of cellularDataConnectionStateChange * @tc.desc : call the on method of cellularDataConnectionStateChange
*/ */
it('Telephony_observer_observer_on_cellularDataConnectionStateChange_0100', 0, async function (done) { it('Telephony_observer_observer_on_cellularDataConnectionStateChange_0100', 0, async function (done) {
console.log("************* Telephony_observer_observer_on_cellularDataConnectionStateChange_0100 Test start *************") console.log("************* Telephony_observer_observer_on_cellularDataConnectionStateChange_0100 Test start *************");
try { try {
observer.on('cellularDataConnectionStateChange', value => { observer.on('cellularDataConnectionStateChange', value => {
console.log("on cellularDataConnectionStateChange, state:" + value.state + ", network:" + value.network); console.log("on cellularDataConnectionStateChange, state:" + value.state + ", network:" + value.network);
expect(typeof value.state === undefined).assertFalse() expect(typeof value.state === undefined).assertFalse();
expect(typeof value.network === undefined).assertFalse() expect(typeof value.network === undefined).assertFalse();
}); });
done() done();
} catch (error) { } catch (error) {
expect(false).assertTrue() expect(false).assertTrue();
done() done();
} }
console.log("************* Telephony_observer_observer_on_cellularDataConnectionStateChange_0100 Test end *************") console.log("************* Telephony_observer_observer_on_cellularDataConnectionStateChange_0100 Test end *************");
}) })
/* /*
...@@ -205,21 +205,21 @@ export default function ObserverJsunit() { ...@@ -205,21 +205,21 @@ export default function ObserverJsunit() {
* @tc.desc : call the on method of cellularDataConnectionStateChange * @tc.desc : call the on method of cellularDataConnectionStateChange
*/ */
it('Telephony_observer_observer_on_cellularDataConnectionStateChange_0200', 0, async function (done) { it('Telephony_observer_observer_on_cellularDataConnectionStateChange_0200', 0, async function (done) {
console.log("************* Telephony_observer_observer_on_cellularDataConnectionStateChange_0200 Test start *************") console.log("************* Telephony_observer_observer_on_cellularDataConnectionStateChange_0200 Test start *************");
try { try {
observer.on('cellularDataConnectionStateChange', { observer.on('cellularDataConnectionStateChange', {
slotId: 0 slotId: 0
}, value => { }, value => {
console.log("on cellularDataConnectionStateChange, state:" + value.state + ", network:" + value.network); console.log("on cellularDataConnectionStateChange, state:" + value.state + ", network:" + value.network);
expect(typeof value.state === undefined).assertFalse() expect(typeof value.state === undefined).assertFalse();
expect(typeof value.network === undefined).assertFalse() expect(typeof value.network === undefined).assertFalse();
}); });
done() done();
} catch (error) { } catch (error) {
expect(false).assertTrue() expect(false).assertTrue();
done() done();
} }
console.log("************* Telephony_observer_observer_on_cellularDataConnectionStateChange_0200 Test end *************") console.log("************* Telephony_observer_observer_on_cellularDataConnectionStateChange_0200 Test end *************");
}) })
/* /*
...@@ -228,7 +228,7 @@ export default function ObserverJsunit() { ...@@ -228,7 +228,7 @@ export default function ObserverJsunit() {
* @tc.desc : call the off method of cellularDataConnectionStateChange * @tc.desc : call the off method of cellularDataConnectionStateChange
*/ */
it('Telephony_observer_observer_off_cellularDataConnectionStateChange_0100', 0, async function (done) { it('Telephony_observer_observer_off_cellularDataConnectionStateChange_0100', 0, async function (done) {
console.log("************* Telephony_observer_observer_off_cellularDataConnectionStateChange_0100 Test start *************") console.log("************* Telephony_observer_observer_off_cellularDataConnectionStateChange_0100 Test start *************");
try { try {
let callback = value => { let callback = value => {
console.log("on cellularDataConnectionStateChange, state:" + value.state + ", network:" + value.network); console.log("on cellularDataConnectionStateChange, state:" + value.state + ", network:" + value.network);
...@@ -237,12 +237,12 @@ export default function ObserverJsunit() { ...@@ -237,12 +237,12 @@ export default function ObserverJsunit() {
// 可以指定传入on中的callback取消一个订阅,也可以不指定callback清空所有订阅。 // 可以指定传入on中的callback取消一个订阅,也可以不指定callback清空所有订阅。
observer.off('cellularDataConnectionStateChange', callback); observer.off('cellularDataConnectionStateChange', callback);
observer.off('cellularDataConnectionStateChange'); observer.off('cellularDataConnectionStateChange');
done() done();
} catch (error) { } catch (error) {
expect(false).assertTrue() expect(false).assertTrue();
done() done();
} }
console.log("************* Telephony_observer_observer_off_cellularDataConnectionStateChange_0100 Test end *************") console.log("************* Telephony_observer_observer_off_cellularDataConnectionStateChange_0100 Test end *************");
}) })
/* /*
...@@ -251,18 +251,18 @@ export default function ObserverJsunit() { ...@@ -251,18 +251,18 @@ export default function ObserverJsunit() {
* @tc.desc : call the on method of cellularDataFlowChange * @tc.desc : call the on method of cellularDataFlowChange
*/ */
it('Telephony_observer_observer_on_cellularDataFlowChange_0100', 0, async function (done) { it('Telephony_observer_observer_on_cellularDataFlowChange_0100', 0, async function (done) {
console.log("************* Telephony_observer_observer_on_cellularDataFlowChange_0100 Test start *************") console.log("************* Telephony_observer_observer_on_cellularDataFlowChange_0100 Test start *************");
try { try {
observer.on('cellularDataFlowChange', DataFlowType => { observer.on('cellularDataFlowChange', DataFlowType => {
console.log("on networkStateChange, DataFlowType:" + JSON.stringify(DataFlowType)); console.log("on networkStateChange, DataFlowType:" + JSON.stringify(DataFlowType));
expect(typeof DataFlowType === undefined).assertFalse() expect(typeof DataFlowType === undefined).assertFalse();
}); });
done() done();
} catch (error) { } catch (error) {
expect(false).assertTrue() expect(false).assertTrue();
done() done();
} }
console.log("************* Telephony_observer_observer_on_cellularDataFlowChange_0100 Test end *************") console.log("************* Telephony_observer_observer_on_cellularDataFlowChange_0100 Test end *************");
}) })
/* /*
...@@ -271,18 +271,18 @@ export default function ObserverJsunit() { ...@@ -271,18 +271,18 @@ export default function ObserverJsunit() {
* @tc.desc : call the on method of cellularDataFlowChange * @tc.desc : call the on method of cellularDataFlowChange
*/ */
it('Telephony_observer_observer_on_cellularDataFlowChange_0200', 0, async function (done) { it('Telephony_observer_observer_on_cellularDataFlowChange_0200', 0, async function (done) {
console.log("************* Telephony_observer_observer_on_cellularDataFlowChange_0200 Test start *************") console.log("************* Telephony_observer_observer_on_cellularDataFlowChange_0200 Test start *************");
try { try {
observer.on('cellularDataFlowChange', { observer.on('cellularDataFlowChange', {
slotId: 0 slotId: 0
}, DataFlowType => { }, DataFlowType => {
console.log("on networkStateChange, DataFlowType:" + JSON.stringify(DataFlowType)); console.log("on networkStateChange, DataFlowType:" + JSON.stringify(DataFlowType));
expect(typeof DataFlowType === undefined).assertFalse() expect(typeof DataFlowType === undefined).assertFalse();
}); });
done() done();
} catch (error) { } catch (error) {
expect(false).assertTrue() expect(false).assertTrue();
done() done();
} }
console.log("************* Telephony_observer_observer_on_cellularDataFlowChange_0200 Test end *************") console.log("************* Telephony_observer_observer_on_cellularDataFlowChange_0200 Test end *************")
}) })
...@@ -293,7 +293,7 @@ export default function ObserverJsunit() { ...@@ -293,7 +293,7 @@ export default function ObserverJsunit() {
* @tc.desc : call the off method of cellularDataFlowChange * @tc.desc : call the off method of cellularDataFlowChange
*/ */
it('Telephony_observer_observer_off_cellularDataFlowChange_0100', 0, async function (done) { it('Telephony_observer_observer_off_cellularDataFlowChange_0100', 0, async function (done) {
console.log("************* Telephony_observer_observer_off_cellularDataFlowChange_0100 Test start *************") console.log("************* Telephony_observer_observer_off_cellularDataFlowChange_0100 Test start *************");
try { try {
let callback = data => { let callback = data => {
console.log("on cellularDataFlowChange, data:" + JSON.stringify(data)); console.log("on cellularDataFlowChange, data:" + JSON.stringify(data));
...@@ -302,10 +302,10 @@ export default function ObserverJsunit() { ...@@ -302,10 +302,10 @@ export default function ObserverJsunit() {
// 可以指定传入on中的callback取消一个订阅,也可以不指定callback清空所有订阅。 // 可以指定传入on中的callback取消一个订阅,也可以不指定callback清空所有订阅。
observer.off('cellularDataFlowChange', callback); observer.off('cellularDataFlowChange', callback);
observer.off('cellularDataFlowChange'); observer.off('cellularDataFlowChange');
done() done();
} catch (error) { } catch (error) {
expect(false).assertTrue() expect(false).assertTrue();
done() done();
} }
console.log("************* Telephony_observer_observer_off_cellularDataFlowChange_0100 Test end *************") console.log("************* Telephony_observer_observer_off_cellularDataFlowChange_0100 Test end *************")
}) })
...@@ -316,18 +316,18 @@ export default function ObserverJsunit() { ...@@ -316,18 +316,18 @@ export default function ObserverJsunit() {
* @tc.desc : call the on method of callStateChange * @tc.desc : call the on method of callStateChange
*/ */
it('Telephony_observer_observer_on_callStateChange_0100', 0, async function (done) { it('Telephony_observer_observer_on_callStateChange_0100', 0, async function (done) {
console.log("************* Telephony_observer_observer_on_callStateChange_0100 Test start *************") console.log("************* Telephony_observer_observer_on_callStateChange_0100 Test start *************");
try { try {
observer.on('callStateChange', value => { observer.on('callStateChange', value => {
console.log("on callStateChange, state:" + value.state + ", number:" + value.number); console.log("on callStateChange, state:" + value.state + ", number:" + value.number);
expect(typeof value.state === undefined).assertFalse() expect(typeof value.state === undefined).assertFalse();
}); });
done() done();
} catch (error) { } catch (error) {
expect(false).assertTrue() expect(false).assertTrue();
done() done();
} }
console.log("************* Telephony_observer_observer_on_callStateChange_0100 Test end *************") console.log("************* Telephony_observer_observer_on_callStateChange_0100 Test end *************");
}) })
/* /*
...@@ -336,20 +336,20 @@ export default function ObserverJsunit() { ...@@ -336,20 +336,20 @@ export default function ObserverJsunit() {
* @tc.desc : call the on method of callStateChange * @tc.desc : call the on method of callStateChange
*/ */
it('Telephony_observer_observer_on_callStateChange_0200', 0, async function (done) { it('Telephony_observer_observer_on_callStateChange_0200', 0, async function (done) {
console.log("************* Telephony_observer_observer_on_callStateChange_0200 Test start *************") console.log("************* Telephony_observer_observer_on_callStateChange_0200 Test start *************");
try { try {
observer.on('callStateChange', { observer.on('callStateChange', {
slotId: 0 slotId: 0
}, value => { }, value => {
console.log("on callStateChange, state:" + value.state + ", number:" + value.number); console.log("on callStateChange, state:" + value.state + ", number:" + value.number);
expect(typeof value.state === undefined).assertFalse() expect(typeof value.state === undefined).assertFalse();
}); });
done() done();
} catch (error) { } catch (error) {
expect(false).assertTrue() expect(false).assertTrue();
done() done();
} }
console.log("************* Telephony_observer_observer_on_callStateChange_0200 Test end *************") console.log("************* Telephony_observer_observer_on_callStateChange_0200 Test end *************");
}) })
/* /*
...@@ -358,7 +358,7 @@ export default function ObserverJsunit() { ...@@ -358,7 +358,7 @@ export default function ObserverJsunit() {
* @tc.desc : call the off method of callStateChange * @tc.desc : call the off method of callStateChange
*/ */
it('Telephony_observer_observer_off_callStateChange_0100', 0, async function (done) { it('Telephony_observer_observer_off_callStateChange_0100', 0, async function (done) {
console.log("************* Telephony_observer_observer_off_callStateChange_0100 Test start *************") console.log("************* Telephony_observer_observer_off_callStateChange_0100 Test start *************");
try { try {
let callback = value => { let callback = value => {
console.log("on callStateChange, state:" + value.state + ", number:" + value.number); console.log("on callStateChange, state:" + value.state + ", number:" + value.number);
...@@ -367,12 +367,12 @@ export default function ObserverJsunit() { ...@@ -367,12 +367,12 @@ export default function ObserverJsunit() {
// 可以指定传入on中的callback取消一个订阅,也可以不指定callback清空所有订阅。 // 可以指定传入on中的callback取消一个订阅,也可以不指定callback清空所有订阅。
observer.off('callStateChange', callback); observer.off('callStateChange', callback);
observer.off('callStateChange'); observer.off('callStateChange');
done() done();
} catch (error) { } catch (error) {
expect(false).assertTrue() expect(false).assertTrue();
done() done();
} }
console.log("************* Telephony_observer_observer_off_callStateChange_0100 Test end *************") console.log("************* Telephony_observer_observer_off_callStateChange_0100 Test end *************");
}) })
/* /*
...@@ -381,18 +381,18 @@ export default function ObserverJsunit() { ...@@ -381,18 +381,18 @@ export default function ObserverJsunit() {
* @tc.desc : call the on method of simStateChange * @tc.desc : call the on method of simStateChange
*/ */
it('Telephony_observer_observer_on_simStateChange_0100', 0, async function (done) { it('Telephony_observer_observer_on_simStateChange_0100', 0, async function (done) {
console.log("************* Telephony_observer_observer_on_simStateChange_0100 Test start *************") console.log("************* Telephony_observer_observer_on_simStateChange_0100 Test start *************");
try { try {
observer.on('simStateChange', SimStateData => { observer.on('simStateChange', SimStateData => {
console.log("on simStateChange, SimStateData:" + JSON.stringify(SimStateData)); console.log("on simStateChange, SimStateData:" + JSON.stringify(SimStateData));
expect(typeof SimStateData === undefined).assertFalse() expect(typeof SimStateData === undefined).assertFalse();
}); });
done() done();
} catch (error) { } catch (error) {
expect(false).assertTrue() expect(false).assertTrue();
done() done();
} }
console.log("************* Telephony_observer_observer_on_simStateChange_0100 Test end *************") console.log("************* Telephony_observer_observer_on_simStateChange_0100 Test end *************");
}) })
/* /*
...@@ -401,18 +401,18 @@ export default function ObserverJsunit() { ...@@ -401,18 +401,18 @@ export default function ObserverJsunit() {
* @tc.desc : call the on method of simStateChange * @tc.desc : call the on method of simStateChange
*/ */
it('Telephony_observer_observer_on_simStateChange_0200', 0, async function (done) { it('Telephony_observer_observer_on_simStateChange_0200', 0, async function (done) {
console.log("************* Telephony_observer_observer_on_simStateChange_0200 Test start *************") console.log("************* Telephony_observer_observer_on_simStateChange_0200 Test start *************");
try { try {
observer.on('simStateChange', { observer.on('simStateChange', {
slotId: 0 slotId: 0
}, SimStateData => { }, SimStateData => {
console.log("on simStateChange, SimStateData:" + JSON.stringify(SimStateData)); console.log("on simStateChange, SimStateData:" + JSON.stringify(SimStateData));
expect(typeof SimStateData === undefined).assertFalse() expect(typeof SimStateData === undefined).assertFalse();
}); });
done() done();
} catch (error) { } catch (error) {
expect(false).assertTrue() expect(false).assertTrue();
done() done();
} }
console.log("************* Telephony_observer_observer_on_simStateChange_0200 Test end *************") console.log("************* Telephony_observer_observer_on_simStateChange_0200 Test end *************")
}) })
...@@ -423,7 +423,7 @@ export default function ObserverJsunit() { ...@@ -423,7 +423,7 @@ export default function ObserverJsunit() {
* @tc.desc : call the off method of simStateChange * @tc.desc : call the off method of simStateChange
*/ */
it('Telephony_observer_observer_off_simStateChange_0100', 0, async function (done) { it('Telephony_observer_observer_off_simStateChange_0100', 0, async function (done) {
console.log("************* Telephony_observer_observer_off_simStateChange_0100 Test start *************") console.log("************* Telephony_observer_observer_off_simStateChange_0100 Test start *************");
try { try {
let callback = data => { let callback = data => {
console.log("on simStateChange, data:" + JSON.stringify(data)); console.log("on simStateChange, data:" + JSON.stringify(data));
...@@ -432,12 +432,12 @@ export default function ObserverJsunit() { ...@@ -432,12 +432,12 @@ export default function ObserverJsunit() {
// 可以指定传入on中的callback取消一个订阅,也可以不指定callback清空所有订阅。 // 可以指定传入on中的callback取消一个订阅,也可以不指定callback清空所有订阅。
observer.off('simStateChange', callback); observer.off('simStateChange', callback);
observer.off('simStateChange'); observer.off('simStateChange');
done() done();
} catch (error) { } catch (error) {
expect(false).assertTrue() expect(false).assertTrue();
done() done();
} }
console.log("************* Telephony_observer_observer_off_simStateChange_0100 Test end *************") console.log("************* Telephony_observer_observer_off_simStateChange_0100 Test end *************");
}) })
/* /*
...@@ -452,9 +452,9 @@ export default function ObserverJsunit() { ...@@ -452,9 +452,9 @@ export default function ObserverJsunit() {
return; return;
} }
console.log("************* Telephony_observer_LockReason_SIM_NONE_0100 Test start *************") console.log("************* Telephony_observer_LockReason_SIM_NONE_0100 Test start *************")
expect(0).assertEqual(observer.LockReason.SIM_NONE) expect(0).assertEqual(observer.LockReason.SIM_NONE);
done() done();
console.log("************* Telephony_observer_LockReason_SIM_NONE_0100 Test end *************") console.log("************* Telephony_observer_LockReason_SIM_NONE_0100 Test end *************");
}) })
/* /*
...@@ -468,10 +468,10 @@ export default function ObserverJsunit() { ...@@ -468,10 +468,10 @@ export default function ObserverJsunit() {
done(); done();
return; return;
} }
console.log("************* Telephony_observer_LockReason_SIM_PIN_0100 Test start *************") console.log("************* Telephony_observer_LockReason_SIM_PIN_0100 Test start *************");
expect(1).assertEqual(observer.LockReason.SIM_PIN) expect(1).assertEqual(observer.LockReason.SIM_PIN);
done() done();
console.log("************* Telephony_observer_LockReason_SIM_PIN_0100 Test end *************") console.log("************* Telephony_observer_LockReason_SIM_PIN_0100 Test end *************");
}) })
/* /*
...@@ -485,10 +485,10 @@ export default function ObserverJsunit() { ...@@ -485,10 +485,10 @@ export default function ObserverJsunit() {
done(); done();
return; return;
} }
console.log("************* Telephony_observer_LockReason_SIM_PUK_0100 Test start *************") console.log("************* Telephony_observer_LockReason_SIM_PUK_0100 Test start *************");
expect(2).assertEqual(observer.LockReason.SIM_PUK) expect(2).assertEqual(observer.LockReason.SIM_PUK);
done() done();
console.log("************* Telephony_observer_LockReason_SIM_PUK_0100 Test end *************") console.log("************* Telephony_observer_LockReason_SIM_PUK_0100 Test end *************");
}) })
/* /*
...@@ -502,10 +502,10 @@ export default function ObserverJsunit() { ...@@ -502,10 +502,10 @@ export default function ObserverJsunit() {
done(); done();
return; return;
} }
console.log("************* Telephony_observer_LockReason_SIM_PN_PIN_0100 Test start *************") console.log("************* Telephony_observer_LockReason_SIM_PN_PIN_0100 Test start *************");
expect(3).assertEqual(observer.LockReason.SIM_PN_PIN) expect(3).assertEqual(observer.LockReason.SIM_PN_PIN);
done() done();
console.log("************* Telephony_observer_LockReason_SIM_PN_PIN_0100 Test end *************") console.log("************* Telephony_observer_LockReason_SIM_PN_PIN_0100 Test end *************");
}) })
/* /*
* @tc.number : Telephony_observer_LockReason_SIM_PN_PUK_0100 * @tc.number : Telephony_observer_LockReason_SIM_PN_PUK_0100
...@@ -518,10 +518,10 @@ export default function ObserverJsunit() { ...@@ -518,10 +518,10 @@ export default function ObserverJsunit() {
done(); done();
return; return;
} }
console.log("************* Telephony_observer_LockReason_SIM_PN_PUK_0100 Test start *************") console.log("************* Telephony_observer_LockReason_SIM_PN_PUK_0100 Test start *************");
expect(4).assertEqual(observer.LockReason.SIM_PN_PUK) expect(4).assertEqual(observer.LockReason.SIM_PN_PUK);
done() done();
console.log("************* Telephony_observer_LockReason_SIM_PN_PUK_0100 Test end *************") console.log("************* Telephony_observer_LockReason_SIM_PN_PUK_0100 Test end *************");
}) })
/* /*
...@@ -535,10 +535,10 @@ export default function ObserverJsunit() { ...@@ -535,10 +535,10 @@ export default function ObserverJsunit() {
done(); done();
return; return;
} }
console.log("************* Telephony_observer_LockReason_SIM_PU_PIN_0100 Test start *************") console.log("************* Telephony_observer_LockReason_SIM_PU_PIN_0100 Test start *************");
expect(5).assertEqual(observer.LockReason.SIM_PU_PIN) expect(5).assertEqual(observer.LockReason.SIM_PU_PIN);
done() done();
console.log("************* Telephony_observer_LockReason_SIM_PU_PIN_0100 Test end *************") console.log("************* Telephony_observer_LockReason_SIM_PU_PIN_0100 Test end *************");
}) })
/* /*
...@@ -552,10 +552,10 @@ export default function ObserverJsunit() { ...@@ -552,10 +552,10 @@ export default function ObserverJsunit() {
done(); done();
return; return;
} }
console.log("************* Telephony_observer_LockReason_SIM_PU_PUK_0100 Test start *************") console.log("************* Telephony_observer_LockReason_SIM_PU_PUK_0100 Test start *************");
expect(6).assertEqual(observer.LockReason.SIM_PU_PUK) expect(6).assertEqual(observer.LockReason.SIM_PU_PUK);
done() done();
console.log("************* Telephony_observer_LockReason_SIM_PU_PUK_0100 Test end *************") console.log("************* Telephony_observer_LockReason_SIM_PU_PUK_0100 Test end *************");
}) })
/* /*
...@@ -569,10 +569,10 @@ export default function ObserverJsunit() { ...@@ -569,10 +569,10 @@ export default function ObserverJsunit() {
done(); done();
return; return;
} }
console.log("************* Telephony_observer_LockReason_SIM_PP_PIN_0100 Test start *************") console.log("************* Telephony_observer_LockReason_SIM_PP_PIN_0100 Test start *************");
expect(7).assertEqual(observer.LockReason.SIM_PP_PIN) expect(7).assertEqual(observer.LockReason.SIM_PP_PIN);
done() done();
console.log("************* Telephony_observer_LockReason_SIM_PP_PIN_0100 Test end *************") console.log("************* Telephony_observer_LockReason_SIM_PP_PIN_0100 Test end *************");
}) })
/* /*
...@@ -586,10 +586,10 @@ export default function ObserverJsunit() { ...@@ -586,10 +586,10 @@ export default function ObserverJsunit() {
done(); done();
return; return;
} }
console.log("************* Telephony_observer_LockReason_SIM_PP_PUK_0100 Test start *************") console.log("************* Telephony_observer_LockReason_SIM_PP_PUK_0100 Test start *************");
expect(8).assertEqual(observer.LockReason.SIM_PP_PUK) expect(8).assertEqual(observer.LockReason.SIM_PP_PUK);
done() done();
console.log("************* Telephony_observer_LockReason_SIM_PP_PUK_0100 Test end *************") console.log("************* Telephony_observer_LockReason_SIM_PP_PUK_0100 Test end *************");
}) })
/* /*
...@@ -603,10 +603,10 @@ export default function ObserverJsunit() { ...@@ -603,10 +603,10 @@ export default function ObserverJsunit() {
done(); done();
return; return;
} }
console.log("************* Telephony_observer_LockReason_SIM_PC_PIN_0100 Test start *************") console.log("************* Telephony_observer_LockReason_SIM_PC_PIN_0100 Test start *************");
expect(9).assertEqual(observer.LockReason.SIM_PC_PIN) expect(9).assertEqual(observer.LockReason.SIM_PC_PIN);
done() done();
console.log("************* Telephony_observer_LockReason_SIM_PC_PIN_0100 Test end *************") console.log("************* Telephony_observer_LockReason_SIM_PC_PIN_0100 Test end *************");
}) })
/* /*
...@@ -620,10 +620,10 @@ export default function ObserverJsunit() { ...@@ -620,10 +620,10 @@ export default function ObserverJsunit() {
done(); done();
return; return;
} }
console.log("************* Telephony_observer_LockReason_SIM_PC_PUK_0100 Test start *************") console.log("************* Telephony_observer_LockReason_SIM_PC_PUK_0100 Test start *************");
expect(10).assertEqual(observer.LockReason.SIM_PC_PUK) expect(10).assertEqual(observer.LockReason.SIM_PC_PUK);
done() done();
console.log("************* Telephony_observer_LockReason_SIM_PC_PUK_0100 Test end *************") console.log("************* Telephony_observer_LockReason_SIM_PC_PUK_0100 Test end *************");
}) })
/* /*
...@@ -637,10 +637,10 @@ export default function ObserverJsunit() { ...@@ -637,10 +637,10 @@ export default function ObserverJsunit() {
done(); done();
return; return;
} }
console.log("************* Telephony_observer_LockReason_SIM_SIM_PIN_0100 Test start *************") console.log("************* Telephony_observer_LockReason_SIM_SIM_PIN_0100 Test start *************");
expect(11).assertEqual(observer.LockReason.SIM_SIM_PIN) expect(11).assertEqual(observer.LockReason.SIM_SIM_PIN);
done() done();
console.log("************* Telephony_observer_LockReason_SIM_SIM_PIN_0100 Test end *************") console.log("************* Telephony_observer_LockReason_SIM_SIM_PIN_0100 Test end *************");
}) })
/* /*
...@@ -654,10 +654,10 @@ export default function ObserverJsunit() { ...@@ -654,10 +654,10 @@ export default function ObserverJsunit() {
done(); done();
return; return;
} }
console.log("************* Telephony_observer_LockReason_SIM_SIM_PUK_0100 Test start *************") console.log("************* Telephony_observer_LockReason_SIM_SIM_PUK_0100 Test start *************");
expect(12).assertEqual(observer.LockReason.SIM_SIM_PUK) expect(12).assertEqual(observer.LockReason.SIM_SIM_PUK);
done() done();
console.log("************* Telephony_observer_LockReason_SIM_SIM_PUK_0100 Test end *************") console.log("************* Telephony_observer_LockReason_SIM_SIM_PUK_0100 Test end *************");
}) })
/* /*
...@@ -666,22 +666,22 @@ export default function ObserverJsunit() { ...@@ -666,22 +666,22 @@ export default function ObserverJsunit() {
* @tc.desc : call the on method of simStateChange * @tc.desc : call the on method of simStateChange
*/ */
it('Telephony_Observer_SimStateData_Reason', 0, async function (done) { it('Telephony_Observer_SimStateData_Reason', 0, async function (done) {
console.log("************* Telephony_Observer_SimStateData_Reason Test start *************") console.log("************* Telephony_Observer_SimStateData_Reason Test start *************");
try { try {
observer.on('simStateChange', SimStateData => { observer.on('simStateChange', SimStateData => {
console.log("on simStateChange, SimStateData:" + JSON.stringify(SimStateData)); console.log("on simStateChange, SimStateData:" + JSON.stringify(SimStateData));
expect(typeof SimStateData.reason === undefined).assertFalse() expect(typeof SimStateData.reason === undefined).assertFalse();
expect(typeof SimStateData.state === undefined).assertFalse() expect(typeof SimStateData.state === undefined).assertFalse();
expect(typeof SimStateData.type === undefined).assertFalse() expect(typeof SimStateData.type === undefined).assertFalse();
}); });
done() done();
} catch (error) { } catch (error) {
expect(false).assertTrue() expect(false).assertTrue();
done() done();
} }
console.log("************* Telephony_Observer_SimStateData_Reason Test end *************") console.log("************* Telephony_Observer_SimStateData_Reason Test end *************");
}) })
console.log("************* Observer Test end *************") console.log("************* Observer Test end *************");
}) })
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册