BRSetLocalName.test.js 17.4 KB
Newer Older
Q
quanli 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
/*
 * Copyright (C) 2022 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import bluetooth from '@ohos.bluetooth';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'
let Btname = {
    NUM_TEST :'012345678901234567890123456789012345678901234567890123'+
    '45678901234567890123456789012345678901234567890123456789012345678901234567',
    NUM_TEST1 :'0123456789012345678901234567890123456789012345678901'
    +'23456789012345678901234567890123456789012345678901234567890123456789012345678012'
    +'345678901234567890123456789012345678901234567890123456789012367890123456789012345568'
    +'01234567890123456789012345678912',
    LETTERS_TEST :'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
    CHINESES_TEST :'测试蓝牙名称是否正常测试蓝牙名称是否试蓝牙',
Q
quanli 已提交
27
    CHINESES_TEST2 :'测试蓝牙名称正常',
Q
quanli 已提交
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
    SYMBOL_TEST:'*^_^* 、。·ˉˇ¨〃々—~‖·‘’“”「『』〖❂【±×'
    +'÷∶∧∨∑∏∪∩∈∷√⊥‖∠⌒⊙∫∮≡≌≈∽∝≠♂♀°℃$¤¢£‰§№☆★○●◎◇□■△※→←↑↓〓',
    MIXES:'测试蓝牙名称是否正试蓝牙\'名称是否[666]aaw',
    MIXES2:'——◎◇◆□■△▲测试蓝牙',
    MIXES3:'78453-、、。。◎◇◆□■△▲',
    MIXES4:'hhhfdf-、、。。◎◇◆□■△▲',
    MIXES5:'#01-5@<?;:!@$%^&*(1[]{【+-;:‘’“”测试=》《\'[6]',
    MIXES6:'#01-567890@<>?/;:5675ASDF012345678!@'
    +'$%^&*()9012378901[]{}【】566~·67890blue',
    MIXES7:'0123456789012345678901234567890123456789012345678901'
    +'23456789012345678901234567890123456789012345678901234567890123456789012345678012'
    +'345678901234567890123456789012345678901234567890123456789012367890123456789012345568'
    +'012345678901234567890123456789123'
}
export default function bluetoothhostTest1() {
describe('bluetoothhostTest1', function() {
    function sleep(delay) {
        return new Promise(resovle => setTimeout(resovle, delay))
    }
    async function tryToEnableBt() {
        let sta = bluetooth.getState();
        switch(sta){
            case 0:
                bluetooth.enableBluetooth();
                await sleep(5000);
                let sta1 = bluetooth.getState();
                console.info('[bluetooth_js] bt turn off:'+ JSON.stringify(sta1));
                break;
            case 1:
                console.info('[bluetooth_js] bt turning on:'+ JSON.stringify(sta));
                await sleep(3000);
                break;
            case 2:
                console.info('[bluetooth_js] bt turn on:'+ JSON.stringify(sta));
                break;
            case 3:
                bluetooth.enableBluetooth();
                await sleep(3000);
                let sta2 = bluetooth.getState();
                console.info('[bluetooth_js] bt turning off:'+ JSON.stringify(sta2));
                break;
            default:
                console.info('[bluetooth_js] enable success');
        }
    }
    beforeAll(function () {
        console.info('beforeAll called')
    })
    beforeEach(async function(done) {
        console.info('beforeEach called')
        await tryToEnableBt()
        done()
    })
    afterEach(function () {
        console.info('afterEach called')
    })
    afterAll(function () {
        console.info('afterAll called')
    })

    /**
     * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0100
     * @tc.name setLocalName
     * @tc.desc Test setLocalName api by promise.
     * @tc.size MEDIUM
     * @ since 8
     * @tc.type Function
Q
quanli 已提交
95
     * @tc.level Level 1 
Q
quanli 已提交
96 97
     */
    it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0100', 0, async function (done) {
Q
quanli 已提交
98
        let result = bluetooth.setLocalName(Btname.LETTERS_TEST);
Q
quanli 已提交
99
        expect(result).assertTrue();
Q
quanli 已提交
100
        await sleep(1000);
Q
quanli 已提交
101 102
        let getNewName = bluetooth.getLocalName();
        console.info('[bluetooth_js] LocalName_0100 NewName = '+ JSON.stringify(getNewName));
Q
quanli 已提交
103
        expect(true).assertEqual(Btname.LETTERS_TEST == getNewName);
