提交 9926644e 编写于 作者: Z zhangmaowen

<zhangmaowen@huawei.com>

Signed-off-by: Nzhangmaowen <zhangmaowen@huawei.com>
上级 dcadeb1b
...@@ -350,29 +350,18 @@ describe('storageTest', function () { ...@@ -350,29 +350,18 @@ describe('storageTest', function () {
* @tc.number SUB_DDM_AppDataFWK_JSPreferences_Storage_0150 * @tc.number SUB_DDM_AppDataFWK_JSPreferences_Storage_0150
* @tc.desc flush promise interface test * @tc.desc flush promise interface test
*/ */
it('testFlush00181', 0, async function (done) { it('testFlush00181', 0, async function (done) {
mPref.putSync(KEY_TEST_STRING_ELEMENT, "test"); mPref.clearSync();
mPref.flushSync(); mPref.putSync(KEY_TEST_STRING_ELEMENT, "abc");
const promise = mPref.flush(); const promise = mPref.put(KEY_TEST_STRING_ELEMENT, 'test');
promise.then((ret) => { promise.then((ret) => {
expect("test").assertEqual(mPref.getSync(KEY_TEST_STRING_ELEMENT, "defaultvalue")); expect('test').assertEqual(mPref.getSync(KEY_TEST_STRING_ELEMENT, "defaultvalue"));
mPref.flush();
expect('test').assertEqual(mPref.getSync(KEY_TEST_STRING_ELEMENT, "defaultvalue"));
}).catch((err) => { }).catch((err) => {
expect(null).assertFail(); expect(null).assertFail();
}); });
await promise; await promise;
done(); done();
}) })
/**
* @tc.name const test
* @tc.number SUB_DDM_AppDataFWK_JSPreferences_Storage_0150
* @tc.desc const test
*/
it('testConst001', 0, function () {
mPref = storage.getStorageSync(PATH);
console.info("testConstKEY " +MAX_KEY_LENHTH)
console.info("testConstVALUE " +MAX_VALUE_LENHTH)
expect("80").assertEqual(mPref.MAX_KEY_LENHTH);
expect("8192").assertEqual(mPref.MAX_VALUE_LENHTH);
})
}) })
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册