提交 971edb52 编写于 作者: H hui1975

miscdevice

Signed-off-by: Nhui1975 <zhaominghui10@huawei.com>
Change-Id: Ic9c8090d3708a177c4105ba44e837f2515c579ad
上级 1100a4bd
...@@ -67,7 +67,7 @@ describe("VibratorJsTest_misc_3", function () { ...@@ -67,7 +67,7 @@ describe("VibratorJsTest_misc_3", function () {
* @tc.number:SUB_SensorSystem_Vibrator_JsTest_0290 * @tc.number:SUB_SensorSystem_Vibrator_JsTest_0290
*/ */
it("VibratorJsTest015", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { it("VibratorJsTest015", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) {
vibrator.vibrate({ vibrator.startVibration({
type: "time", type: "time",
duration: 1000 duration: 1000
}, { }, {
...@@ -93,7 +93,7 @@ describe("VibratorJsTest_misc_3", function () { ...@@ -93,7 +93,7 @@ describe("VibratorJsTest_misc_3", function () {
*/ */
it("VibratorJsTest016", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { it("VibratorJsTest016", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
try { try {
vibrator.vibrate({ vibrator.startVibration({
type: "", type: "",
duration: 1000 duration: 1000
}, { }, {
...@@ -123,7 +123,7 @@ describe("VibratorJsTest_misc_3", function () { ...@@ -123,7 +123,7 @@ describe("VibratorJsTest_misc_3", function () {
*/ */
it("VibratorJsTest017", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { it("VibratorJsTest017", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
try { try {
vibrator.vibrate({ vibrator.startVibration({
type: "preset", type: "preset",
effectId: "", effectId: "",
count: 3, count: 3,
...@@ -155,7 +155,7 @@ describe("VibratorJsTest_misc_3", function () { ...@@ -155,7 +155,7 @@ describe("VibratorJsTest_misc_3", function () {
*/ */
it("VibratorJsTest018", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { it("VibratorJsTest018", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
try { try {
vibrator.vibrate(null, null); vibrator.startVibration(null, null);
} catch (error) { } catch (error) {
console.info(error); console.info(error);
expect(true).assertTrue(); expect(true).assertTrue();
...@@ -169,7 +169,7 @@ describe("VibratorJsTest_misc_3", function () { ...@@ -169,7 +169,7 @@ describe("VibratorJsTest_misc_3", function () {
* @tc.number:SUB_SensorSystem_Vibrator_JsTest_0350 * @tc.number:SUB_SensorSystem_Vibrator_JsTest_0350
*/ */
it("VibratorJsTest019", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { it("VibratorJsTest019", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
await vibrator.vibrate({ await vibrator.startVibration({
type: "time", type: "time",
duration: 1000, duration: 1000,
}, { }, {
...@@ -189,7 +189,7 @@ describe("VibratorJsTest_misc_3", function () { ...@@ -189,7 +189,7 @@ describe("VibratorJsTest_misc_3", function () {
*/ */
it("VibratorJsTest020", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { it("VibratorJsTest020", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
try { try {
await vibrator.vibrate({ await vibrator.startVibration({
type: "", type: "",
duration: 1000 duration: 1000
}, { }, {
...@@ -215,7 +215,7 @@ describe("VibratorJsTest_misc_3", function () { ...@@ -215,7 +215,7 @@ describe("VibratorJsTest_misc_3", function () {
*/ */
it("VibratorJsTest021", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { it("VibratorJsTest021", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
try { try {
vibrator.vibrate({ vibrator.startVibration({
type: "preset", type: "preset",
effectId: "", effectId: "",
count: 3, count: 3,
...@@ -243,7 +243,7 @@ describe("VibratorJsTest_misc_3", function () { ...@@ -243,7 +243,7 @@ describe("VibratorJsTest_misc_3", function () {
*/ */
it("VibratorJsTest022", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { it("VibratorJsTest022", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
try { try {
vibrator.vibrate({ vibrator.startVibration({
type: 1, type: 1,
count: 3, count: 3,
}, { }, {
...@@ -264,7 +264,7 @@ describe("VibratorJsTest_misc_3", function () { ...@@ -264,7 +264,7 @@ describe("VibratorJsTest_misc_3", function () {
it("VibratorJsTest023", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { it("VibratorJsTest023", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
function vibratePromise() { function vibratePromise() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
vibrator.vibrate({ vibrator.startVibration({
type: "time", type: "time",
duration: 100 duration: 100
}, { }, {
...@@ -283,7 +283,7 @@ describe("VibratorJsTest_misc_3", function () { ...@@ -283,7 +283,7 @@ describe("VibratorJsTest_misc_3", function () {
} }
let promise = new Promise((resolve, reject) => { let promise = new Promise((resolve, reject) => {
vibrator.vibrate({ vibrator.startVibration({
type: "time", type: "time",
duration: 100 duration: 100
}, { }, {
...@@ -313,7 +313,7 @@ describe("VibratorJsTest_misc_3", function () { ...@@ -313,7 +313,7 @@ describe("VibratorJsTest_misc_3", function () {
* @tc.number:SUB_SensorSystem_Vibrator_JsTest_0500 * @tc.number:SUB_SensorSystem_Vibrator_JsTest_0500
*/ */
it("VibratorJsTest024", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { it("VibratorJsTest024", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) {
vibrator.vibrate({ vibrator.startVibration({
type: "time", type: "time",
duration: 1000 duration: 1000
}, { }, {
...@@ -340,7 +340,7 @@ describe("VibratorJsTest_misc_3", function () { ...@@ -340,7 +340,7 @@ describe("VibratorJsTest_misc_3", function () {
*/ */
it("VibratorJsTest025", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { it("VibratorJsTest025", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
try { try {
vibrator.vibrate({ vibrator.startVibration({
type: "", type: "",
duration: 1000 duration: 1000
}, { }, {
...@@ -371,7 +371,7 @@ describe("VibratorJsTest_misc_3", function () { ...@@ -371,7 +371,7 @@ describe("VibratorJsTest_misc_3", function () {
*/ */
it("VibratorJsTest026", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { it("VibratorJsTest026", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
try { try {
vibrator.vibrate({ vibrator.startVibration({
type: "preset", type: "preset",
effectId: "", effectId: "",
count: 3, count: 3,
......
...@@ -187,21 +187,13 @@ describe("VibratorJsTest_misc_1", function () { ...@@ -187,21 +187,13 @@ describe("VibratorJsTest_misc_1", function () {
*/ */
it("SubVibratorJsTest0007", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { it("SubVibratorJsTest0007", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info('----------------------SubVibratorJsTest0007---------------------------'); console.info('----------------------SubVibratorJsTest0007---------------------------');
try { vibrator.vibrate({
vibrator.vibrate({ mode: 'short',
mode: 'short', success: function () {
success: function () { console.info("SubVibratorJsTest0007 success");
console.info("SubVibratorJsTest0007 success"); done();
expect(false).assertTrue(); },
done(); }, 25);
},
}, 25);
} catch (error) {
console.info('SubVibratorJsTest0007 error:' + error);
expect(error.code).assertEqual(PARAMETER_ERROR_CODE);
expect(error.message).assertEqual(PARAMETER_ERROR_MSG);
done();
}
}) })
/* /*
...@@ -243,14 +235,10 @@ describe("VibratorJsTest_misc_1", function () { ...@@ -243,14 +235,10 @@ describe("VibratorJsTest_misc_1", function () {
*/ */
it("SubVibratorJsTest0009", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { it("SubVibratorJsTest0009", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info('----------------------SubVibratorJsTest0009---------------------------'); console.info('----------------------SubVibratorJsTest0009---------------------------');
try { vibrator.vibrate();
vibrator.vibrate(); setTimeout(() => {
} catch (error) {
console.info('SubVibratorJsTest0009 error:' + error);
expect(error.code).assertEqual(PARAMETER_ERROR_CODE);
expect(error.message).assertEqual(PARAMETER_ERROR_MSG);
done(); done();
} }, 500);
}) })
/* /*
...@@ -260,23 +248,13 @@ describe("VibratorJsTest_misc_1", function () { ...@@ -260,23 +248,13 @@ describe("VibratorJsTest_misc_1", function () {
*/ */
it("SubVibratorJsTest0010", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { it("SubVibratorJsTest0010", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info('----------------------SubVibratorJsTest0010---------------------------'); console.info('----------------------SubVibratorJsTest0010---------------------------');
try { vibrator.vibrate({
vibrator.vibrate({ mode: 'short',
mode: 'short', success: function () {
success: function () { console.info("SubVibratorJsTest0010 success");
console.info("SubVibratorJsTest0010 success"); done();
expect(false).assertTrue(); },
done(); }, 25);
},
}, function () {
}, 25);
} catch (error) {
console.info('SubVibratorJsTest0010 error:' + error);
expect(error.code).assertEqual(PARAMETER_ERROR_CODE);
expect(error.message).assertEqual(PARAMETER_ERROR_MSG);
done();
}
}) })
}) })
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册