Q
quanli 已提交
104 105 106 107 108 109 110 111 112 113
        done();
    })

    /**
     * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0200
     * @tc.name setLocalName
     * @tc.desc Test setLocalName api by promise.
     * @tc.size MEDIUM
     * @ since 8
     * @tc.type Function
Q
quanli 已提交
114
     * @tc.level Level 3
Q
quanli 已提交
115 116
     */
    it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0200', 0, async function (done) {
Q
quanli 已提交
117
        let result = bluetooth.setLocalName(Btname.CHINESES_TEST2);
Q
quanli 已提交
118
        expect(result).assertTrue();
Q
quanli 已提交
119
        await sleep(1000);
Q
quanli 已提交
120 121
        let getNewName = bluetooth.getLocalName();
        console.info('[bluetooth_js] LocalName_0200 NewName = '+ JSON.stringify(getNewName));
Q
quanli 已提交
122
        expect(true).assertEqual(Btname.CHINESES_TEST2 == getNewName);
Q
quanli 已提交
123 124 125 126 127 128 129 130 131 132
        done();
    })

    /**
     * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0300
     * @tc.name setLocalName
     * @tc.desc Test setLocalName api by promise.
     * @tc.size MEDIUM
     * @ since 8
     * @tc.type Function
Q
quanli 已提交
133
     * @tc.level Level 2
Q
quanli 已提交
134 135
     */
    it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0300', 0, async function (done) {
Q
quanli 已提交
136
        let result = bluetooth.setLocalName(Btname.NUM_TEST);
Q
quanli 已提交
137
        expect(result).assertTrue();
Q
quanli 已提交
138
        await sleep(1000);
Q
quanli 已提交
139 140
        let getNewName = bluetooth.getLocalName();
        console.info('[bluetooth_js] LocalName_0300 NewName = '+ JSON.stringify(getNewName));
Q
quanli 已提交
141
        expect(true).assertEqual(Btname.NUM_TEST == getNewName);
Q
quanli 已提交
142 143 144
        done();
    })

Q
quanli 已提交
145
   /**
Q
quanli 已提交
146 147 148 149 150 151
     * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0400
     * @tc.name setLocalName
     * @tc.desc Test setLocalName api by promise.
     * @tc.size MEDIUM
     * @ since 8
     * @tc.type Function
Q
quanli 已提交
152
     * @tc.level Level 1
Q
quanli 已提交
153 154
     */
    it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0400', 0, async function (done) {
Q
quanli 已提交
155
        let result = bluetooth.setLocalName(Btname.SYMBOL_TEST);
Q
quanli 已提交
156
        expect(result).assertTrue();
Q
quanli 已提交
157
        await sleep(1000);
Q
quanli 已提交
158 159
        let getNewName = bluetooth.getLocalName();
        console.info('[bluetooth_js] LocalName_0400 NewName = '+ JSON.stringify(getNewName));
Q
quanli 已提交
160
        expect(true).assertEqual(Btname.SYMBOL_TEST == getNewName);
Q
quanli 已提交
161 162 163
        done();
    })

Q
quanli 已提交
164
    /**
Q
quanli 已提交
165 166 167 168 169 170
     * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0500
     * @tc.name setLocalName
     * @tc.desc Test setLocalName api by promise.
     * @tc.size MEDIUM
     * @ since 8
     * @tc.type Function
Q
quanli 已提交
171
     * @tc.level Level 2
Q
quanli 已提交
172 173
     */
    it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0500', 0, async function (done) {
Q
quanli 已提交
174 175
        let newName = 'my bluetooth';
        let result = bluetooth.setLocalName(newName);
Q
quanli 已提交
176
        expect(result).assertTrue();
Q
quanli 已提交
177
        await sleep(1000);
Q
quanli 已提交
178 179
        let getNewName = bluetooth.getLocalName();
        console.info('[bluetooth_js] LocalName_0500 NewName = '+ JSON.stringify(getNewName));
Q
quanli 已提交
180
        expect(true).assertEqual(newName == getNewName);
Q
quanli 已提交
181 182 183 184 185 186 187 188 189 190
        done();
    })

    /**
     * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0600
     * @tc.name setLocalName
     * @tc.desc Test setLocalName api by promise.
     * @tc.size MEDIUM
     * @ since 8
     * @tc.type Function
Q
quanli 已提交
191
     * @tc.level Level 3
Q
quanli 已提交
192 193
     */
    it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0600', 0, async function (done) {
