提交 dde8844b 编写于 作者: Q qinliwen

<修改medialibrary xts,适配HOS>

Signed-off-by: Nqinliwen <qinliwen3@huawei.com>
上级 9d65ccd0
...@@ -467,9 +467,9 @@ describe('fetchFileResultCallback.test.js', async function() { ...@@ -467,9 +467,9 @@ describe('fetchFileResultCallback.test.js', async function() {
console.info('MediaLibraryTest :firstObject.uri === undefined'); console.info('MediaLibraryTest :firstObject.uri === undefined');
} }
expect(firstObject.mimeType == 'image/*').assertTrue(); expect(firstObject.mimeType.startsWith('image/')).assertTrue();
if (firstObject.mimeType != 'image/*') { if (!firstObject.mimeType.startsWith('image/')) {
console.info('MediaLibraryTest :firstObject.mimeType:' + firstObject.mimeType); console.info('Test MediaLibraryTest :firstObject.mimeType:' + firstObject.mimeType);
} }
expect(firstObject.mediaType == imageType).assertTrue(); expect(firstObject.mediaType == imageType).assertTrue();
......
...@@ -579,9 +579,9 @@ describe('fetchFileResultPromise.test.js', async function() { ...@@ -579,9 +579,9 @@ describe('fetchFileResultPromise.test.js', async function() {
console.info('MediaLibraryTest :firstObject.uri === undefined'); console.info('MediaLibraryTest :firstObject.uri === undefined');
} }
expect(firstObject.mimeType == 'image/*').assertTrue(); expect(firstObject.mimeType.startsWith('image/')).assertTrue();
if (firstObject.mimeType != 'image/*') { if (!firstObject.mimeType.startsWith('image/')) {
console.info('MediaLibraryTest :firstObject.mimeType:' + firstObject.mimeType); console.info('Test MediaLibraryTest :firstObject.mimeType:' + firstObject.mimeType);
} }
expect(firstObject.mediaType == imageType).assertTrue(); expect(firstObject.mediaType == imageType).assertTrue();
......
...@@ -83,7 +83,7 @@ describe('fileAsset2.test.js', async function () { ...@@ -83,7 +83,7 @@ describe('fileAsset2.test.js', async function () {
try { try {
const fetchFileResult = await media.getFileAssets(imagesfetchOp); const fetchFileResult = await media.getFileAssets(imagesfetchOp);
const asset = await fetchFileResult.getFirstObject(); const asset = await fetchFileResult.getFirstObject();
const newName = 'newName'; const newName = 'newName' + new Date().getTime() + '.jpg';
asset.displayName = newName; asset.displayName = newName;
const id = asset.id; const id = asset.id;
await asset.commitModify(); await asset.commitModify();
...@@ -200,8 +200,8 @@ describe('fileAsset2.test.js', async function () { ...@@ -200,8 +200,8 @@ describe('fileAsset2.test.js', async function () {
try { try {
const fetchFileResult = await media.getFileAssets(imagesfetchOp); const fetchFileResult = await media.getFileAssets(imagesfetchOp);
const asset = await fetchFileResult.getFirstObject(); const asset = await fetchFileResult.getFirstObject();
let neworientation = 1; let neworientation = 90;
if (asset.orientation == 1) { if (asset.orientation == 90) {
neworientation = 0; neworientation = 0;
} }
asset.orientation = neworientation; asset.orientation = neworientation;
......
...@@ -83,7 +83,7 @@ describe('fileAssetCallBack2.test.js', async function () { ...@@ -83,7 +83,7 @@ describe('fileAssetCallBack2.test.js', async function () {
try { try {
const fetchFileResult = await media.getFileAssets(imagesfetchOp); const fetchFileResult = await media.getFileAssets(imagesfetchOp);
const asset = await fetchFileResult.getFirstObject(); const asset = await fetchFileResult.getFirstObject();
const newName = 'newName'; const newName = 'newName' + new Date().getTime() + '.jpg';
asset.displayName = newName; asset.displayName = newName;
const id = asset.id; const id = asset.id;
asset.commitModify(async () => { asset.commitModify(async () => {
...@@ -202,8 +202,8 @@ describe('fileAssetCallBack2.test.js', async function () { ...@@ -202,8 +202,8 @@ describe('fileAssetCallBack2.test.js', async function () {
try { try {
const fetchFileResult = await media.getFileAssets(imagesfetchOp); const fetchFileResult = await media.getFileAssets(imagesfetchOp);
const asset = await fetchFileResult.getFirstObject(); const asset = await fetchFileResult.getFirstObject();
let neworientation = 1; let neworientation = 90;
if (asset.orientation == 1) { if (asset.orientation == 90) {
neworientation = 0; neworientation = 0;
} }
asset.orientation = neworientation; asset.orientation = neworientation;
......
...@@ -83,7 +83,7 @@ describe('fileAssetPromise2.test.js', async function () { ...@@ -83,7 +83,7 @@ describe('fileAssetPromise2.test.js', async function () {
try { try {
const fetchFileResult = await media.getFileAssets(imagesfetchOp); const fetchFileResult = await media.getFileAssets(imagesfetchOp);
const asset = await fetchFileResult.getFirstObject(); const asset = await fetchFileResult.getFirstObject();
const newName = 'newName'; const newName = 'newName' + new Date().getTime() + '.jpg';
asset.displayName = newName; asset.displayName = newName;
const id = asset.id; const id = asset.id;
await asset.commitModify(); await asset.commitModify();
...@@ -200,8 +200,8 @@ describe('fileAssetPromise2.test.js', async function () { ...@@ -200,8 +200,8 @@ describe('fileAssetPromise2.test.js', async function () {
try { try {
const fetchFileResult = await media.getFileAssets(imagesfetchOp); const fetchFileResult = await media.getFileAssets(imagesfetchOp);
const asset = await fetchFileResult.getFirstObject(); const asset = await fetchFileResult.getFirstObject();
let neworientation = 1; let neworientation = 90;
if (asset.orientation == 1) { if (asset.orientation == 90) {
neworientation = 0; neworientation = 0;
} }
asset.orientation = neworientation; asset.orientation = neworientation;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册