提交 0855d618 编写于 作者: Z zhangmaowen

<zhangmaowen@huawei.com>

Signed-off-by: Nzhangmaowen <zhangmaowen@huawei.com>
上级 8d8eedab
......@@ -351,11 +351,13 @@ describe('storageTest', function () {
* @tc.desc flush promise interface test
*/
it('testFlush00181', 0, async function (done) {
mPref.putSync(KEY_TEST_STRING_ELEMENT, "test");
mPref.flushSync();
const promise = mPref.flush();
mPref.clearSync();
mPref.putSync(KEY_TEST_STRING_ELEMENT, "abc");
const promise = mPref.put(KEY_TEST_STRING_ELEMENT, 'test');
promise.then((ret) => {
expect("test").assertEqual(mPref.getSync(KEY_TEST_STRING_ELEMENT, "default"));
expect('test').assertEqual(mPref.getSync(KEY_TEST_STRING_ELEMENT, "defaultvalue"));
mPref.flush();
expect('test').assertEqual(mPref.getSync(KEY_TEST_STRING_ELEMENT, "defaultvalue"));
}).catch((err) => {
expect(null).assertFail();
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册