Q
quanli 已提交
194
        let newName = 'bluetooth1234ABCDEFGH';
Q
quanli 已提交
195 196
        let result = bluetooth.setLocalName(newName);
        expect(result).assertTrue();
Q
quanli 已提交
197
        await sleep(1000);
Q
quanli 已提交
198 199 200 201 202 203 204 205
        let getNewName = bluetooth.getLocalName();
        console.info('[bluetooth_js] LocalName_0600 NewName = '+ JSON.stringify(getNewName));
        expect(true).assertEqual(newName == getNewName);
        done();
    })

    /**
     * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0700
Q
quanli 已提交
206 207
     * @tc.name TEST setLocalName
     * @tc.desc TEST setLocalName api by promise.
Q
quanli 已提交
208 209 210 211 212 213
     * @tc.size MEDIUM
     * @ since 8
     * @tc.type Function
     * @tc.level Level 3
     */
    it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0700', 0, async function (done) {
Q
quanli 已提交
214
        let newName = '蓝牙设备bluetooth';
Q
quanli 已提交
215 216
        let result = bluetooth.setLocalName(newName);
        expect(result).assertTrue();
Q
quanli 已提交
217
        await sleep(1000);
Q
quanli 已提交
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232
        let getNewName = bluetooth.getLocalName();
        console.info('[bluetooth_js] LocalName_0700 NewName = '+ JSON.stringify(getNewName));
        expect(true).assertEqual(newName == getNewName);
        done();
    })

    /**
     * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0800
     * @tc.name TEST setLocalName
     * @tc.desc TEST setLocalName api by promise.
     * @tc.size MEDIUM
     * @ since 8
     * @tc.type Function
     * @tc.level Level 3
     */
Q
quanli 已提交
233 234
     it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0800', 0, async function (done) {
        let result = bluetooth.setLocalName(Btname.MIXES4);
Q
quanli 已提交
235
        expect(result).assertTrue();
Q
quanli 已提交
236
        await sleep(1000);
Q
quanli 已提交
237 238
        let getNewName = bluetooth.getLocalName();
        console.info('[bluetooth_js] LocalName_0800 NewName = '+ JSON.stringify(getNewName));
Q
quanli 已提交
239
        expect(true).assertEqual(Btname.MIXES4 == getNewName);
Q
quanli 已提交
240 241 242 243 244 245 246 247 248 249 250 251
        done();
    })

    /**
     * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0900
     * @tc.name TEST setLocalName
     * @tc.desc TEST setLocalName api by promise.
     * @tc.size MEDIUM
     * @ since 8
     * @tc.type Function
     * @tc.level Level 3
     */
Q
quanli 已提交
252 253
    it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_0900', 0, async function (done) {
        let result = bluetooth.setLocalName(Btname.MIXES2);
Q
quanli 已提交
254
        expect(result).assertTrue();
Q
quanli 已提交
255
        await sleep(1000);
Q
quanli 已提交
256 257
        let getNewName = bluetooth.getLocalName();
        console.info('[bluetooth_js] LocalName_0900 NewName = '+ JSON.stringify(getNewName));
Q
quanli 已提交
258
        expect(true).assertEqual(Btname.MIXES2 == getNewName);
Q
quanli 已提交
259 260 261 262 263 264 265 266 267 268 269 270 271
        done();
    })

    /**
     * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1000
     * @tc.name TEST setLocalName
     * @tc.desc TEST setLocalName api by promise.
     * @tc.size MEDIUM
     * @ since 8
     * @tc.type Function
     * @tc.level Level 3
     */
    it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1000', 0, async function (done) {
Q
quanli 已提交
272
        let result = bluetooth.setLocalName(Btname.MIXES3);
Q
quanli 已提交
273
        expect(result).assertTrue();
Q
quanli 已提交
274
        await sleep(1000);
Q
quanli 已提交
275 276
        let getNewName = bluetooth.getLocalName();
        console.info('[bluetooth_js] LocalName_1000 NewName = '+ JSON.stringify(getNewName));
Q
quanli 已提交
277
        expect(true).assertEqual(Btname.MIXES3 == getNewName);
