提交 0f7b47fa 编写于 作者: L lxq

<liuxueqi3@huawei.com>

Signed-off-by: Nlxq <liuxueqi3@huawei.com>
上级 1b448192
......@@ -12,7 +12,6 @@
"type": "ShellKit",
"run-command": [
"mkdir /data/accounts/account_0/appdata/image",
"chmod -R 666 /data/media/*",
"chmod -R 666 /data/accounts/account_0/appdata/image/*"
],
"teardown-command":[
......
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
import mediaLibrary from '@ohos.multimedia.medialibrary';
import mediaLibrary from '@ohos.multimedia.mediaLibrary';
import image from '@ohos.multimedia.image';
import featureAbility from '@ohos.ability.featureAbility';
......@@ -29,19 +29,19 @@ describe('FileAssetGetThumbnailPromise.test.js', function () {
let videoType = mediaLibrary.MediaType.VIDEO;
let audioType = mediaLibrary.MediaType.AUDIO;
let imageFetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '=?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '=?',
selectionArgs: [imagetype.toString()],
order: fileKeyObj.DATE_ADDED,
order: mediaLibrary.FileKey.DATE_ADDED,
};
let videoFetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '=?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '=?',
selectionArgs: [videoType.toString()],
order: fileKeyObj.DATE_ADDED,
order: mediaLibrary.FileKey.DATE_ADDED,
};
let audioFetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '=?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '=?',
selectionArgs: [audioType.toString()],
order: fileKeyObj.DATE_ADDED,
order: mediaLibrary.FileKey.DATE_ADDED,
};
beforeAll(function () {});
beforeEach(function () {});
......
......@@ -29,19 +29,19 @@ describe('FileAssetGetThumbnailPromise.test.js', function () {
let videoType = mediaLibrary.MediaType.VIDEO;
let audioType = mediaLibrary.MediaType.AUDIO;
let imageFetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '=?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '=?',
selectionArgs: [imagetype.toString()],
order: fileKeyObj.DATE_ADDED,
order: mediaLibrary.FileKey.DATE_ADDED,
};
let videoFetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '=?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '=?',
selectionArgs: [videoType.toString()],
order: fileKeyObj.DATE_ADDED,
order: mediaLibrary.FileKey.DATE_ADDED,
};
let audioFetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '=?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '=?',
selectionArgs: [audioType.toString()],
order: fileKeyObj.DATE_ADDED,
order: mediaLibrary.FileKey.DATE_ADDED,
};
beforeAll(function () {});
beforeEach(function () {});
......
......@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import mediaLibrary from '@ohos.multimedia.medialibrary';
import mediaLibrary from '@ohos.multimedia.mediaLibrary';
import featureAbility from '@ohos.ability.featureAbility';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index';
......@@ -77,7 +77,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_02', 0, async function(done) {
try {
let imageAlbumfetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ imageType.toString() ],
order : 'date_added DESC LIMIT 0,3',
};
......@@ -110,7 +110,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_03', 0, async function(done) {
try {
let audioAlbumfetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ audioType.toString() ],
order : 'date_added DESC LIMIT 0,3',
};
......@@ -142,7 +142,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_04', 0, async function(done) {
try {
let videoAlbumfetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ videoType.toString() ],
order : 'date_added DESC LIMIT 0,3',
};
......@@ -174,7 +174,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_05', 0, async function(done) {
try {
let imageAndVideoAlbumfetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ? or ' + fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ? or ' + mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ imageType.toString(), videoType.toString() ],
order : 'date_added DESC LIMIT 0,3',
};
......@@ -206,7 +206,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_06', 0, async function(done) {
try {
let imageAndAudioAlbumfetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ? or ' + fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ? or ' + mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ imageType.toString(), audioType.toString() ],
order : 'date_added DESC LIMIT 0,3',
};
......@@ -238,7 +238,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_07', 0, async function(done) {
try {
let videoAndAudioAlbumfetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ? or ' + fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ? or ' + mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ videoType.toString(), audioType.toString() ],
order : 'date_added DESC LIMIT 0,3',
};
......@@ -270,8 +270,8 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_08', 0, async function(done) {
try {
let imgAndVideoAndAudioAlbumfetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ? or ' + fileKeyObj.MEDIA_TYPE + '= ? or '
+ fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ? or ' + mediaLibrary.FileKey.MEDIA_TYPE + '= ? or '
+ mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ imageType.toString(), videoType.toString(), audioType.toString() ],
order : 'date_added DESC LIMIT 0,3',
};
......@@ -303,7 +303,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_09', 0, async function(done) {
try {
let albumfetchOpOne = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ imageType.toString() ],
order : 'date_added DESC LIMIT 0,1',
};
......@@ -335,7 +335,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_10', 0, async function(done) {
try {
let albumfetchOpOne = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ audioType.toString() ],
order : 'date_added DESC LIMIT 0,1',
};
......@@ -367,7 +367,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_11', 0, async function(done) {
try {
let albumfetchOpOne = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ videoType.toString() ],
order : 'date_added DESC LIMIT 0,1',
};
......@@ -399,7 +399,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_12', 0, async function(done) {
try {
let albumfetchOpNone = {
selections : fileKeyObj.MEDIA_TYPE + '= ? AND date_added < 0',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ? AND date_added < 0',
selectionArgs : [ imageType.toString() ],
order : 'date_added DESC LIMIT 0,1',
};
......@@ -436,7 +436,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_13', 0, async function(done) {
try {
let albumfetchOpNone = {
selections : fileKeyObj.MEDIA_TYPE + '= ? AND date_added < 0',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ? AND date_added < 0',
selectionArgs : [ audioType.toString() ],
order : 'date_added DESC LIMIT 0,1',
};
......@@ -473,7 +473,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_14', 0, async function(done) {
try {
let albumfetchOpNone = {
selections : fileKeyObj.MEDIA_TYPE + '= ? AND date_added < 0',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ? AND date_added < 0',
selectionArgs : [ videoType.toString() ],
order : 'date_added DESC LIMIT 0,1',
};
......
......@@ -70,7 +70,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_02', 0, async function(done) {
try {
let imageAlbumfetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ imageType.toString() ],
order : 'date_added DESC LIMIT 0,3',
};
......@@ -96,7 +96,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_03', 0, async function(done) {
try {
let audioAlbumfetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ audioType.toString() ],
order : 'date_added DESC LIMIT 0,3',
};
......@@ -122,7 +122,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_04', 0, async function(done) {
try {
let videoAlbumfetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ videoType.toString() ],
order : 'date_added DESC LIMIT 0,3',
};
......@@ -148,7 +148,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_05', 0, async function(done) {
try {
let imageAndVideoAlbumfetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ? or ' + fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ? or ' + mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ imageType.toString(), videoType.toString() ],
order : 'date_added DESC LIMIT 0,3',
};
......@@ -174,7 +174,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_06', 0, async function(done) {
try {
let imageAndAudioAlbumfetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ? or ' + fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ? or ' + mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ imageType.toString(), audioType.toString() ],
order : 'date_added DESC LIMIT 0,3',
};
......@@ -200,7 +200,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_07', 0, async function(done) {
try {
let videoAndAudioAlbumfetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ? or ' + fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ? or ' + mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ videoType.toString(), audioType.toString() ],
order : 'date_added DESC LIMIT 0,3',
};
......@@ -226,8 +226,8 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_08', 0, async function(done) {
try {
let imgAndVideoAndAudioAlbumfetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ? or ' + fileKeyObj.MEDIA_TYPE + '= ? or '
+ fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ? or ' + mediaLibrary.FileKey.MEDIA_TYPE + '= ? or '
+ mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ imageType.toString(), videoType.toString(), audioType.toString() ],
order : 'date_added DESC LIMIT 0,3',
};
......@@ -253,7 +253,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_09', 0, async function(done) {
try {
let albumfetchOpOne = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ imageType.toString() ],
order : 'date_added DESC LIMIT 0,1',
};
......@@ -279,7 +279,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_10', 0, async function(done) {
try {
let albumfetchOpOne = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ audioType.toString() ],
order : 'date_added DESC LIMIT 0,1',
};
......@@ -305,7 +305,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_11', 0, async function(done) {
try {
let albumfetchOpOne = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ videoType.toString() ],
order : 'date_added DESC LIMIT 0,1',
};
......@@ -331,7 +331,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_12', 0, async function(done) {
try {
let albumfetchOpNone = {
selections : fileKeyObj.MEDIA_TYPE + '= ? AND date_added < 0',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ? AND date_added < 0',
selectionArgs : [ imageType.toString() ],
order : 'date_added DESC LIMIT 0,1',
};
......@@ -359,7 +359,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_13', 0, async function(done) {
try {
let albumfetchOpNone = {
selections : fileKeyObj.MEDIA_TYPE + '= ? AND date_added < 0',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ? AND date_added < 0',
selectionArgs : [ audioType.toString() ],
order : 'date_added DESC LIMIT 0,1',
};
......@@ -387,7 +387,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_14', 0, async function(done) {
try {
let albumfetchOpNone = {
selections : fileKeyObj.MEDIA_TYPE + '= ? AND date_added < 0',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ? AND date_added < 0',
selectionArgs : [ videoType.toString() ],
order : 'date_added DESC LIMIT 0,1',
};
......
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
import mediaLibrary from '@ohos.multimedia.medialibrary';
import mediaLibrary from '@ohos.multimedia.mediaLibrary';
import featureAbility from '@ohos.ability.featureAbility';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index';
......@@ -27,35 +27,35 @@ let allTypefetchOp = {
selectionArgs: [],
};
let albumDeletefetchOp = {
selections: fileKeyObj.RELATIVE_PATH + '= ? AND ' + fileKeyObj.ALBUM_NAME + '= ?',
selectionArgs: ['Pictures/','DeleteAlbumCallback'],
selections: mediaLibrary.FileKey.RELATIVE_PATH + '= ? AND ' + mediaLibrary.FileKey.ALBUM_NAME + '= ?',
selectionArgs: ['Pictures/', 'DeleteAlbumCallback'],
};
let albumCoverUrifetchOp = {
selections: fileKeyObj.RELATIVE_PATH + '= ? AND ' + fileKeyObj.ALBUM_NAME + '= ?',
selectionArgs: ['Pictures/','weixin'],
selections: mediaLibrary.FileKey.RELATIVE_PATH + '= ? AND ' + mediaLibrary.FileKey.ALBUM_NAME + '= ?',
selectionArgs: ['Pictures/', 'weixin'],
};
let imageAlbumfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [imageType.toString()],
};
let videoAlbumfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [videoType.toString()],
};
let audioAlbumfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [audioType.toString()],
};
let imageAndVideoAlbumfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ? or ' + fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ? or ' + mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [imageType.toString(), videoType.toString()],
};
let imageAndAudioAlbumfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ? or ' + fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ? or ' + mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [imageType.toString(), audioType.toString()],
};
let videoAndAudioAlbumfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ? or ' + fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ? or ' + mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [videoType.toString(), audioType.toString()],
};
function printAlbumMessage(testNum, album) {
......@@ -476,7 +476,7 @@ describe('albumTestCallBack.test.js', async function () {
*/
it('SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_CALLBACK_002_06', 0, async function (done) {
let fileHasArgsfetchOp3 = {
selections: fileKeyObj.MEDIA_TYPE + ' = ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + ' = ?',
selectionArgs: ['666'],
};
try {
......@@ -803,7 +803,7 @@ describe('albumTestCallBack.test.js', async function () {
selectionArgs: [],
order: 'date_added DESC LIMIT 0,1',
};
media.getAlbums(albumCoverUrifetchOp, async(err, albumList) => {
media.getAlbums(albumCoverUrifetchOp, async (err, albumList) => {
if (albumList == undefined) {
expect(false).assertTrue();
done();
......@@ -821,7 +821,7 @@ describe('albumTestCallBack.test.js', async function () {
console.info('ALBUM_CALLBACK getAlbum 004_01 asset.uri = ' + asset.uri);
expect(asset.uri == album.coverUri).assertTrue();
done();
}
}
}
});
} catch (error) {
......
......@@ -27,35 +27,35 @@ let allTypefetchOp = {
selectionArgs: [],
};
let albumDeletefetchOp = {
selections: fileKeyObj.RELATIVE_PATH + '= ? AND ' + fileKeyObj.ALBUM_NAME + '= ?',
selectionArgs: ['Pictures/','DeleteAlbumPro'],
selections: mediaLibrary.FileKey.RELATIVE_PATH + '= ? AND ' + mediaLibrary.FileKey.ALBUM_NAME + '= ?',
selectionArgs: ['Pictures/', 'DeleteAlbumPro'],
};
let albumCoverUrifetchOp = {
selections: fileKeyObj.RELATIVE_PATH + '= ? AND ' + fileKeyObj.ALBUM_NAME + '= ?',
selectionArgs: ['Pictures/','weixin'],
selections: mediaLibrary.FileKey.RELATIVE_PATH + '= ? AND ' + mediaLibrary.FileKey.ALBUM_NAME + '= ?',
selectionArgs: ['Pictures/', 'weixin'],
};
let imageAlbumfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [imageType.toString()],
};
let videoAlbumfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [videoType.toString()],
};
let audioAlbumfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [audioType.toString()],
};
let imageAndVideoAlbumfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ? or ' + fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ? or ' + mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [imageType.toString(), videoType.toString()],
};
let imageAndAudioAlbumfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ? or ' + fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ? or ' + mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [imageType.toString(), audioType.toString()],
};
let videoAndAudioAlbumfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ? or ' + fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ? or ' + mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [videoType.toString(), audioType.toString()],
};
function printAlbumMessage(testNum, album) {
......@@ -85,10 +85,10 @@ function checkAlbumAttr(done, album) {
describe('albumTestPromise.test.js', async function () {
var context = featureAbility.getContext();
var media = mediaLibrary.getMediaLibrary(context);
beforeAll(function () {});
beforeEach(function () {});
afterEach(function () {});
afterAll(function () {});
beforeAll(function () { });
beforeEach(function () { });
afterEach(function () { });
afterAll(function () { });
// ------------------------------ 001 test start -------------------------
/**
......@@ -394,7 +394,7 @@ describe('albumTestPromise.test.js', async function () {
*/
it('SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_PROMISE_002_06', 0, async function (done) {
let fileHasArgsfetchOp3 = {
selections: fileKeyObj.MEDIA_TYPE + ' = ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + ' = ?',
selectionArgs: ['666'],
};
try {
......
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
import mediaLibrary from '@ohos.multimedia.medialibrary';
import mediaLibrary from '@ohos.multimedia.mediaLibrary';
import featureAbility from '@ohos.ability.featureAbility';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index';
......@@ -23,19 +23,19 @@ const imageType = mediaLibrary.MediaType.IMAGE;
const videoType = mediaLibrary.MediaType.VIDEO;
const audioType = mediaLibrary.MediaType.AUDIO;
const fileFetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [fileType.toString()],
};
const imageFetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [imageType.toString()],
};
const videoFetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [videoType.toString()],
};
const audioFetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [audioType.toString()],
};
......
......@@ -23,19 +23,19 @@ const imageType = mediaLibrary.MediaType.IMAGE;
const videoType = mediaLibrary.MediaType.VIDEO;
const audioType = mediaLibrary.MediaType.AUDIO;
const fileFetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [fileType.toString()],
};
const imageFetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [imageType.toString()],
};
const videoFetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [videoType.toString()],
};
const audioFetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [audioType.toString()],
};
......
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
import mediaLibrary from '@ohos.multimedia.medialibrary';
import mediaLibrary from '@ohos.multimedia.mediaLibrary';
import featureAbility from '@ohos.ability.featureAbility';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index';
......
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
import mediaLibrary from '@ohos.multimedia.medialibrary';
import mediaLibrary from '@ohos.multimedia.mediaLibrary';
import featureAbility from '@ohos.ability.featureAbility';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index';
......@@ -24,71 +24,71 @@ let videoType = mediaLibrary.MediaType.VIDEO;
let audioType = mediaLibrary.MediaType.AUDIO;
let getFileCountOneOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ fileType.toString() ],
order : fileKeyObj.DATE_ADDED + " DESC LIMIT 0,1",
extendArgs : "",
order : mediaLibrary.FileKey.DATE_ADDED + " DESC LIMIT 0,1",
};
let getFileCountTwoOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ fileType.toString() ],
order : fileKeyObj.DATE_ADDED + " DESC LIMIT 0,2",
extendArgs : "",
order : mediaLibrary.FileKey.DATE_ADDED + " DESC LIMIT 0,2",
};
let getFileCountTenOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ fileType.toString() ],
order : fileKeyObj.DATE_ADDED + " DESC LIMIT 0,10",
extendArgs : "",
order : mediaLibrary.FileKey.DATE_ADDED + " DESC LIMIT 0,10",
};
let getFileCountOneHundredOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ fileType.toString() ],
order : fileKeyObj.DATE_ADDED + " DESC LIMIT 0,100",
extendArgs : "",
order : mediaLibrary.FileKey.DATE_ADDED + " DESC LIMIT 0,100",
};
let getFirstObjectOp = {
selections : fileKeyObj.RELATIVE_PATH + '= ?',
selections : mediaLibrary.FileKey.RELATIVE_PATH + '= ?',
selectionArgs : [ 'Camera/' ],
order : fileKeyObj.ID + " DESC LIMIT 0,5",
extendArgs : "",
order : mediaLibrary.FileKey.ID + " DESC LIMIT 0,5",
}
let getAllObjectLimitOneOp = {
selections : fileKeyObj.RELATIVE_PATH + '= ?',
selections : mediaLibrary.FileKey.RELATIVE_PATH + '= ?',
selectionArgs : [ 'Camera/' ],
order : fileKeyObj.ID + " DESC LIMIT 0,1",
extendArgs : "",
order : mediaLibrary.FileKey.ID + " DESC LIMIT 0,1",
}
let getAllObjectLimitTwoOp = {
selections : fileKeyObj.RELATIVE_PATH + '= ?',
selections : mediaLibrary.FileKey.RELATIVE_PATH + '= ?',
selectionArgs : [ 'Camera/' ],
order : fileKeyObj.ID + " DESC LIMIT 0,1",
extendArgs : "",
order : mediaLibrary.FileKey.ID + " DESC LIMIT 0,1",
}
let getAllObjectLimitOneHundredOp = {
selections : fileKeyObj.RELATIVE_PATH + '= ?',
selections : mediaLibrary.FileKey.RELATIVE_PATH + '= ?',
selectionArgs : [ 'Camera/' ],
order : fileKeyObj.ID + " DESC LIMIT 0,100",
extendArgs : "",
order : mediaLibrary.FileKey.ID + " DESC LIMIT 0,100",
}
let getFileCountZeroOp = {
selections : fileKeyObj.DISPLAY_NAME + '=?',
selections : mediaLibrary.FileKey.DISPLAY_NAME + '=?',
selectionArgs : [ 'The world has kissed my soul with its pain, asking for its return in songs.' ],
};
let getFileOp = {
selections : fileKeyObj.DISPLAY_NAME + '= ? AND ' + fileKeyObj.RELATIVE_PATH + '= ?',
selections : mediaLibrary.FileKey.DISPLAY_NAME + '= ? AND ' + mediaLibrary.FileKey.RELATIVE_PATH + '= ?',
selectionArgs : [ '01.jpg', 'Camera/' ],
order : fileKeyObj.ID + " DESC LIMIT 0,100",
extendArgs : "",
order : mediaLibrary.FileKey.ID + " DESC LIMIT 0,100",
}
describe('fetchFileResultCallback.test.js', async function() {
......
......@@ -24,71 +24,71 @@ let videoType = mediaLibrary.MediaType.VIDEO;
let audioType = mediaLibrary.MediaType.AUDIO;
let getFileCountOneOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ fileType.toString() ],
order : fileKeyObj.DATE_ADDED + " DESC LIMIT 0,1",
extendArgs : "",
order : mediaLibrary.FileKey.DATE_ADDED + " DESC LIMIT 0,1",
};
let getFileCountTwoOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ fileType.toString() ],
order : fileKeyObj.DATE_ADDED + " DESC LIMIT 0,2",
extendArgs : "",
order : mediaLibrary.FileKey.DATE_ADDED + " DESC LIMIT 0,2",
};
let getFileCountTenOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ fileType.toString() ],
order : fileKeyObj.DATE_ADDED + " DESC LIMIT 0,10",
extendArgs : "",
order : mediaLibrary.FileKey.DATE_ADDED + " DESC LIMIT 0,10",
};
let getFileCountOneHundredOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ fileType.toString() ],
order : fileKeyObj.DATE_ADDED + " DESC LIMIT 0,100",
extendArgs : "",
order : mediaLibrary.FileKey.DATE_ADDED + " DESC LIMIT 0,100",
};
let getFirstObjectOp = {
selections : fileKeyObj.RELATIVE_PATH + '= ?',
selections : mediaLibrary.FileKey.RELATIVE_PATH + '= ?',
selectionArgs : [ 'Camera/' ],
order : fileKeyObj.ID + " DESC LIMIT 0,5",
extendArgs : "",
order : mediaLibrary.FileKey.ID + " DESC LIMIT 0,5",
}
let getAllObjectLimitOneOp = {
selections : fileKeyObj.RELATIVE_PATH + '= ?',
selections : mediaLibrary.FileKey.RELATIVE_PATH + '= ?',
selectionArgs : [ 'Camera/' ],
order : fileKeyObj.ID + " DESC LIMIT 0,1",
extendArgs : "",
order : mediaLibrary.FileKey.ID + " DESC LIMIT 0,1",
}
let getAllObjectLimitTwoOp = {
selections : fileKeyObj.RELATIVE_PATH + '= ?',
selections : mediaLibrary.FileKey.RELATIVE_PATH + '= ?',
selectionArgs : [ 'Camera/' ],
order : fileKeyObj.ID + " DESC LIMIT 0,1",
extendArgs : "",
order : mediaLibrary.FileKey.ID + " DESC LIMIT 0,1",
}
let getAllObjectLimitOneHundredOp = {
selections : fileKeyObj.RELATIVE_PATH + '= ?',
selections : mediaLibrary.FileKey.RELATIVE_PATH + '= ?',
selectionArgs : [ 'Camera/' ],
order : fileKeyObj.ID + " DESC LIMIT 0,100",
extendArgs : "",
order : mediaLibrary.FileKey.ID + " DESC LIMIT 0,100",
}
let getFileCountZeroOp = {
selections : fileKeyObj.DISPLAY_NAME + '=?',
selections : mediaLibrary.FileKey.DISPLAY_NAME + '=?',
selectionArgs : [ 'The world has kissed my soul with its pain, asking for its return in songs.' ],
};
let getFileOp = {
selections : fileKeyObj.DISPLAY_NAME + '= ? AND ' + fileKeyObj.RELATIVE_PATH + '= ?',
selections : mediaLibrary.FileKey.DISPLAY_NAME + '= ? AND ' + mediaLibrary.FileKey.RELATIVE_PATH + '= ?',
selectionArgs : [ '01.jpg', 'Camera/' ],
order : fileKeyObj.ID + " DESC LIMIT 0,100",
extendArgs : "",
order : mediaLibrary.FileKey.ID + " DESC LIMIT 0,100",
}
describe('fetchFileResultPromise.test.js', async function() {
......
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
import mediaLibrary from '@ohos.multimedia.medialibrary';
import mediaLibrary from '@ohos.multimedia.mediaLibrary';
import featureAbility from '@ohos.ability.featureAbility';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index';
......@@ -47,16 +47,16 @@ describe('fileAsset2.test.js', async function () {
let videoType = mediaLibrary.MediaType.VIDEO;
let audioType = mediaLibrary.MediaType.AUDIO;
let imagesfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [imageType.toString()],
};
let videosfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [videoType.toString()],
};
let audiosfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [audioType.toString()],
};
......@@ -66,10 +66,10 @@ describe('fileAsset2.test.js', async function () {
};
const context = featureAbility.getContext();
const media = mediaLibrary.getMediaLibrary(context);
beforeAll(function () {});
beforeEach(function () {});
afterEach(function () {});
afterAll(function () {});
beforeAll(function () { });
beforeEach(function () { });
afterEach(function () { });
afterAll(function () { });
/**
* @tc.number : SUB_MEDIA_FILEASSET_commitModify_promise_001
......
......@@ -47,16 +47,16 @@ describe('fileAssetCallBack2.test.js', async function () {
let videoType = mediaLibrary.MediaType.VIDEO;
let audioType = mediaLibrary.MediaType.AUDIO;
let imagesfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [imageType.toString()],
};
let videosfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [videoType.toString()],
};
let audiosfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [audioType.toString()],
};
......@@ -66,10 +66,10 @@ describe('fileAssetCallBack2.test.js', async function () {
};
const context = featureAbility.getContext();
const media = mediaLibrary.getMediaLibrary(context);
beforeAll(function () {});
beforeEach(function () {});
afterEach(function () {});
afterAll(function () {});
beforeAll(function () { });
beforeEach(function () { });
afterEach(function () { });
afterAll(function () { });
/**
* @tc.number : SUB_MEDIA_FILEASSET_commitModify_callback_001
......@@ -86,7 +86,7 @@ describe('fileAssetCallBack2.test.js', async function () {
const newName = 'newName';
asset.displayName = newName;
const id = asset.id;
asset.commitModify(async ()=>{
asset.commitModify(async () => {
const fetchFileResult2 = await media.getFileAssets(imagesfetchOp);
const dataList = await fetchFileResult2.getAllObject();
let passed = false;
......@@ -101,7 +101,7 @@ describe('fileAssetCallBack2.test.js', async function () {
done();
});
} catch (error) {
console.info('FileAsset commitModify 001 failed, message = ' + error);
expect(false).assertTrue();
......@@ -247,9 +247,9 @@ describe('fileAssetCallBack2.test.js', async function () {
asset.uri = newUri;
asset.commitModify(async (err) => {
if(err) {
if (err) {
expect(true).assertTrue();
done();
done();
} else {
console.info('FileAsset commitModify 005 failed');
expect(false).assertTrue();
......@@ -257,7 +257,7 @@ describe('fileAssetCallBack2.test.js', async function () {
}
});
} catch (error) {
console.info('FileAsset commitModify 005 passed');
expect(true).assertTrue();
......@@ -283,7 +283,7 @@ describe('fileAssetCallBack2.test.js', async function () {
asset.mediaType = newMediaType;
asset.commitModify(async (err) => {
if(err) {
if (err) {
expect(true).assertTrue();
done();
} else {
......@@ -312,7 +312,7 @@ describe('fileAssetCallBack2.test.js', async function () {
const fetchFileResult = await media.getFileAssets(imagesfetchOp);
const asset = await fetchFileResult.getFirstObject();
asset.isDirectory((err, isDir) => {
if(isDir == undefined) {
if (isDir == undefined) {
expect(false).assertTrue();
done();
} else {
......@@ -339,7 +339,7 @@ describe('fileAssetCallBack2.test.js', async function () {
try {
const fetchFileResult = await media.getFileAssets(imagesfetchOp);
fetchFileResult.getFirstObject((err, asset) => {
if(asset == undefined) {
if (asset == undefined) {
expect(false).assertTrue();
done();
} else {
......@@ -366,7 +366,7 @@ describe('fileAssetCallBack2.test.js', async function () {
try {
const fetchFileResult = await media.getFileAssets(videosfetchOp);
fetchFileResult.getFirstObject((err, asset) => {
if(asset == undefined) {
if (asset == undefined) {
expect(false).assertTrue();
done();
} else {
......@@ -392,8 +392,8 @@ describe('fileAssetCallBack2.test.js', async function () {
it('SUB_MEDIA_FILEASSET_checkAttr_callback_003', 0, async function (done) {
try {
const fetchFileResult = await media.getFileAssets(audiosfetchOp);
fetchFileResult.getFirstObject((err, asset)=>{
if(asset == undefined) {
fetchFileResult.getFirstObject((err, asset) => {
if (asset == undefined) {
expect(false).assertTrue();
done();
} else {
......@@ -421,8 +421,8 @@ describe('fileAssetCallBack2.test.js', async function () {
const albumList = await media.getAlbums(allTypefetchOp);
const album = albumList[0];
const fetchFileResult = await album.getFileAssets(allTypefetchOp);
fetchFileResult.getFirstObject((err, asset) => {
if(asset == undefined) {
fetchFileResult.getFirstObject((err, asset) => {
if (asset == undefined) {
expect(false).assertTrue();
done();
} else {
......@@ -430,7 +430,7 @@ describe('fileAssetCallBack2.test.js', async function () {
checkAttrs(done, asset, '004');
}
});
} catch (error) {
console.info('FileAsset checkAttr 003 failed, message = ' + error);
expect(false).assertTrue();
......
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
import mediaLibrary from '@ohos.multimedia.medialibrary';
import mediaLibrary from '@ohos.multimedia.mediaLibrary';
import featureAbility from '@ohos.ability.featureAbility';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index';
......@@ -47,16 +47,16 @@ describe('fileAssetPromise2.test.js', async function () {
let videoType = mediaLibrary.MediaType.VIDEO;
let audioType = mediaLibrary.MediaType.AUDIO;
let imagesfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [imageType.toString()],
};
let videosfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [videoType.toString()],
};
let audiosfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [audioType.toString()],
};
......@@ -66,10 +66,10 @@ describe('fileAssetPromise2.test.js', async function () {
};
const context = featureAbility.getContext();
const media = mediaLibrary.getMediaLibrary(context);
beforeAll(function () {});
beforeEach(function () {});
afterEach(function () {});
afterAll(function () {});
beforeAll(function () { });
beforeEach(function () { });
afterEach(function () { });
afterAll(function () { });
/**
* @tc.number : SUB_MEDIA_FILEASSET_commitModify_promise_001
......
......@@ -42,7 +42,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try {
let fileType = mediaLibrary.MediaType.FILE;
let fileFetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ fileType.toString() ],
};
let fetchFileResult = await media.getFileAssets(fileFetchOp);
......@@ -109,7 +109,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try {
let type = mediaLibrary.MediaType.FILE;
let fetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
......@@ -173,7 +173,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try {
let type = mediaLibrary.MediaType.FILE;
let fetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
......@@ -243,7 +243,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try {
let type = mediaLibrary.MediaType.ALBUM;
let fetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
......@@ -278,7 +278,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try {
let type = mediaLibrary.MediaType.ALBUM;
let fetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
......@@ -313,7 +313,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try {
let type = mediaLibrary.MediaType.ALBUM;
let fetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
......@@ -352,7 +352,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try {
let fileType = mediaLibrary.MediaType.IMAGE;
let fileFetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ fileType.toString() ],
};
let fetchFileResult = await media.getFileAssets(fileFetchOp);
......@@ -412,7 +412,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try {
let type = mediaLibrary.MediaType.IMAGE;
let fetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
......@@ -472,7 +472,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try {
let type = mediaLibrary.MediaType.IMAGE;
let fetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
......@@ -545,7 +545,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try {
let fileType = mediaLibrary.MediaType.AUDIO;
let fileFetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ fileType.toString() ],
};
let fetchFileResult = await media.getFileAssets(fileFetchOp);
......@@ -606,7 +606,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try {
let type = mediaLibrary.MediaType.AUDIO;
let fetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
......@@ -673,7 +673,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try {
let type = mediaLibrary.MediaType.AUDIO;
let fetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
......@@ -746,7 +746,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try {
let fileType = mediaLibrary.MediaType.VIDEO;
let fileFetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ fileType.toString() ],
};
let fetchFileResult = await media.getFileAssets(fileFetchOp);
......@@ -815,7 +815,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try {
let type = mediaLibrary.MediaType.VIDEO;
let fetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
......@@ -880,7 +880,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try {
let type = mediaLibrary.MediaType.VIDEO;
let fetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
......@@ -952,7 +952,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try {
let type = mediaLibrary.MediaType.FILE;
let fetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
......@@ -1000,7 +1000,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try {
let type = mediaLibrary.MediaType.IMAGE;
let fetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
......@@ -1048,7 +1048,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try {
let type = mediaLibrary.MediaType.AUDIO;
let fetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
......@@ -1096,7 +1096,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try {
let type = mediaLibrary.MediaType.VIDEO;
let fetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
......
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
import mediaLibrary from '@ohos.multimedia.medialibrary';
import mediaLibrary from '@ohos.multimedia.mediaLibrary';
import featureAbility from '@ohos.ability.featureAbility';
import fileio from '@ohos.fileio';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index';
......@@ -42,7 +42,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try {
let fileType = mediaLibrary.MediaType.FILE;
let fileFetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ fileType.toString() ],
};
let fetchFileResult = await media.getFileAssets(fileFetchOp);
......@@ -95,7 +95,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try {
let type = mediaLibrary.MediaType.FILE;
let fetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
......@@ -136,7 +136,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try {
let type = mediaLibrary.MediaType.FILE;
let fetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
......@@ -180,7 +180,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try {
let type = mediaLibrary.MediaType.ALBUM;
let fetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
......@@ -212,7 +212,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try {
let type = mediaLibrary.MediaType.ALBUM;
let fetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
......@@ -244,7 +244,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try {
let type = mediaLibrary.MediaType.ALBUM;
let fetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
......@@ -281,7 +281,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try {
let fileType = mediaLibrary.MediaType.IMAGE;
let fileFetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ fileType.toString() ],
};
let fetchFileResult = await media.getFileAssets(fileFetchOp);
......@@ -332,7 +332,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try {
let type = mediaLibrary.MediaType.IMAGE;
let fetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
......@@ -373,7 +373,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try {
let type = mediaLibrary.MediaType.IMAGE;
let fetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
......@@ -419,7 +419,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try {
let fileType = mediaLibrary.MediaType.AUDIO;
let fileFetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ fileType.toString() ],
};
let fetchFileResult = await media.getFileAssets(fileFetchOp);
......@@ -470,7 +470,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try {
let type = mediaLibrary.MediaType.AUDIO;
let fetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
......@@ -511,7 +511,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try {
let type = mediaLibrary.MediaType.AUDIO;
let fetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
......@@ -557,7 +557,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try {
let fileType = mediaLibrary.MediaType.VIDEO;
let fileFetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ fileType.toString() ],
};
let fetchFileResult = await media.getFileAssets(fileFetchOp);
......@@ -616,7 +616,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try {
let type = mediaLibrary.MediaType.VIDEO;
let fetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
......@@ -660,7 +660,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try {
let type = mediaLibrary.MediaType.VIDEO;
let fetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
......@@ -709,7 +709,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try {
let type = mediaLibrary.MediaType.FILE;
let fetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
......@@ -753,7 +753,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try {
let type = mediaLibrary.MediaType.IMAGE;
let fetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
......@@ -797,7 +797,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try {
let type = mediaLibrary.MediaType.AUDIO;
let fetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
......@@ -841,7 +841,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try {
let type = mediaLibrary.MediaType.VIDEO;
let fetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
......
......@@ -41,7 +41,7 @@ describe('fileAssetUriTestCallback.test.js', async function() {
try {
let type = mediaLibrary.MediaType.IMAGE;
let fetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
const fetchFileResult = await media.getFileAssets(fetchOp);
......@@ -57,7 +57,7 @@ describe('fileAssetUriTestCallback.test.js', async function() {
let serchfetchOp = {
uri:serachUri.toString(),
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString()],
};
......
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
import mediaLibrary from '@ohos.multimedia.medialibrary';
import mediaLibrary from '@ohos.multimedia.mediaLibrary';
import featureAbility from '@ohos.ability.featureAbility'
import fileio from '@ohos.fileio';
import {describe, it, expect} from 'deccjsunit/index';
......@@ -41,7 +41,7 @@ describe('fileAssetUriTestPromise.test.js', async function() {
try {
let type = mediaLibrary.MediaType.IMAGE;
let fetchOp = {
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
const fetchFileResult = await media.getFileAssets(fetchOp);
......@@ -56,7 +56,7 @@ describe('fileAssetUriTestPromise.test.js', async function() {
let serchfetchOp = {
uri : serachUri.toString(),
selections : fileKeyObj.MEDIA_TYPE + '= ?',
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
......
......@@ -25,19 +25,19 @@ let videoType = mediaLibrary.MediaType.VIDEO;
let audioType = mediaLibrary.MediaType.AUDIO;
let imagesfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [imageType.toString()],
};
let videosfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [videoType.toString()],
};
let audiosfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [audioType.toString()],
};
let filesfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [fileType.toString()],
};
......@@ -138,7 +138,7 @@ describe('fileTestCallBack.test.js', function () {
*/
it('SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_001_02', 0, async function (done) {
try {
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const fileAssets = await media.getFileAssets(idOP);
const asset = await fileAssets.getFirstObject();
......@@ -159,7 +159,7 @@ describe('fileTestCallBack.test.js', function () {
*/
it('SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_001_03', 0, async function (done) {
try {
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const fileAssets = await media.getFileAssets(idOP);
const asset = await fileAssets.getFirstObject();
expect(asset.relativePath == path).assertTrue();
......@@ -185,7 +185,7 @@ describe('fileTestCallBack.test.js', function () {
asset.title = `title_${new Date().getTime()}`;
asset.commitModify(async () => {
const id = asset.id;
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const newAssets = await media.getFileAssets(idOP);
const newdataList = await newAssets.getAllObject();
const newAsset = newdataList[0];
......@@ -225,7 +225,7 @@ describe('fileTestCallBack.test.js', function () {
*/
it('SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_001_08', 0, async function (done) {
try {
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const fileAssets = await media.getFileAssets(idOP);
const asset = await fileAssets.getFirstObject();
expect(asset.mediaType == mediaType).assertTrue();
......@@ -245,7 +245,7 @@ describe('fileTestCallBack.test.js', function () {
*/
it('SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_001_11', 0, async function (done) {
try {
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const fileAssets = await media.getFileAssets(idOP);
const asset = await fileAssets.getFirstObject();
expect(asset.orientation == orientation).assertTrue();
......@@ -319,7 +319,7 @@ describe('fileTestCallBack.test.js', function () {
*/
it('SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_002_02', 0, async function (done) {
try {
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const fileAssets = await media.getFileAssets(idOP);
const asset = await fileAssets.getFirstObject();
......@@ -340,7 +340,7 @@ describe('fileTestCallBack.test.js', function () {
*/
it('SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_002_03', 0, async function (done) {
try {
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const fileAssets = await media.getFileAssets(idOP);
const asset = await fileAssets.getFirstObject();
......@@ -367,7 +367,7 @@ describe('fileTestCallBack.test.js', function () {
asset.title = `title_${new Date().getTime()}`;
asset.commitModify(async () => {
const id = asset.id;
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const newAssets = await media.getFileAssets(idOP);
const newdataList = await newAssets.getAllObject();
const newAsset = newdataList[0];
......@@ -407,7 +407,7 @@ describe('fileTestCallBack.test.js', function () {
*/
it('SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_002_08', 0, async function (done) {
try {
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const fileAssets = await media.getFileAssets(idOP);
const asset = await fileAssets.getFirstObject();
expect(asset.mediaType == mediaType).assertTrue();
......@@ -427,7 +427,7 @@ describe('fileTestCallBack.test.js', function () {
*/
it('SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_002_11', 0, async function (done) {
try {
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const fileAssets = await media.getFileAssets(idOP);
const asset = await fileAssets.getFirstObject();
expect(asset.orientation == orientation).assertTrue();
......@@ -495,7 +495,7 @@ describe('fileTestCallBack.test.js', function () {
*/
it('SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_003_02', 0, async function (done) {
try {
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const fileAssets = await media.getFileAssets(idOP);
const asset = await fileAssets.getFirstObject();
expect(asset.displayName == displayName).assertTrue();
......@@ -516,7 +516,7 @@ describe('fileTestCallBack.test.js', function () {
*/
it('SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_003_03', 0, async function (done) {
try {
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const fileAssets = await media.getFileAssets(idOP);
const asset = await fileAssets.getFirstObject();
expect(asset.relativePath == path).assertTrue();
......@@ -542,7 +542,7 @@ describe('fileTestCallBack.test.js', function () {
asset.title = `title_${new Date().getTime()}`;
asset.commitModify(async () => {
const id = asset.id;
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const newAssets = await media.getFileAssets(idOP);
const newdataList = await newAssets.getAllObject();
const newAsset = newdataList[0];
......@@ -582,7 +582,7 @@ describe('fileTestCallBack.test.js', function () {
*/
it('SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_003_08', 0, async function (done) {
try {
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const fileAssets = await media.getFileAssets(idOP);
const asset = await fileAssets.getFirstObject();
expect(asset.mediaType == mediaType).assertTrue();
......@@ -650,7 +650,7 @@ describe('fileTestCallBack.test.js', function () {
*/
it('SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_004_02', 0, async function (done) {
try {
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const fileAssets = await media.getFileAssets(idOP);
const asset = await fileAssets.getFirstObject();
expect(asset.displayName == displayName).assertTrue();
......@@ -670,7 +670,7 @@ describe('fileTestCallBack.test.js', function () {
*/
it('SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_004_03', 0, async function (done) {
try {
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const fileAssets = await media.getFileAssets(idOP);
const asset = await fileAssets.getFirstObject();
expect(asset.relativePath == path).assertTrue();
......@@ -696,7 +696,7 @@ describe('fileTestCallBack.test.js', function () {
asset.title = `title_${new Date().getTime()}`;
asset.commitModify(async ()=> {
const id = asset.id;
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const newAssets = await media.getFileAssets(idOP);
const newdataList = await newAssets.getAllObject();
const newAsset = newdataList[0];
......@@ -736,7 +736,7 @@ describe('fileTestCallBack.test.js', function () {
*/
it('SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_004_08', 0, async function (done) {
try {
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const fileAssets = await media.getFileAssets(idOP);
const asset = await fileAssets.getFirstObject();
expect(asset.mediaType == mediaType).assertTrue();
......
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
import mediaLibrary from '@ohos.multimedia.medialibrary';
import mediaLibrary from '@ohos.multimedia.mediaLibrary';
import featureAbility from '@ohos.ability.featureAbility';
import fileio from '@ohos.fileio';
......@@ -25,19 +25,19 @@ let videoType = mediaLibrary.MediaType.VIDEO;
let audioType = mediaLibrary.MediaType.AUDIO;
let imagesfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [imageType.toString()],
};
let videosfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [videoType.toString()],
};
let audiosfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [audioType.toString()],
};
let filesfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [fileType.toString()],
};
......@@ -131,7 +131,7 @@ describe('fileTestPromise.test.js', function () {
*/
it('SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_001_02', 0, async function (done) {
try {
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const fileAssets = await media.getFileAssets(idOP);
const asset = await fileAssets.getFirstObject();
......@@ -152,7 +152,7 @@ describe('fileTestPromise.test.js', function () {
*/
it('SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_001_03', 0, async function (done) {
try {
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const fileAssets = await media.getFileAssets(idOP);
const asset = await fileAssets.getFirstObject();
expect(asset.relativePath == path).assertTrue();
......@@ -178,7 +178,7 @@ describe('fileTestPromise.test.js', function () {
asset.title = `title_${new Date().getTime()}`;
await asset.commitModify();
const id = asset.id;
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const newAssets = await media.getFileAssets(idOP);
const newdataList = await newAssets.getAllObject();
const newAsset = newdataList[0];
......@@ -217,7 +217,7 @@ describe('fileTestPromise.test.js', function () {
*/
it('SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_001_08', 0, async function (done) {
try {
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const fileAssets = await media.getFileAssets(idOP);
const asset = await fileAssets.getFirstObject();
expect(asset.mediaType == mediaType).assertTrue();
......@@ -237,7 +237,7 @@ describe('fileTestPromise.test.js', function () {
*/
it('SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_001_11', 0, async function (done) {
try {
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const fileAssets = await media.getFileAssets(idOP);
const asset = await fileAssets.getFirstObject();
expect(asset.orientation == orientation).assertTrue();
......@@ -304,7 +304,7 @@ describe('fileTestPromise.test.js', function () {
*/
it('SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_002_02', 0, async function (done) {
try {
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const fileAssets = await media.getFileAssets(idOP);
const asset = await fileAssets.getFirstObject();
......@@ -325,7 +325,7 @@ describe('fileTestPromise.test.js', function () {
*/
it('SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_002_03', 0, async function (done) {
try {
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const fileAssets = await media.getFileAssets(idOP);
const asset = await fileAssets.getFirstObject();
......@@ -352,7 +352,7 @@ describe('fileTestPromise.test.js', function () {
asset.title = `title_${new Date().getTime()}`;
await asset.commitModify();
const id = asset.id;
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const newAssets = await media.getFileAssets(idOP);
const newdataList = await newAssets.getAllObject();
const newAsset = newdataList[0];
......@@ -391,7 +391,7 @@ describe('fileTestPromise.test.js', function () {
*/
it('SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_002_08', 0, async function (done) {
try {
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const fileAssets = await media.getFileAssets(idOP);
const asset = await fileAssets.getFirstObject();
expect(asset.mediaType == mediaType).assertTrue();
......@@ -411,7 +411,7 @@ describe('fileTestPromise.test.js', function () {
*/
it('SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_002_11', 0, async function (done) {
try {
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const fileAssets = await media.getFileAssets(idOP);
const asset = await fileAssets.getFirstObject();
expect(asset.orientation == orientation).assertTrue();
......@@ -476,7 +476,7 @@ describe('fileTestPromise.test.js', function () {
*/
it('SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_003_02', 0, async function (done) {
try {
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const fileAssets = await media.getFileAssets(idOP);
const asset = await fileAssets.getFirstObject();
expect(asset.displayName == displayName).assertTrue();
......@@ -497,7 +497,7 @@ describe('fileTestPromise.test.js', function () {
*/
it('SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_003_03', 0, async function (done) {
try {
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const fileAssets = await media.getFileAssets(idOP);
const asset = await fileAssets.getFirstObject();
expect(asset.relativePath == path).assertTrue();
......@@ -524,7 +524,7 @@ describe('fileTestPromise.test.js', function () {
await asset.commitModify();
const id = asset.id;
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const newAssets = await media.getFileAssets(idOP);
const newdataList = await newAssets.getAllObject();
const newAsset = newdataList[0];
......@@ -563,7 +563,7 @@ describe('fileTestPromise.test.js', function () {
*/
it('SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_003_08', 0, async function (done) {
try {
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const fileAssets = await media.getFileAssets(idOP);
const asset = await fileAssets.getFirstObject();
expect(asset.mediaType == mediaType).assertTrue();
......@@ -629,7 +629,7 @@ describe('fileTestPromise.test.js', function () {
*/
it('SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_004_02', 0, async function (done) {
try {
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const fileAssets = await media.getFileAssets(idOP);
const asset = await fileAssets.getFirstObject();
expect(asset.displayName == displayName).assertTrue();
......@@ -649,7 +649,7 @@ describe('fileTestPromise.test.js', function () {
*/
it('SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_004_03', 0, async function (done) {
try {
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const fileAssets = await media.getFileAssets(idOP);
const asset = await fileAssets.getFirstObject();
expect(asset.relativePath == path).assertTrue();
......@@ -675,7 +675,7 @@ describe('fileTestPromise.test.js', function () {
asset.title = `title_${new Date().getTime()}`;
await asset.commitModify();
const id = asset.id;
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const newAssets = await media.getFileAssets(idOP);
const newdataList = await newAssets.getAllObject();
const newAsset = newdataList[0];
......@@ -714,7 +714,7 @@ describe('fileTestPromise.test.js', function () {
*/
it('SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_004_08', 0, async function (done) {
try {
const idOP = { selections: fileKeyObj.ID + '= ?', selectionArgs: ['' + id] };
const idOP = { selections: mediaLibrary.FileKey.ID + '= ?', selectionArgs: ['' + id] };
const fileAssets = await media.getFileAssets(idOP);
const asset = await fileAssets.getFirstObject();
expect(asset.mediaType == mediaType).assertTrue();
......
......@@ -25,17 +25,17 @@ let videoType = mediaLibrary.MediaType.VIDEO;
let audioType = mediaLibrary.MediaType.AUDIO;
let imagesfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [imageType.toString()],
};
let videosfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [videoType.toString()],
};
let audiosfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [audioType.toString()],
};
let allsfetchOp = {
......@@ -72,7 +72,7 @@ async function getFileAssetsBy(done, type) {
const fetchFileResult = await media.getFileAssets(assetOp);
const asset = await fetchFileResult.getFirstObject();
let Op = {
selections: fileKeyObj[filekeys[type]] + '= ?',
selections: mediaLibrary.FileKey[filekeys[type]] + '= ?',
selectionArgs: [asset[type] + ''],
};
......
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
import mediaLibrary from '@ohos.multimedia.medialibrary';
import mediaLibrary from '@ohos.multimedia.mediaLibrary';
import featureAbility from '@ohos.ability.featureAbility';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index';
......@@ -25,17 +25,17 @@ let videoType = mediaLibrary.MediaType.VIDEO;
let audioType = mediaLibrary.MediaType.AUDIO;
let imagesfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [imageType.toString()],
};
let videosfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [videoType.toString()],
};
let audiosfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [audioType.toString()],
};
let allsfetchOp = {
......@@ -72,7 +72,7 @@ async function getFileAssetsBy(done, type) {
const fetchFileResult = await media.getFileAssets(assetOp);
const asset = await fetchFileResult.getFirstObject();
let Op = {
selections: fileKeyObj[filekeys[type]] + '= ?',
selections: mediaLibrary.FileKey[filekeys[type]] + '= ?',
selectionArgs: [asset[type] + ''],
};
......
......@@ -18,9 +18,9 @@ import fileio from '@ohos.fileio';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index';
let fileKeyObj = mediaLibrary.FileKey;
let fetchOp = {
selections: fileKeyObj.PATH + ' LIKE ? ',
selections: mediaLibrary.FileKey.PATH + ' LIKE ? ',
selectionArgs: ['/data/media/%'],
order: fileKeyObj.PATH,
order: mediaLibrary.FileKey.PATH,
};
// let directoryTypeObj = mediaLibrary.DirectoryType;
......@@ -36,45 +36,45 @@ let audioType = mediaLibrary.MediaType.AUDIO;
let fileType = mediaLibrary.MediaType.FILE;
let imagesfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [imageType.toString()],
};
let videosfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [videoType.toString()],
};
let audiosfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [audioType.toString()],
};
let filesfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [fileType.toString()],
};
let imageAndVideofetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ? or ' + fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ? or ' + mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [imageType.toString(), videoType.toString()],
};
let imageAndVideoAndfilefetchOp = {
selections:
fileKeyObj.MEDIA_TYPE +
mediaLibrary.FileKey.MEDIA_TYPE +
'= ? or ' +
fileKeyObj.MEDIA_TYPE +
mediaLibrary.FileKey.MEDIA_TYPE +
'= ? or ' +
fileKeyObj.MEDIA_TYPE +
mediaLibrary.FileKey.MEDIA_TYPE +
'= ?',
selectionArgs: [imageType.toString(), videoType.toString(), fileType.toString()],
};
let imageAndVideoAndfileAndAudiofetchOp = {
selections:
fileKeyObj.MEDIA_TYPE +
mediaLibrary.FileKey.MEDIA_TYPE +
'= ? or ' +
fileKeyObj.MEDIA_TYPE +
mediaLibrary.FileKey.MEDIA_TYPE +
'= ? or ' +
fileKeyObj.MEDIA_TYPE +
mediaLibrary.FileKey.MEDIA_TYPE +
'= ? or ' +
fileKeyObj.MEDIA_TYPE +
mediaLibrary.FileKey.MEDIA_TYPE +
'= ?',
selectionArgs: [
imageType.toString(),
......@@ -267,7 +267,7 @@ describe('mediaLibraryTestCallBack.test.js', function () {
*/
it('SUB__MEDIA_MIDIALIBRARY_CALLBACK_GETFILEASSETS_008', 0, async function (done) {
let fetchOp = {
selections: fileKeyObj.MEDIA_TYPE + 'abc= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + 'abc= ?',
selectionArgs: ['abc'],
};
try {
......@@ -292,7 +292,7 @@ describe('mediaLibraryTestCallBack.test.js', function () {
*/
it('SUB__MEDIA_MIDIALIBRARY_CALLBACK_GETFILEASSETS_009', 0, async function (done) {
let fetchOp = {
selections: fileKeyObj.MEDIA_TYPE + 'abc= ? or ' + fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + 'abc= ? or ' + mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: ['abc', audioType.toString()],
};
try {
......@@ -318,11 +318,11 @@ describe('mediaLibraryTestCallBack.test.js', function () {
it('SUB__MEDIA_MIDIALIBRARY_CALLBACK_GETFILEASSETS_010', 0, async function (done) {
let fetchOp = {
selections:
fileKeyObj.MEDIA_TYPE +
mediaLibrary.FileKey.MEDIA_TYPE +
'abc= ? or ' +
fileKeyObj.MEDIA_TYPE +
mediaLibrary.FileKey.MEDIA_TYPE +
'= ? or ' +
fileKeyObj.MEDIA_TYPE +
mediaLibrary.FileKey.MEDIA_TYPE +
'= ?',
selectionArgs: ['abc', videoType.toString(), fileType.toString()],
};
......@@ -349,13 +349,13 @@ describe('mediaLibraryTestCallBack.test.js', function () {
it('SUB__MEDIA_MIDIALIBRARY_CALLBACK_GETFILEASSETS_011', 0, async function (done) {
let fetchOp = {
selections:
fileKeyObj.MEDIA_TYPE +
mediaLibrary.FileKey.MEDIA_TYPE +
'abc= ? or ' +
fileKeyObj.MEDIA_TYPE +
mediaLibrary.FileKey.MEDIA_TYPE +
'= ? or ' +
fileKeyObj.MEDIA_TYPE +
mediaLibrary.FileKey.MEDIA_TYPE +
'= ? or ' +
fileKeyObj.MEDIA_TYPE +
mediaLibrary.FileKey.MEDIA_TYPE +
'= ?',
selectionArgs: ['abc', videoType.toString(), fileType.toString(), audioType.toString()],
};
......
......@@ -12,15 +12,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import mediaLibrary from '@ohos.multimedia.medialibrary';
import mediaLibrary from '@ohos.multimedia.mediaLibrary';
import featureAbility from '@ohos.ability.featureAbility';
import fileio from '@ohos.fileio';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index';
let fileKeyObj = mediaLibrary.FileKey;
let fetchOp = {
selections: fileKeyObj.PATH + ' LIKE ? ',
selections: mediaLibrary.FileKey.PATH + ' LIKE ? ',
selectionArgs: ['/data/media/%'],
order: fileKeyObj.PATH,
order: mediaLibrary.FileKey.PATH,
};
// let directoryTypeObj = mediaLibrary.DirectoryType;
......@@ -36,45 +36,45 @@ let audioType = mediaLibrary.MediaType.AUDIO;
let fileType = mediaLibrary.MediaType.FILE;
let imagesfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [imageType.toString()],
};
let videosfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [videoType.toString()],
};
let audiosfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [audioType.toString()],
};
let filesfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [fileType.toString()],
};
let imageAndVideofetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ? or ' + fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ? or ' + mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [imageType.toString(), videoType.toString()],
};
let imageAndVideoAndfilefetchOp = {
selections:
fileKeyObj.MEDIA_TYPE +
mediaLibrary.FileKey.MEDIA_TYPE +
'= ? or ' +
fileKeyObj.MEDIA_TYPE +
mediaLibrary.FileKey.MEDIA_TYPE +
'= ? or ' +
fileKeyObj.MEDIA_TYPE +
mediaLibrary.FileKey.MEDIA_TYPE +
'= ?',
selectionArgs: [imageType.toString(), videoType.toString(), fileType.toString()],
};
let imageAndVideoAndfileAndAudiofetchOp = {
selections:
fileKeyObj.MEDIA_TYPE +
mediaLibrary.FileKey.MEDIA_TYPE +
'= ? or ' +
fileKeyObj.MEDIA_TYPE +
mediaLibrary.FileKey.MEDIA_TYPE +
'= ? or ' +
fileKeyObj.MEDIA_TYPE +
mediaLibrary.FileKey.MEDIA_TYPE +
'= ? or ' +
fileKeyObj.MEDIA_TYPE +
mediaLibrary.FileKey.MEDIA_TYPE +
'= ?',
selectionArgs: [
imageType.toString(),
......@@ -100,10 +100,10 @@ describe('mediaLibraryTestPromise.test.js', function () {
const context = featureAbility.getContext();
const media = mediaLibrary.getMediaLibrary(context);
beforeAll(function () {});
beforeEach(function () {});
afterEach(function () {});
afterAll(function () {});
beforeAll(function () { });
beforeEach(function () { });
afterEach(function () { });
afterAll(function () { });
var timestamp = new Date().getTime();
var jpgName = timestamp + '.jpg';
......@@ -280,7 +280,7 @@ describe('mediaLibraryTestPromise.test.js', function () {
*/
it('SUB__MEDIA_MIDIALIBRARY_PROMISE_GETFILEASSETS_008', 0, async function (done) {
let fetchOp = {
selections: fileKeyObj.MEDIA_TYPE + 'abc= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + 'abc= ?',
selectionArgs: ['abc'],
};
try {
......@@ -305,7 +305,7 @@ describe('mediaLibraryTestPromise.test.js', function () {
*/
it('SUB__MEDIA_MIDIALIBRARY_PROMISE_GETFILEASSETS_009', 0, async function (done) {
let fetchOp = {
selections: fileKeyObj.MEDIA_TYPE + 'abc= ? or ' + fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + 'abc= ? or ' + mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: ['abc', audioType.toString()],
};
try {
......@@ -331,11 +331,11 @@ describe('mediaLibraryTestPromise.test.js', function () {
it('SUB__MEDIA_MIDIALIBRARY_PROMISE_GETFILEASSETS_010', 0, async function (done) {
let fetchOp = {
selections:
fileKeyObj.MEDIA_TYPE +
mediaLibrary.FileKey.MEDIA_TYPE +
'abc= ? or ' +
fileKeyObj.MEDIA_TYPE +
mediaLibrary.FileKey.MEDIA_TYPE +
'= ? or ' +
fileKeyObj.MEDIA_TYPE +
mediaLibrary.FileKey.MEDIA_TYPE +
'= ?',
selectionArgs: ['abc', videoType.toString(), fileType.toString()],
};
......@@ -362,13 +362,13 @@ describe('mediaLibraryTestPromise.test.js', function () {
it('SUB__MEDIA_MIDIALIBRARY_PROMISE_GETFILEASSETS_011', 0, async function (done) {
let fetchOp = {
selections:
fileKeyObj.MEDIA_TYPE +
mediaLibrary.FileKey.MEDIA_TYPE +
'abc= ? or ' +
fileKeyObj.MEDIA_TYPE +
mediaLibrary.FileKey.MEDIA_TYPE +
'= ? or ' +
fileKeyObj.MEDIA_TYPE +
mediaLibrary.FileKey.MEDIA_TYPE +
'= ? or ' +
fileKeyObj.MEDIA_TYPE +
mediaLibrary.FileKey.MEDIA_TYPE +
'= ?',
selectionArgs: ['abc', videoType.toString(), fileType.toString(), audioType.toString()],
};
......@@ -769,18 +769,18 @@ describe('mediaLibraryTestPromise.test.js', function () {
}
});
/**
* @tc.number : SUB__MEDIA_MIDIALIBRARY_PROMISE_CREATEASSET_001
* @tc.name : createAsset
* @tc.desc : Create File Asset image (does not exist)
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB__MEDIA_MIDIALIBRARY_PROMISE_CREATEASSET_009', 0, async function (done) {
/**
* @tc.number : SUB__MEDIA_MIDIALIBRARY_PROMISE_CREATEASSET_001
* @tc.name : createAsset
* @tc.desc : Create File Asset image (does not exist)
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB__MEDIA_MIDIALIBRARY_PROMISE_CREATEASSET_009', 0, async function (done) {
try {
const path = await media.getPublicDirectory(mediaLibrary.DirectoryType.DIR_IMAGE);
const filePath = path + "image/";
const filePath = path + "image/";
const fileAssets = await media.getFileAssets(videosfetchOp);
const dataList = await fileAssets.getAllObject();
const asset1 = dataList[0];
......
......@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import mediaLibrary from '@ohos.multimedia.medialibrary';
import mediaLibrary from '@ohos.multimedia.mediaLibrary';
import featureAbility from '@ohos.ability.featureAbility';
import fileio from '@ohos.fileio';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index';
......@@ -31,19 +31,19 @@ describe('mediaLibraryTestPromiseOnOff.test.js', async function () {
let fileType = mediaLibrary.MediaType.FILE;
let imagesfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [imageType.toString()],
};
let videosfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [videoType.toString()],
};
let audiosfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [audioType.toString()],
};
let filesfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs: [fileType.toString()],
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册