From: qunfang.lin Date: Thu, 18 Apr 2019 20:05:22 +0000 (+0800) Subject: [common][content][TWDAPI-203, attributes are marked as readonly] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f59e56ed456eda4881db7562513ba06a1d3836f2;p=test%2Ftct%2Fweb%2Fapi.git [common][content][TWDAPI-203, attributes are marked as readonly] -As Content.name/description/rating is changed to readonly, DOMString[] editableAttributes will be changed, only attribue isFavorite can be editable, so all the update() or updateBatch() need to be modified/deleted. Change-Id: I6fbff61d30cbb1edb52c211c087cb1c96d5bf39d Signed-off-by: qunfang.lin --- diff --git a/common/tct-content-tizen-tests/content/ContentChangeCallback_oncontentupdated.html b/common/tct-content-tizen-tests/content/ContentChangeCallback_oncontentupdated.html index dd004b532..c8e01f3f9 100755 --- a/common/tct-content-tizen-tests/content/ContentChangeCallback_oncontentupdated.html +++ b/common/tct-content-tizen-tests/content/ContentChangeCallback_oncontentupdated.html @@ -17,6 +17,7 @@ limitations under the License. Authors: Krzysztof Lachacz Xiaoyan Qian + Qunfang Lin --> @@ -40,7 +41,7 @@ Authors: setup({timeout: 30000}); var t = async_test(document.title, {timeout: 30000}), - changeCallback, testDescription = "TEST DESCRIPTION", onSuccess, onError, listenerId; + changeCallback, isFavorite, onSuccess, onError, listenerId; t.step(function () { //cleanup after TC @@ -53,7 +54,7 @@ t.step(function () { changeCallback = { oncontentupdated: t.step_func(function (content) { assert_type(content, "object", "content should be an object"); - assert_equals(content.description, testDescription, "description should be updated"); + assert_equals(content.isFavorite, isFavorite, "isFavorite should be updated"); check_content_object(content); t.done(); @@ -63,7 +64,8 @@ t.step(function () { onSuccess = t.step_func(function (contents) { assert_type(contents, "array", "contents should be an array"); assert_greater_than(contents.length, 0, "media item is not found"); - contents[0].description = testDescription; + isFavorite = !contents[0].isFavorite; + contents[0].isFavorite = isFavorite; tizen.content.update(contents[0]); }); onError = t.step_func(function (error) { diff --git a/common/tct-content-tizen-tests/content/ContentManager_update.html b/common/tct-content-tizen-tests/content/ContentManager_update.html index ced2278a3..b672c41d0 100755 --- a/common/tct-content-tizen-tests/content/ContentManager_update.html +++ b/common/tct-content-tizen-tests/content/ContentManager_update.html @@ -2,33 +2,34 @@ @@ -58,7 +59,7 @@ var t = async_test(document.title, {timeout: 30000}), setup_contents(t, t.step_func(function () { onSuccess = t.step_func(function (contents) { assert_equals(contents.length, 1, "updated media item should be found."); - assert_equals(contents[0].rating, expected, "rating should be updated."); + assert_equals(contents[0].isFavorite, expected, "isFavorite should be updated."); assert_equals(returnedValue, undefined, "update should return undefined."); t.done(); @@ -72,15 +73,15 @@ setup_contents(t, t.step_func(function () { assert_type(contents, "array", "contents should be an array"); assert_greater_than(contents.length, 0 , "Media item should be found."); for (i = 0; i < contents.length; i++) { - if (contents[i].editableAttributes.indexOf("rating") >= 0) { + if (contents[i].editableAttributes.indexOf("isFavorite") >= 0) { updated = contents[i]; break; } } - assert_not_equals(updated, null, "File with editable 'rating' attribute not found"); + assert_not_equals(updated, null, "File with editable 'isFavorite' attribute not found"); - expected = (updated.rating + 1) % 10; - updated.rating = expected; + expected = !updated.isFavorite; + updated.isFavorite = expected; returnedValue = tizen.content.update(updated); tizen.content.find(onSuccess, onError, null, new tizen.AttributeFilter("id", "EXACTLY", updated.id)); }); diff --git a/common/tct-content-tizen-tests/content/ContentManager_updateBatch.html b/common/tct-content-tizen-tests/content/ContentManager_updateBatch.html index ad1736866..582bc8eeb 100755 --- a/common/tct-content-tizen-tests/content/ContentManager_updateBatch.html +++ b/common/tct-content-tizen-tests/content/ContentManager_updateBatch.html @@ -2,33 +2,34 @@ @@ -61,8 +62,8 @@ setup_contents(t, t.step_func(function () { "updateBatch should return undefined."); assert_type(contents, "array", "contents should be an array"); assert_equals(contents.length, 2, "Media items after edit not found"); - assert_equals(contents[0].rating, expected[contents[0].id], "rating should be changed"); - assert_equals(contents[1].rating, expected[contents[1].id], "rating should be changed"); + assert_equals(contents[0].isFavorite, expected[contents[0].id], "isFavorite should be changed"); + assert_equals(contents[1].isFavorite, expected[contents[1].id], "isFavorite should be changed"); t.done(); }); @@ -79,18 +80,18 @@ setup_contents(t, t.step_func(function () { assert_type(contents, "array", "contents should be an array"); assert_greater_than(contents.length, 1, "Media item should be found."); for (i = 0; i < contents.length; i++) { - if (contents[i].editableAttributes.indexOf("rating") >= 0) { + if (contents[i].editableAttributes.indexOf("isFavorite") >= 0) { updated.push(contents[i]); } } assert_greater_than(contents.length, 1, - "At least two media items with editable 'rating' attribute are needed"); + "At least two media items with editable 'isFavorite' attribute are needed"); - updated[0].rating = (updated[0].rating + 1) % 10; - expected[updated[0].id] = updated[0].rating; + updated[0].isFavorite = !updated[0].isFavorite; + expected[updated[0].id] = updated[0].isFavorite; - updated[1].rating = (updated[1].rating + 1) % 10; - expected[updated[1].id] = updated[1].rating; + updated[1].isFavorite = !updated[1].isFavorite; + expected[updated[1].id] = updated[1].isFavorite; returnedValue = tizen.content.updateBatch(updated, function () { filter = new tizen.CompositeFilter("UNION", [ diff --git a/common/tct-content-tizen-tests/content/ContentManager_updateBatch_description.html b/common/tct-content-tizen-tests/content/ContentManager_updateBatch_description.html deleted file mode 100755 index 452307112..000000000 --- a/common/tct-content-tizen-tests/content/ContentManager_updateBatch_description.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - - -ContentManager_updateBatch_description - - - - - -
- - - diff --git a/common/tct-content-tizen-tests/content/ContentManager_updateBatch_errorCallback_invoked.html b/common/tct-content-tizen-tests/content/ContentManager_updateBatch_errorCallback_invoked.html deleted file mode 100755 index 85cf98b68..000000000 --- a/common/tct-content-tizen-tests/content/ContentManager_updateBatch_errorCallback_invoked.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - -ContentManager_updateBatch_errorCallback_invoked - - - - -
- - - \ No newline at end of file diff --git a/common/tct-content-tizen-tests/content/ContentManager_updateBatch_image_geolocation.html b/common/tct-content-tizen-tests/content/ContentManager_updateBatch_image_geolocation.html deleted file mode 100755 index d8af7c20f..000000000 --- a/common/tct-content-tizen-tests/content/ContentManager_updateBatch_image_geolocation.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - -ContentManager_updateBatch_image_geolocation - - - - - -
- - - diff --git a/common/tct-content-tizen-tests/content/ContentManager_updateBatch_image_orientation.html b/common/tct-content-tizen-tests/content/ContentManager_updateBatch_image_orientation.html deleted file mode 100755 index 2b482a266..000000000 --- a/common/tct-content-tizen-tests/content/ContentManager_updateBatch_image_orientation.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - -ContentManager_updateBatch_image_orientation - - - - - -
- - - diff --git a/common/tct-content-tizen-tests/content/ContentManager_updateBatch_name.html b/common/tct-content-tizen-tests/content/ContentManager_updateBatch_name.html deleted file mode 100755 index d6c6b598c..000000000 --- a/common/tct-content-tizen-tests/content/ContentManager_updateBatch_name.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - -ContentManager_updateBatch_name - - - - - -
- - - diff --git a/common/tct-content-tizen-tests/content/ContentManager_updateBatch_video_geolocation.html b/common/tct-content-tizen-tests/content/ContentManager_updateBatch_video_geolocation.html deleted file mode 100755 index edb67d5d5..000000000 --- a/common/tct-content-tizen-tests/content/ContentManager_updateBatch_video_geolocation.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - -ContentManager_updateBatch_video_geolocation - - - - - -
- - - diff --git a/common/tct-content-tizen-tests/content/ContentManager_updateBatch_with_errorCallback.html b/common/tct-content-tizen-tests/content/ContentManager_updateBatch_with_errorCallback.html index 4d8b4640f..ea5c5f802 100755 --- a/common/tct-content-tizen-tests/content/ContentManager_updateBatch_with_errorCallback.html +++ b/common/tct-content-tizen-tests/content/ContentManager_updateBatch_with_errorCallback.html @@ -16,6 +16,7 @@ limitations under the License. Authors: Krzysztof Lachacz + Qunfang Lin --> @@ -58,11 +59,7 @@ setup_contents(t, t.step_func(function () { assert_greater_than(contents.length, 0, "Media item should be found."); content = contents[0]; - if (content.editableAttributes.indexOf("rating") === 5) { - content.rating = 6; - } else { - content.rating = 5; - } + content.isFavorite = !content.isFavorite; returnedValue = tizen.content.updateBatch([content], updateBatchSuccess, updateBatchError); }); diff --git a/common/tct-content-tizen-tests/content/ContentManager_updateBatch_with_successCallback.html b/common/tct-content-tizen-tests/content/ContentManager_updateBatch_with_successCallback.html index be7324067..b73beebfa 100755 --- a/common/tct-content-tizen-tests/content/ContentManager_updateBatch_with_successCallback.html +++ b/common/tct-content-tizen-tests/content/ContentManager_updateBatch_with_successCallback.html @@ -16,6 +16,7 @@ limitations under the License. Authors: Krzysztof Lachacz + Qunfang Lin --> @@ -55,12 +56,8 @@ setup_contents(t, t.step_func(function () { for (i = 0; i < contents.length; i++) { content = contents[i]; - if (content.editableAttributes.indexOf("rating") >= 0) { - if (content.rating === 5) { - content.rating = 6; - } else { - content.rating = 5; - } + if (content.editableAttributes.indexOf("isFavorite") >= 0) { + content.isFavorite = !content.isFavorite; } } diff --git a/common/tct-content-tizen-tests/content/ContentManager_updateBatch_without_callback.html b/common/tct-content-tizen-tests/content/ContentManager_updateBatch_without_callback.html index 6db99d1c0..67e6a53d7 100755 --- a/common/tct-content-tizen-tests/content/ContentManager_updateBatch_without_callback.html +++ b/common/tct-content-tizen-tests/content/ContentManager_updateBatch_without_callback.html @@ -16,6 +16,7 @@ limitations under the License. Authors: Tomasz Kusmierz + Qunfang Lin --> @@ -51,10 +52,8 @@ setup_contents(t, t.step_func(function () { assert_greater_than(contents.length, 0, "Media item should be found."); content = contents[0]; - if (content.editableAttributes.indexOf("rating") === 5) { - content.rating = 6; - } else { - content.rating = 5; + if (content.editableAttributes.indexOf("isFavorite") >= 0) { + content.isFavorite = !content.isFavorite; } returnedValue = tizen.content.updateBatch([content]); diff --git a/common/tct-content-tizen-tests/content/ContentManager_update_content_invalid.html b/common/tct-content-tizen-tests/content/ContentManager_update_content_invalid.html deleted file mode 100755 index 6910a2579..000000000 --- a/common/tct-content-tizen-tests/content/ContentManager_update_content_invalid.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - -ContentManager_update_content_invalid - - - - -
- - - \ No newline at end of file diff --git a/common/tct-content-tizen-tests/content/ContentManager_update_description.html b/common/tct-content-tizen-tests/content/ContentManager_update_description.html deleted file mode 100755 index e905f0608..000000000 --- a/common/tct-content-tizen-tests/content/ContentManager_update_description.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - -ContentManager_update_description - - - - - -
- - - diff --git a/common/tct-content-tizen-tests/content/ContentManager_update_image_geolocation.html b/common/tct-content-tizen-tests/content/ContentManager_update_image_geolocation.html deleted file mode 100755 index d0416babc..000000000 --- a/common/tct-content-tizen-tests/content/ContentManager_update_image_geolocation.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - -ContentManager_update_image_geolocation - - - - - -
- - - diff --git a/common/tct-content-tizen-tests/content/ContentManager_update_image_orientation.html b/common/tct-content-tizen-tests/content/ContentManager_update_image_orientation.html deleted file mode 100755 index 670e49e30..000000000 --- a/common/tct-content-tizen-tests/content/ContentManager_update_image_orientation.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - -ContentManager_update_image_orientation - - - - - -
- - - diff --git a/common/tct-content-tizen-tests/content/ContentManager_update_name.html b/common/tct-content-tizen-tests/content/ContentManager_update_name.html deleted file mode 100755 index 75bf2677a..000000000 --- a/common/tct-content-tizen-tests/content/ContentManager_update_name.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - -ContentManager_update_name - - - - - -
- - - diff --git a/common/tct-content-tizen-tests/content/ContentManager_update_video_geolocation.html b/common/tct-content-tizen-tests/content/ContentManager_update_video_geolocation.html deleted file mode 100755 index 7ddc5b7fa..000000000 --- a/common/tct-content-tizen-tests/content/ContentManager_update_video_geolocation.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - -ContentManager_update_video_geolocation - - - - - -
- - - diff --git a/common/tct-content-tizen-tests/content/Content_isFavorite_attribute.html b/common/tct-content-tizen-tests/content/Content_isFavorite_attribute.html index 44af65319..04f5c7acb 100755 --- a/common/tct-content-tizen-tests/content/Content_isFavorite_attribute.html +++ b/common/tct-content-tizen-tests/content/Content_isFavorite_attribute.html @@ -51,7 +51,7 @@ setup_contents(t, t.step_func(function () { content = contents[0]; if (content.isFavorite !== null) { - check_attribute(content, "isFavorite", content.isFavorite, "boolean", true); + check_attribute(content, "isFavorite", content.isFavorite, "boolean", !content.isFavorite); content.isFavorite = null; assert_not_equals(content.isFavorite, null, "Content.isFavorite should not accept null as value."); } diff --git a/common/tct-content-tizen-tests/tests.full.xml b/common/tct-content-tizen-tests/tests.full.xml index 6e59f4c55..80f7fe518 100755 --- a/common/tct-content-tizen-tests/tests.full.xml +++ b/common/tct-content-tizen-tests/tests.full.xml @@ -123,30 +123,6 @@ - - - /opt/tct-content-tizen-tests/content/ContentManager_update_description.html - - - - - https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html - TBD - - - - - - /opt/tct-content-tizen-tests/content/ContentManager_updateBatch_description.html - - - - - https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html - TBD - - - /opt/tct-content-tizen-tests/content/Content_type_IMAGE.html @@ -1467,102 +1443,6 @@ - - - /opt/tct-content-tizen-tests/content/ContentManager_update_name.html - - - - - https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html - TBD - - - - - - /opt/tct-content-tizen-tests/content/ContentManager_update_video_geolocation.html - - - - - https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html - TBD - - - - - - /opt/tct-content-tizen-tests/content/ContentManager_update_image_geolocation.html - - - - - https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html - TBD - - - - - - /opt/tct-content-tizen-tests/content/ContentManager_update_image_orientation.html - - - - - https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html - TBD - - - - - - /opt/tct-content-tizen-tests/content/ContentManager_updateBatch_name.html - - - - - https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html - TBD - - - - - - /opt/tct-content-tizen-tests/content/ContentManager_updateBatch_video_geolocation.html - - - - - https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html - TBD - - - - - - /opt/tct-content-tizen-tests/content/ContentManager_updateBatch_image_geolocation.html - - - - - https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html - TBD - - - - - - /opt/tct-content-tizen-tests/content/ContentManager_updateBatch_image_orientation.html - - - - - https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html - TBD - - - /opt/tct-content-tizen-tests/content/ContentManager_addChangeListener.html @@ -1707,30 +1587,6 @@ - /opt/tct-content-tizen-tests/content/ContentManager_createPlaylist_exist.html @@ -3135,7 +2991,7 @@ - + /opt/tct-content-tizen-tests/content/ContentManager_createThumbnail_exist.html diff --git a/common/tct-content-tizen-tests/tests.xml b/common/tct-content-tizen-tests/tests.xml index 2341c127c..ea023b424 100755 --- a/common/tct-content-tizen-tests/tests.xml +++ b/common/tct-content-tizen-tests/tests.xml @@ -53,16 +53,6 @@ /opt/tct-content-tizen-tests/content/Content_type_AUDIO.html - - - /opt/tct-content-tizen-tests/content/ContentManager_update_description.html - - - - - /opt/tct-content-tizen-tests/content/ContentManager_updateBatch_description.html - - /opt/tct-content-tizen-tests/content/Content_type_IMAGE.html @@ -613,46 +603,6 @@ /opt/tct-content-tizen-tests/content/ContentDirectory_modifiedDate_attribute.html - - - /opt/tct-content-tizen-tests/content/ContentManager_update_name.html - - - - - /opt/tct-content-tizen-tests/content/ContentManager_update_video_geolocation.html - - - - - /opt/tct-content-tizen-tests/content/ContentManager_update_image_geolocation.html - - - - - /opt/tct-content-tizen-tests/content/ContentManager_update_image_orientation.html - - - - - /opt/tct-content-tizen-tests/content/ContentManager_updateBatch_name.html - - - - - /opt/tct-content-tizen-tests/content/ContentManager_updateBatch_video_geolocation.html - - - - - /opt/tct-content-tizen-tests/content/ContentManager_updateBatch_image_geolocation.html - - - - - /opt/tct-content-tizen-tests/content/ContentManager_updateBatch_image_orientation.html - - /opt/tct-content-tizen-tests/content/ContentManager_addChangeListener.html @@ -713,16 +663,6 @@ /opt/tct-content-tizen-tests/content/Content_in_tizen.html - - /opt/tct-content-tizen-tests/content/ContentManager_createPlaylist_exist.html