Q
quanli 已提交
278 279 280 281 282 283 284 285 286 287
        done();
    })

    /**
     * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1100
     * @tc.name TEST setLocalName
     * @tc.desc TEST setLocalName api by promise.
     * @tc.size MEDIUM
     * @ since 8
     * @tc.type Function
Q
quanli 已提交
288
     * @tc.level Level 2
Q
quanli 已提交
289 290
     */
    it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1100', 0, async function (done) {
Q
quanli 已提交
291 292
        let newName = '蓝牙设备123';
        let result = bluetooth.setLocalName(newName);
Q
quanli 已提交
293
        expect(result).assertTrue();
Q
quanli 已提交
294
        await sleep(1000);
Q
quanli 已提交
295 296
        let getNewName = bluetooth.getLocalName();
        console.info('[bluetooth_js] LocalName_1100 NewName = '+ JSON.stringify(getNewName));
Q
quanli 已提交
297
        expect(true).assertEqual(newName == getNewName);
Q
quanli 已提交
298 299 300 301 302 303 304 305 306 307
        done();
    })

    /**
     * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1200
     * @tc.name TEST setLocalName
     * @tc.desc TEST setLocalName api by promise.
     * @tc.size MEDIUM
     * @ since 8
     * @tc.type Function
Q
quanli 已提交
308
     * @tc.level Level 3
Q
quanli 已提交
309 310
     */
    it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1200', 0, async function (done) {
Q
quanli 已提交
311
        let newName = '蓝牙设备bluetooth12';
Q
quanli 已提交
312 313
        let result = bluetooth.setLocalName(newName);
        expect(result).assertTrue();
Q
quanli 已提交
314
        await sleep(1000);
Q
quanli 已提交
315
        let getNewName = bluetooth.getLocalName();
Q
quanli 已提交
316
        console.info('[bluetooth_js] LocalName1200 NewName = '+ JSON.stringify(getNewName));
Q
quanli 已提交
317 318 319 320 321 322 323 324 325 326 327 328 329
        expect(true).assertEqual(newName == getNewName);
        done();
    })

    /**
     * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1300
     * @tc.name TEST setLocalName
     * @tc.desc TEST setLocalName api by promise.
     * @tc.size MEDIUM
     * @ since 8
     * @tc.type Function
     * @tc.level Level 3
     */
Q
quanli 已提交
330 331
      it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1300', 0, async function (done) {
        let result = bluetooth.setLocalName(Btname.MIXES6);
Q
quanli 已提交
332
        expect(result).assertTrue();
Q
quanli 已提交
333
        await sleep(1000);
Q
quanli 已提交
334 335
        let getNewName = bluetooth.getLocalName();
        console.info('[bluetooth_js] LocalName_1300 NewName = '+ JSON.stringify(getNewName));
Q
quanli 已提交
336
        expect(true).assertEqual(Btname.MIXES6 == getNewName);
Q
quanli 已提交
337 338 339 340 341 342 343 344 345 346 347 348
        done();
    })

    /**
     * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1400
     * @tc.name TEST setLocalName
     * @tc.desc TEST setLocalName api by promise.
     * @tc.size MEDIUM
     * @ since 8
     * @tc.type Function
     * @tc.level Level 3
     */
Q
quanli 已提交
349 350
    it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1400', 0, async function (done) {
        let result = bluetooth.setLocalName(Btname.MIXES);
Q
quanli 已提交
351
        expect(result).assertTrue();
Q
quanli 已提交
352
        await sleep(1000);
Q
quanli 已提交
353 354
        let getNewName = bluetooth.getLocalName();
        console.info('[bluetooth_js] LocalName_1400 NewName = '+ JSON.stringify(getNewName));
Q
quanli 已提交
355 356
        expect(true).assertEqual(Btname.MIXES == getNewName);
        
Q
quanli 已提交
357 358 359 360 361 362 363 364 365 366 367 368 369
        done();
    })

    /**
     * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1500
     * @tc.name TEST setLocalName
     * @tc.desc TEST setLocalName api by promise.
     * @tc.size MEDIUM
     * @ since 8
     * @tc.type Function
     * @tc.level Level 3
     */
    it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1500', 0, async function (done) {
Q
quanli 已提交
370
        let result = bluetooth.setLocalName(Btname.MIXES5);
Q
quanli 已提交
371
        expect(result).assertTrue();
Q
quanli 已提交
372
        await sleep(1000);
Q
quanli 已提交
373 374
        let getNewName = bluetooth.getLocalName();
        console.info('[bluetooth_js] LocalName_1500 NewName = '+ JSON.stringify(getNewName));
