提交 a88207c6 编写于 作者: L liangzhenyu123

liangzhenyu6@huawei.com

Signed-off-by: Nliangzhenyu123 <liangzhenyu6@huawei.com>
上级 50c2ee9d
......@@ -172,6 +172,8 @@ export default function pasteBoardTest(){
expect(uri).assertEqual(data.getRecordAt(0).uri)
expect('text/uri').assertEqual(data.getRecordAt(0).mimeType)
console.info(data.getRecordAt(0).mimeType)
console.info(data.getProperty().mimeTypes[0]);
expect("text/uri").assertEqual(data.getProperty().mimeTypes[0]);
})
})
})
......
......@@ -487,5 +487,19 @@ describe('preferencesCallBackTest', function () {
})
done();
})
/**
* @tc.name get defaultValue callback interface test
* @tc.number SUB_DDM_Preferences_Get_CallBack_0250
* @tc.desc get defaultValue callback interface test
*/
it('testPreferencesGetDefValue0173', 0, async function (done) {
await mPreferences.clear();
await mPreferences.get(KEY_TEST_BOOLEAN_ELEMENT, true, function (err, ret) {
expect(true).assertEqual(ret);
done();
})
})
})
}
\ No newline at end of file
......@@ -450,5 +450,22 @@ describe('preferencesPromiseTest', function () {
await promise;
done();
})
/**
* @tc.name get string promise interface test
* @tc.number SUB_DDM_Preferences_Get_Promise_0210
* @tc.desc get string promise interface test
*/
it('testPreferencesGetDefValue00162', 0, async function (done) {
await mPreferences.clear();
const promise = mPreferences.get(KEY_TEST_BOOLEAN_ELEMENT, true);
promise.then((ret) => {
expect(true).assertEqual(ret);
}).catch((err) => {
expect(null).assertFail();
});
await promise;
done();
})
})
}
\ No newline at end of file
......@@ -333,5 +333,18 @@ describe('storageCallBackTest', function () {
});
done();
})
/**
* @tc.name get defaultValue callback interface test
* @tc.number SUB_DDM_AppDataFWK_JSPreferences_CallBack_0190
* @tc.desc get defaultValue callback interface test
*/
it('testGetDefValue0192', 0, async function (done) {
await mPref.clear();
await mPref.get(KEY_TEST_BOOLEAN_ELEMENT, true, function (err, ret) {
expect(true).assertEqual(ret);
done();
})
})
})
}
......@@ -491,5 +491,22 @@ describe('storagePromiseTest', function () {
expect(MAX_VALUE_LENGTH).assertEqual(mPref.getSync("test", "defaultvalue"));
done();
})
/**
* @tc.name get string promise interface test
* @tc.number SUB_DDM_AppDataFWK_JSPreferences_Storage_0260
* @tc.desc get string promise interface test
*/
it('testGetDefValue0260', 0, async function (done) {
await mPref.clear();
const promise = mPref.get(KEY_TEST_BOOLEAN_ELEMENT, true);
promise.then((ret) => {
expect(true).assertEqual(ret);
}).catch((err) => {
expect(null).assertFail();
});
await promise;
done();
})
})
}
......@@ -287,4 +287,16 @@ describe('storageSyncTest', function () {
mPref.off('change', observer);
mPref.putSync(KEY_TEST_STRING_ELEMENT, "abc");
})
/**
* @tc.name get defaultValue callback interface test
* @tc.number SUB_DDM_AppDataFWK_JSPreferences_Sync_0170
* @tc.desc get defaultValue callback interface test
*/
it('testGetDefValue001', 0, async function (done) {
await mPref.clear();
var ret = mPref.getSync(KEY_TEST_BOOLEAN_ELEMENT, true)
expect(ret).assertTrue();
done();
})
})}
......@@ -20,7 +20,7 @@ const TAG = "[RDB_JSKITS_TEST]"
const CREATE_TABLE_TEST = "CREATE TABLE IF NOT EXISTS test (" + "id INTEGER PRIMARY KEY, " + "name TEXT NOT NULL, " + "age INTEGER, " + "salary REAL, " + "blobType BLOB)";
const STORE_CONFIG = {
name: "RdbInsertTest.db",
name: "rdbstoreTransactionTest.db",
}
var rdbStore = undefined;
......@@ -41,7 +41,7 @@ describe('rdbstoreTransactionTest', function () {
console.info(TAG + 'afterEach')
await rdbStore.executeSql("DELETE FROM test");
rdbStore = null
await dataRdb.deleteRdbStore("Delete.db");
await dataRdb.deleteRdbStore("rdbstoreTransactionTest.db");
})
afterAll(async function () {
......
......@@ -38,7 +38,7 @@ describe('rdbStoreUpdateTest', function () {
console.info(TAG + 'afterEach')
await rdbStore.executeSql("DELETE FROM test");
rdbStore = null
await dataRdb.deleteRdbStore("Delete.db");
await dataRdb.deleteRdbStore("UpdataTest.db");
})
afterAll(async function () {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册