Q
quanli 已提交
375
        expect(true).assertEqual(Btname.MIXES5 == getNewName);
Q
quanli 已提交
376 377 378 379 380 381 382 383 384 385 386 387 388
        done();
    })

    /**
     * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1600
     * @tc.name TEST setLocalName
     * @tc.desc TEST setLocalName api by promise.
     * @tc.size MEDIUM
     * @ since 8
     * @tc.type Function
     * @tc.level Level 3
     */
    it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1600', 0, async function (done) {
Q
quanli 已提交
389
        let result = bluetooth.setLocalName(Btname.NUM_TEST1);
Q
quanli 已提交
390
        expect(result).assertTrue();
Q
quanli 已提交
391
        await sleep(1000);
Q
quanli 已提交
392 393
        let getNewName = bluetooth.getLocalName();
        console.info('[bluetooth_js] LocalName_1600 NewName = '+ JSON.stringify(getNewName));
Q
quanli 已提交
394
        expect(true).assertEqual(Btname.NUM_TEST1 == getNewName);
Q
quanli 已提交
395 396 397 398 399 400 401 402 403 404 405 406 407
        done();
    })

    /**
     * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1700
     * @tc.name TEST setLocalName
     * @tc.desc TEST setLocalName api by promise.
     * @tc.size MEDIUM
     * @ since 8
     * @tc.type Function
     * @tc.level Level 3
     */
    it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1700', 0, async function (done) {
Q
quanli 已提交
408
        let result = bluetooth.setLocalName(Btname.MIXES7);
Q
quanli 已提交
409
        expect(result).assertTrue();
Q
quanli 已提交
410
        await sleep(1000);
Q
quanli 已提交
411 412
        let getNewName = bluetooth.getLocalName();
        console.info('[bluetooth_js] LocalName_1700 NewName = '+ JSON.stringify(getNewName));
Q
quanli 已提交
413
        expect(false).assertEqual(Btname.MIXES7 == getNewName);
Q
quanli 已提交
414 415 416 417 418 419 420 421 422 423 424 425 426
        done();
    })

    /**
     * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1800
     * @tc.name TEST setLocalName
     * @tc.desc TEST setLocalName api by promise.
     * @tc.size MEDIUM
     * @ since 8
     * @tc.type Function
     * @tc.level Level 3
     */
    it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1800', 0, async function (done) {
Q
quanli 已提交
427 428 429
        let name = bluetooth.getLocalName();
        let set = bluetooth.setLocalName('');
        expect(set).assertFalse();
Q
quanli 已提交
430
        await sleep(1000);
Q
quanli 已提交
431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451
        let localName = bluetooth.getLocalName();
        expect(true).assertTrue(localName==name);
        console.info('[bluetooth_js] getLocalName1800=' + JSON.stringify(localName));
        done();
    })

    /**
     * @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1900
     * @tc.name set LocalName
     * @tc.desc Test setLocalName api by promise.
     * @tc.size MEDIUM
     * @ since 8
     * @tc.type Function
     * @tc.level Level 3
     */
    it('SUB_COMMUNICATION_BLUETOOTH_BR_LocalName_1900', 0, async function (done) {
        let localName = bluetooth.getLocalName();
        console.info('[bluetooth_js] LocalName_1900 localName = '+ JSON.stringify(localName));
        expect(true).assertEqual(localName!=null);
        let newName = 'bluetoothtest';
        let result = bluetooth.setLocalName(newName);
Q
quanli 已提交
452
        expect(result).assertTrue();
Q
quanli 已提交
453
        await sleep(1000);
Q
quanli 已提交
454
        let getNewName = bluetooth.getLocalName();
Q
quanli 已提交
455 456 457 458
        console.info('[bluetooth_js] LocalName_1900 NewName = '+ JSON.stringify(getNewName));
        expect(true).assertEqual(newName == getNewName);
        let result1=bluetooth.setLocalName(localName);
        expect(result1).assertTrue();
Q
quanli 已提交
459
        await sleep(1000);
Q
quanli 已提交
460 461 462
        let getLocalName = bluetooth.getLocalName();
        console.info('[bluetooth_js] LocalNam1900 localName ='+ JSON.stringify(getLocalName));
        expect(true).assertEqual(localName == getLocalName);
Q
quanli 已提交
463 464 465 466 467 468
        done();
    })

})
}

Q
quanli 已提交
469

Q
quanli 已提交
470