Authors:
Krzysztof Lachacz <k.lachacz@samsung.com>
Xiaoyan Qian <xy.qian@samsung.com>
+ Qunfang Lin <qunfang.lin@samsung.com>
-->
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
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();
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) {
<!--
Copyright (c) 2012 Intel Corporation.
-Redistribution and use in source and binary forms, with or without modification,
+Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
-* Redistributions of works must retain the original copyright notice, this list
+* Redistributions of works must retain the original copyright notice, this list
of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the original copyright notice,
- this list of conditions and the following disclaimer in the documentation
+* Redistributions in binary form must reproduce the original copyright notice,
+ this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
-* Neither the name of Intel Corporation nor the names of its contributors
- may be used to endorse or promote products derived from this work without
+* Neither the name of Intel Corporation nor the names of its contributors
+ may be used to endorse or promote products derived from this work without
specific prior written permission.
-THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Authors:
Guan, JingX <jingx.guan@intel.com>
Jakub Siewierski <j.siewierski@samsung.com>
Krzysztof Lachacz <k.lachacz@samsung.com>
+ Qunfang Lin <qunfang.lin@samsung.com>
-->
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();
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));
});
<!--
Copyright (c) 2012 Intel Corporation.
-Redistribution and use in source and binary forms, with or without modification,
+Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
-* Redistributions of works must retain the original copyright notice, this list
+* Redistributions of works must retain the original copyright notice, this list
of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the original copyright notice,
- this list of conditions and the following disclaimer in the documentation
+* Redistributions in binary form must reproduce the original copyright notice,
+ this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
-* Neither the name of Intel Corporation nor the names of its contributors
- may be used to endorse or promote products derived from this work without
+* Neither the name of Intel Corporation nor the names of its contributors
+ may be used to endorse or promote products derived from this work without
specific prior written permission.
-THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Authors:
Guan, JingX <jingx.guan@intel.com>
Jakub Siewierski <j.siewierski@samsung.com>
Krzysztof Lachacz <k.lachacz@samsung.com>
+ Qunfang Lin <qunfang.lin@samsung.com>
-->
"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();
});
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", [
+++ /dev/null
-<!DOCTYPE html>
-<!--
-Copyright (c) 2012 Intel Corporation.
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
-* Redistributions of works must retain the original copyright notice, this list
- of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the original copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of Intel Corporation nor the names of its contributors
- may be used to endorse or promote products derived from this work without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-Authors:
- Ma, YueX <yuex.ma@intel.com>
- Krzysztof Lachacz <k.lachacz@samsung.com>
-
--->
-
-<html>
-<head>
-<title>ContentManager_updateBatch_description</title>
-<script src="support/unitcommon.js"></script>
-<script src="support/content_common.js"></script>
-</head>
-
-<body>
-<div id="log"></div>
-<script type="text/javascript">
-//==== TEST: ContentManager_updateBatch_description
-//==== LABEL Check if updateBatch() method updates properly description of found content
-//==== PRIORITY P1
-//==== ONLOAD_DELAY 30
-//==== SPEC Tizen Web API:Content:Content:ContentManager:updateBatch M
-//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html
-//==== TEST_CRITERIA MAST MOA
-
-setup({timeout: 30000});
-
-var t = async_test(document.title, {timeout: 30000}),
- successCallback, errorCallback, onSuccess, onError, successCB,
- expected = Math.random().toFixed(10),
- desFilter = new tizen.AttributeFilter("description", "EXACTLY", expected),
- findFilter = new tizen.AttributeFilter("type", "EXACTLY", "IMAGE"),
- compFilter = new tizen.CompositeFilter("INTERSECTION", [findFilter, desFilter]),
- updated = [], i;
-
-setup_contents(t, t.step_func(function () {
-
- successCB = t.step_func(function (contents) {
- assert_type(contents, "array", "contents should be an array");
- assert_equals(contents.length, 1, "Media item should be found.");
- assert_equals(contents[0].description, expected, "update contents description");
- t.done();
- });
-
- onSuccess = t.step_func(function () {
- tizen.content.find(successCB, errorCallback, null, compFilter);
- });
- onError = t.step_func(function (error) {
- assert_unreached("updateBatch() error callback was invoked: " + error.name + " msg: " + error.message);
- });
-
- successCallback = t.step_func(function (contents) {
- 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("description") >= 0) {
- contents[i].description = expected;
- updated.push(contents[i]);
- break;
- }
- }
-
- if (updated.length === 0) {
- assert_unreached("File does not contain editable 'description' attribute");
- }
-
- tizen.content.updateBatch(updated, onSuccess, onError);
- });
- errorCallback = t.step_func(function (error) {
- assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);
- });
-
- tizen.content.find(successCallback, errorCallback, null, findFilter);
-}));
-
-</script>
-</body>
-</html>
+++ /dev/null
-<!DOCTYPE html>
-<!--
-Copyright (c) 2014 Samsung Electronics Co., Ltd.
-
-Licensed under the Apache License, Version 2.0 (the License);
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-Authors:
- Zhang Wei<wei625.zhang@samsung.com>
-
--->
-
-<html>
-<head>
-<title>ContentManager_updateBatch_errorCallback_invoked</title>
-<script src="support/unitcommon.js"></script>
-<script src="support/content_common.js"></script>
-</head>
-<body>
-<div id="log"></div>
-<script>
-//==== TEST: ContentManager_updateBatch_errorCallback_invoked
-//==== LABEL Check exception in error callback of updateBatch() method
-//==== ONLOAD_DELAY 30
-//==== SPEC Tizen Web API:Content:Content:ContentManager:updateBatch M
-//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html
-//==== PRIORITY P2
-//==== TEST_CRITERIA MERRCB
-
-setup({timeout: 30000});
-
-var t = async_test(document.title, {timeout: 30000}), updated = [], expected = {}, i, updateSuccess, updateError, findSuccess, findError;
-
-setup_contents(t, t.step_func(function () {
- updateError = t.step_func(function (error) {
- t.done();
- });
-
- updateSuccess = t.step_func(function () {
- assert_unreached("updateBatch() success callback should not be invoked");
- });
-
- findSuccess = t.step_func(function (contents) {
- 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) {
- updated.push(contents[i]);
- }
- }
- assert_greater_than(contents.length, 1,
- "At least two media items with editable 'rating' attribute are needed");
- updated[0].rating = 15;
- expected[updated[0].id] = updated[0].rating;
-
- updated[1].rating = -1;
- expected[updated[1].id] = updated[1].rating;
- tizen.content.updateBatch(updated, updateSuccess, updateError);
- });
-
- findError = t.step_func(function (error) {
- assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);
- });
-
- tizen.content.find(findSuccess, findError);
-}));
-
-</script>
-</body>
-</html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html>
-<!--
-Copyright (c) 2013 Samsung Electronics Co., Ltd.
-
-Licensed under the Apache License, Version 2.0 (the License);
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-
-Authors:
- Tomasz Kusmierz <t.kusmierz@samsung.com>
-
--->
-
-<html>
-<head>
-<title>ContentManager_updateBatch_image_geolocation</title>
-<script src="support/unitcommon.js"></script>
-<script src="support/content_common.js"></script>
-</head>
-
-<body>
-<div id="log"></div>
-<script type="text/javascript">
-//==== TEST: ContentManager_updateBatch_image_geolocation
-//==== LABEL Check if updateBatch() properly updates geolocation attributes of multiple image items
-//==== ONLOAD_DELAY 30
-//==== SPEC Tizen Web API:Content:Content:ContentManager:updateBatch M
-//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html
-//==== PRIORITY P1
-//==== TEST_CRITERIA MAST MOA
-setup({timeout: 30000});
-
-var t = async_test(document.title, {timeout: 30000}), updated = [], expected = {}, i, findAfterEditSuccess,
- findAfterEditError, updateError, findSuccess, findError, typeFilter, filter;
-
-setup_contents(t, t.step_func(function () {
- findAfterEditSuccess = t.step_func(function (contents) {
- assert_type(contents, "array", "contents should be an array");
- assert_equals(contents.length, 2, "Media items after edit should be found.");
-
- assert_equals(contents[0].geolocation.latitude, expected[contents[0].id].latitude, "latitude should be changed");
- assert_equals(contents[0].geolocation.longitude, expected[contents[0].id].longitude, "longitude should be changed");
- assert_equals(contents[1].geolocation.latitude, expected[contents[1].id].latitude, "latitude should be changed");
- assert_equals(contents[1].geolocation.longitude, expected[contents[1].id].longitude, "longitude should be changed");
- t.done();
- });
-
- findAfterEditError = t.step_func(function (error) {
- assert_unreached("find() (after updateBatch()) error callback invoked: " + error.name + ", message: " + error.message);
- });
-
- updateError = t.step_func(function (error) {
- assert_unreached("updateBatch() error callback invoked: " + error.name + ", message: " + error.message);
- });
-
- findSuccess = t.step_func(function (contents) {
- assert_type(contents, "array", "contents should be an array");
- assert_greater_than(contents.length, 1, "At least two images should be found.");
-
- for (i = 0; i < contents.length; i++) {
- if (contents[i].editableAttributes.indexOf("geolocation") >= 0) {
- updated.push(contents[i]);
- }
- }
- assert_greater_than(contents.length, 1, "At least two images with editable 'geolocation' attribute are needed");
-
- if (updated[0].geolocation !== null) {
- if (updated[0].geolocation.latitude === 5) {
- updated[0].geolocation.latitude = 6;
- } else {
- updated[0].geolocation.latitude = 5;
- }
- if (updated[0].geolocation.longitude === 5) {
- updated[0].geolocation.longitude = 6;
- } else {
- updated[0].geolocation.longitude = 5;
- }
- } else {
- updated[0].geolocation = new tizen.SimpleCoordinates(5.555, 5.55555);
- }
- expected[updated[0].id] = updated[0].geolocation;
-
- if (updated[1].geolocation !== null) {
- if (contents[1].geolocation.latitude === 5) {
- contents[1].geolocation.latitude = 6;
- } else {
- contents[1].geolocation.latitude = 5;
- }
- if (contents[1].geolocation.longitude === 5) {
- contents[1].geolocation.longitude = 6;
- } else {
- contents[1].geolocation.longitude = 5;
- }
- } else {
- updated[1].geolocation = new tizen.SimpleCoordinates(5.555, 5.555);
- }
- expected[updated[1].id] = updated[1].geolocation;
-
- tizen.content.updateBatch(updated, function () {
- filter = new tizen.CompositeFilter("UNION", [
- new tizen.AttributeFilter("id", "EXACTLY", updated[0].id),
- new tizen.AttributeFilter("id", "EXACTLY", updated[1].id)
- ]);
-
- tizen.content.find(findAfterEditSuccess, findAfterEditError, null, filter);
- }, updateError);
- });
- findError = t.step_func(function (error) {
- assert_unreached("find() error callback invoked: " + error.name + ", message: " + error.message);
- });
-
- typeFilter = new tizen.AttributeFilter("type", "EXACTLY", "IMAGE");
- tizen.content.find(findSuccess, findError, null, typeFilter);
-}));
-
-</script>
-</body>
-</html>
+++ /dev/null
-<!DOCTYPE html>
-<!--
-Copyright (c) 2013 Samsung Electronics Co., Ltd.
-
-Licensed under the Apache License, Version 2.0 (the License);
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-
-Authors:
- Tomasz Kusmierz <t.kusmierz@samsung.com>
-
--->
-
-<html>
-<head>
-<title>ContentManager_updateBatch_image_orientation</title>
-<script src="support/unitcommon.js"></script>
-<script src="support/content_common.js"></script>
-</head>
-
-<body>
-<div id="log"></div>
-<script type="text/javascript">
-//==== TEST: ContentManager_updateBatch_image_orientation
-//==== LABEL Check if updateBatch() properly updates orientation attributes of multiple image items
-//==== ONLOAD_DELAY 30
-//==== SPEC Tizen Web API:Content:Content:ContentManager:updateBatch M
-//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html
-//==== PRIORITY P1
-//==== TEST_CRITERIA MAST MOA
-setup({timeout: 30000});
-
-var t = async_test(document.title, {timeout: 30000}), updated = [], expected = {}, i, findAfterEditSuccess,
- findAfterEditError, updateError, findSuccess, findError, filter;
-
-setup_contents(t, t.step_func(function () {
-
- findAfterEditSuccess = t.step_func(function (contents) {
- assert_type(contents, "array", "contents should be an array");
- assert_equals(contents.length, 2, "Media items after edit should br found");
- assert_equals(contents[0].orientation, expected[contents[0].id], "orientation should be changed");
- assert_equals(contents[1].orientation, expected[contents[1].id ], "orientation should be changed");
- t.done();
- });
-
- findAfterEditError = t.step_func(function (error) {
- assert_unreached("find() (after updateBatch()) error callback invoked: " + error.name + ", message: " + error.message);
- });
-
- updateError = t.step_func(function (error) {
- assert_unreached("updateBatch() error callback invoked: " + error.name + ", message: " + error.message);
- });
-
- findSuccess = t.step_func(function (contents) {
- assert_type(contents, "array", "contents should be an array");
- assert_greater_than(contents.length, 1, "At least two images should be found.");
- for (i = 0; i < contents.length; i++) {
- if (contents[i].editableAttributes.indexOf("orientation") >= 0) {
- updated.push(contents[i]);
- }
- }
-
- assert_greater_than(contents.length, 1,
- "At least two media items with editable 'orientation' attribute are needed");
-
- if (updated[0].orientation === "NORMAL") {
- updated[0].orientation = "FLIP_HORIZONTAL";
- } else {
- updated[0].orientation = "NORMAL";
- }
- expected[updated[0].id] = updated[0].orientation;
-
- if (updated[1].orientation === "NORMAL") {
- updated[1].orientation = "FLIP_HORIZONTAL";
- } else {
- updated[1].orientation = "NORMAL";
- }
- expected[updated[1].id] = updated[1].orientation;
-
- tizen.content.updateBatch(updated, function () {
- filter = new tizen.CompositeFilter("UNION", [
- new tizen.AttributeFilter("id", "EXACTLY", updated[0].id),
- new tizen.AttributeFilter("id", "EXACTLY", updated[1].id)
- ]);
-
- tizen.content.find(findAfterEditSuccess, findAfterEditError, null, filter);
- }, updateError);
- });
-
- findError = t.step_func(function (error) {
- assert_unreached("find() error callback invoked: " + error.name + ", message: " + error.message);
- });
-
- tizen.content.find(findSuccess, findError);
-}));
-
-</script>
-</body>
-</html>
+++ /dev/null
-<!DOCTYPE html>
-<!--
-Copyright (c) 2013 Samsung Electronics Co., Ltd.
-
-Licensed under the Apache License, Version 2.0 (the License);
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-
-Authors:
- Tomasz Kusmierz <t.kusmierz@samsung.com>
-
--->
-
-<html>
-<head>
-<title>ContentManager_updateBatch_name</title>
-<script src="support/unitcommon.js"></script>
-<script src="support/content_common.js"></script>
-</head>
-
-<body>
-<div id="log"></div>
-<script type="text/javascript">
-//==== TEST: ContentManager_updateBatch_name
-//==== LABEL Check if updateBatch() properly updates name attributes of multiple image items
-//==== ONLOAD_DELAY 30
-//==== SPEC Tizen Web API:Content:Content:ContentManager:updateBatch M
-//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html
-//==== PRIORITY P1
-//==== TEST_CRITERIA MAST MOA
-setup({timeout: 30000});
-
-var t = async_test(document.title, {timeout: 30000}), updated = [], expected = {}, i, findAfterEditSuccess,
- findAfterEditError, updateError, findSuccess, findError, filter;
-
-setup_contents(t, t.step_func(function () {
- findAfterEditSuccess = t.step_func(function (contents) {
- assert_type(contents, "array", "contents should be an array");
- assert_equals(contents.length, 2, "Media items after edit not found");
- assert_equals(contents[0].name, expected[contents[0].id], "name should be changed");
- assert_equals(contents[1].name, expected[contents[1].id ], "name should be changed");
- t.done();
- });
-
- findAfterEditError = t.step_func(function (error) {
- assert_unreached("find() (after updateBatch()) error callback invoked: " + error.name + ", message: " + error.message);
- });
-
- updateError = t.step_func(function (error) {
- assert_unreached("updateBatch() error callback invoked: " + error.name + ", message: " + error.message);
- });
-
- findSuccess = t.step_func(function (contents) {
- assert_type(contents, "array", "contents should be an array");
- assert_greater_than(contents.length, 1, "At least two media items are needed");
-
- for (i = 0; i < contents.length; i++) {
- if (contents[i].editableAttributes.indexOf("name") >= 0) {
- updated.push(contents[i]);
- }
- }
-
- assert_greater_than(contents.length, 1,
- "At least two media items with editable 'name' attribute are needed");
-
- updated[0].name += "update";
- expected[updated[0].id] = updated[0].name;
-
- updated[1].name += "update";
- expected[updated[1].id] = updated[1].name;
-
- tizen.content.updateBatch(updated, function () {
- filter = new tizen.CompositeFilter("UNION", [
- new tizen.AttributeFilter("id", "EXACTLY", updated[0].id),
- new tizen.AttributeFilter("id", "EXACTLY", updated[1].id)
- ]);
-
- tizen.content.find(findAfterEditSuccess, findAfterEditError, null, filter);
- }, updateError);
- });
-
- findError = t.step_func(function (error) {
- assert_unreached("find() error callback invoked: " + error.name + ", message: " + error.message);
- });
-
- tizen.content.find(findSuccess, findError);
-}));
-
-</script>
-</body>
-</html>
+++ /dev/null
-<!DOCTYPE html>
-<!--
-Copyright (c) 2013 Samsung Electronics Co., Ltd.
-
-Licensed under the Apache License, Version 2.0 (the License);
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-
-Authors:
- Tomasz Kusmierz <t.kusmierz@samsung.com>
-
--->
-
-<html>
-<head>
-<title>ContentManager_updateBatch_video_geolocation</title>
-<script src="support/unitcommon.js"></script>
-<script src="support/content_common.js"></script>
-</head>
-
-<body>
-<div id="log"></div>
-<script type="text/javascript">
-//==== TEST: ContentManager_updateBatch_video_geolocation
-//==== LABEL Check if updateBatch() properly updates name attributes of multiple video items
-//==== ONLOAD_DELAY 30
-//==== SPEC Tizen Web API:Content:Content:ContentManager:updateBatch M
-//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html
-//==== PRIORITY P1
-//==== TEST_CRITERIA MAST MOA
-setup({timeout: 30000});
-
-var t = async_test(document.title, {timeout: 30000}), updated = [], expected = {}, i, findAfterEditSuccess,
- findAfterEditError, updateError, findSuccess, findError, typeFilter, filter;
-
-setup_contents(t, t.step_func(function () {
- findAfterEditSuccess = t.step_func(function (contents) {
- assert_type(contents, "array", "contents should be an array");
- assert_equals(contents.length, 1, "Media item after edit should be found");
-
- assert_equals(contents[0].geolocation.latitude, expected[contents[0].id].latitude, "latitude should be changed");
- assert_equals(contents[0].geolocation.longitude, expected[contents[0].id].longitude, "longitude should be changed");
-
- t.done();
- });
-
- findAfterEditError = t.step_func(function (error) {
- assert_unreached("find() (after updateBatch()) error callback invoked: " + error.name + ", message: " + error.message);
- });
-
- updateError = t.step_func(function (error) {
- assert_unreached("updateBatch() error callback invoked: " + error.name + ", message: " + error.message);
- });
-
- findSuccess = t.step_func(function (contents) {
- assert_type(contents, "array", "contents should be an array");
- assert_greater_than(contents.length, 0, "At least one media items is needed");
-
- for (i = 0; i < contents.length; i++) {
- if (contents[i].editableAttributes.indexOf("geolocation") >= 0) {
- updated.push(contents[i]);
- break;
- }
- }
- assert_greater_than(contents.length, 0, "At least one media item with editable 'geolocation' attribute is needed");
-
- if (updated[0].geolocation !== null) {
- if (updated[0].geolocation.latitude === 5) {
- updated[0].geolocation.latitude = 6;
- } else {
- updated[0].geolocation.latitude = 5;
- }
- if (updated[0].geolocation.longitude === 5) {
- updated[0].geolocation.longitude = 6;
- } else {
- updated[0].geolocation.longitude = 5;
- }
- } else {
- updated[0].geolocation = new tizen.SimpleCoordinates(5.555, 5.555);
- }
- expected[updated[0].id] = updated[0].geolocation;
-
- tizen.content.updateBatch(updated, function () {
- filter = new tizen.AttributeFilter("id", "EXACTLY", updated[0].id);
- tizen.content.find(findAfterEditSuccess, findAfterEditError, null, filter);
- }, updateError);
- });
-
- findError = t.step_func(function (error) {
- assert_unreached("find() error callback invoked: " + error.name + ", message: " + error.message);
- });
-
- typeFilter = new tizen.AttributeFilter("type", "EXACTLY", "VIDEO");
- tizen.content.find(findSuccess, findError, null, typeFilter);
-}));
-
-</script>
-</body>
-</html>
Authors:
Krzysztof Lachacz <k.lachacz@samsung.com>
+ Qunfang Lin <qunfang.lin@samsung.com>
-->
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);
});
Authors:
Krzysztof Lachacz <k.lachacz@samsung.com>
+ Qunfang Lin <qunfang.lin@samsung.com>
-->
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;
}
}
Authors:
Tomasz Kusmierz <t.kusmierz@samsung.com>
+ Qunfang Lin <qunfang.lin@samsung.com>
-->
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]);
+++ /dev/null
-<!DOCTYPE html>
-<!--
-Copyright (c) 2014 Samsung Electronics Co., Ltd.
-
-Licensed under the Apache License, Version 2.0 (the License);
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-Authors:
- Zhang Wei<wei625.zhang@samsung.com>
-
--->
-
-<html>
-<head>
-<title>ContentManager_update_content_invalid</title>
-<script src="support/unitcommon.js"></script>
-<script src="support/content_common.js"></script>
-</head>
-<body>
-<div id="log"></div>
-<script type="text/javascript">
-//==== TEST: ContentManager_update_content_invalid
-//==== LABEL Check if update throws exception when content is invalid
-//==== ONLOAD_DELAY 30
-//==== SPEC Tizen Web API:Content:Content:ContentManager:update M
-//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html
-//==== PRIORITY P2
-//==== TEST_CRITERIA MC
-
-setup({timeout: 30000});
-
-var t = async_test(document.title, {timeout: 30000}), updated = null, successCallback, errorCallback, i;
-
-setup_contents(t, t.step_func(function () {
- successCallback = t.step_func(function (contents) {
- 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) {
- updated = contents[i];
- break;
- }
- }
- assert_not_equals(updated, null, "File with editable 'rating' attribute not found");
- updated.rating = 15;
- assert_throws(INVALID_VALUES_EXCEPTION,
- function () {
- tizen.content.update(updated);
- }, "update() invoked with incorrect content.");
- t.done();
- });
-
- errorCallback = t.step_func(function (error) {
- assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);
- });
-
- tizen.content.find(successCallback, errorCallback, null);
-}));
-
-</script>
-</body>
-</html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html>
-<!--
-Copyright (c) 2012 Intel Corporation.
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
-* Redistributions of works must retain the original copyright notice, this list
- of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the original copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of Intel Corporation nor the names of its contributors
- may be used to endorse or promote products derived from this work without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-Authors:
- Ma, YueX <yuex.ma@intel.com>
- Krzysztof Lachacz <k.lachacz@samsung.com>
-
--->
-
-<html>
-<head>
-<title>ContentManager_update_description</title>
-<script src="support/unitcommon.js"></script>
-<script src="support/content_common.js"></script>
-</head>
-
-<body>
-<div id="log"></div>
-<script type="text/javascript">
-//==== TEST: ContentManager_update_description
-//==== LABEL Check if update() properly updates description attribute of first found item
-//==== PRIORITY P1
-//==== ONLOAD_DELAY 30
-//==== SPEC Tizen Web API:Content:Content:ContentManager:update M
-//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html
-//==== TEST_CRITERIA MAST MMINA
-
-setup({timeout: 30000});
-
-var t = async_test(document.title, {timeout: 30000}),
- successCallback, errorCallback, onSuccess,
- expected = Math.random().toFixed(10),
- filter = new tizen.AttributeFilter("description", "EXACTLY", expected),
- typeFilter = new tizen.AttributeFilter("type", "EXACTLY", "IMAGE"),
- updated = null, i;
-
-setup_contents(t, t.step_func(function () {
- successCallback = t.step_func(function (contents) {
- 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("description") >= 0) {
- contents[i].description = expected;
- updated = contents[i];
- }
- }
-
- if (updated === null) {
- assert_unreached("Files do not contain editable 'description' attribute");
- }
-
- updated.description = expected;
- tizen.content.update(updated);
- tizen.content.find(onSuccess, errorCallback, null, filter);
- });
-
- errorCallback = t.step_func(function (error) {
- assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);
- });
-
- onSuccess = t.step_func(function (contents) {
- assert_type(contents, "array", "contents should be an array");
- assert_greater_than(contents.length, 0, "Media item should be found.");
- assert_equals(contents[0].description, expected, "update content description");
- t.done();
- });
-
- tizen.content.find(successCallback, errorCallback, null, typeFilter);
-}));
-
-</script>
-</body>
-</html>
+++ /dev/null
-<!DOCTYPE html>
-<!--
-Copyright (c) 2013 Samsung Electronics Co., Ltd.
-
-Licensed under the Apache License, Version 2.0 (the License);
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-
-Authors:
- Tomasz Kusmierz <t.kusmierz@samsung.com>
-
--->
-
-<html>
-<head>
-<title>ContentManager_update_image_geolocation</title>
-<script src="support/unitcommon.js"></script>
-<script src="support/content_common.js"></script>
-</head>
-
-<body>
-<div id="log"></div>
-<script type="text/javascript">
-//==== TEST: ContentManager_update_image_geolocation
-//==== LABEL Check if update() properly updates geolocation attribute of first found image item
-//==== PRIORITY P1
-//==== ONLOAD_DELAY 30
-//==== SPEC Tizen Web API:Content:Content:ContentManager:update M
-//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html
-//==== TEST_CRITERIA MAST MMINA
-
-setup({timeout: 30000});
-
-var t = async_test(document.title, {timeout: 30000}),
- successCallback, errorCallback, onSuccess, expected, updated = null, i,
- filter, typeFilter = new tizen.AttributeFilter("type", "EXACTLY", "IMAGE");
-
-setup_contents(t, t.step_func(function () {
-
- onSuccess = t.step_func(function (contents) {
- assert_type(contents, "array", "contents should be an array");
- assert_equals(contents.length, 1, "Updated image item should be found");
- assert_equals(contents[0].geolocation.latitude, expected.latitude,
- "geolocation latitude attribute should be updated");
- assert_equals(contents[0].geolocation.longitude, expected.longitude,
- "geolocation longitude attribute should be updated");
- t.done();
- });
-
- errorCallback = t.step_func(function (error) {
- assert_unreached("Find() error callback invoked: " + error.name + " with message: " + error.message);
- });
- successCallback = t.step_func(function (contents) {
- assert_type(contents, "array", "contents should be an array");
- assert_greater_than(contents.length, 0, "Image item should be found");
-
- for(i = 0; i < contents.length; i++) {
- if (contents[i].editableAttributes.indexOf("geolocation") >= 0) {
- updated = contents[i];
- break;
- }
- }
- assert_not_equals(updated, null, "Image should contain editable 'geolocation' attribute.");
-
- if (updated.geolocation !== null) {
- if (updated.geolocation.latitude === 5) {
- updated.geolocation.latitude = 6;
- } else {
- updated.geolocation.latitude = 5;
- }
- if (updated.geolocation.longitude === 5) {
- updated.geolocation.longitude = 6;
- } else {
- updated.geolocation.longitude = 5;
- }
- } else {
- updated.geolocation = new tizen.SimpleCoordinates(5.555, 5.555);
- }
- expected = updated.geolocation;
- tizen.content.update(updated);
-
- filter = new tizen.AttributeFilter("id", "EXACTLY", updated.id);
- tizen.content.find(onSuccess, errorCallback, null, filter);
- });
- tizen.content.find(successCallback, errorCallback, null, typeFilter);
-}));
-
-</script>
-</body>
-</html>
+++ /dev/null
-<!DOCTYPE html>
-<!--
-Copyright (c) 2013 Samsung Electronics Co., Ltd.
-
-Licensed under the Apache License, Version 2.0 (the License);
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-
-Authors:
- Tomasz Kusmierz <t.kusmierz@samsung.com>
-
--->
-
-<html>
-<head>
-<title>ContentManager_update_image_orientation</title>
-<script src="support/unitcommon.js"></script>
-<script src="support/content_common.js"></script>
-</head>
-
-<body>
-<div id="log"></div>
-<script type="text/javascript">
-//==== TEST: ContentManager_update_image_orientation
-//==== LABEL Check if update() properly updates orientation attribute of first found image item
-//==== PRIORITY P1
-//==== ONLOAD_DELAY 30
-//==== SPEC Tizen Web API:Content:Content:ContentManager:update M
-//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html
-//==== TEST_CRITERIA MAST MMINA
-
-setup({timeout: 30000});
-
-var t = async_test(document.title, {timeout: 30000}),
- successCallback, errorCallback, onSuccess, updated = null, i,
- expected, filter, typeFilter = new tizen.AttributeFilter("type", "EXACTLY", "IMAGE");
-
-setup_contents(t, t.step_func(function () {
-
- onSuccess = t.step_func(function (contents) {
- assert_type(contents, "array", "contents should be an array");
- assert_equals(contents.length, 1, "Updated image item should be found");
- assert_equals(contents[0].orientation, expected, "orientation attribute should be updated");
- t.done();
- });
-
- errorCallback = t.step_func(function (error) {
- assert_unreached("Find() error callback invoked: " + error.name + " with message: " + error.message);
- });
- successCallback = t.step_func(function (contents) {
- assert_type(contents, "array", "contents should be an array");
- assert_greater_than(contents.length, 0, "Image item should be found");
-
- for(i = 0; i < contents.length; i++) {
- if (contents[i].editableAttributes.indexOf("orientation") >= 0) {
- updated = contents[i];
- break;
- }
- }
-
- assert_not_equals(updated, null, "Image should contain editable 'orientation' attribute.");
-
- if (updated.orientation === "NORMAL") {
- updated.orientation = "FLIP_HORIZONTAL";
- } else {
- updated.orientation = "NORMAL";
- }
- expected = updated.orientation;
- tizen.content.update(updated);
-
- filter = new tizen.AttributeFilter("id", "EXACTLY", updated.id);
- tizen.content.find(onSuccess, errorCallback, null, filter);
- });
- tizen.content.find(successCallback, errorCallback, null, typeFilter);
-}));
-
-</script>
-</body>
-</html>
+++ /dev/null
-<!DOCTYPE html>
-<!--
-Copyright (c) 2013 Samsung Electronics Co., Ltd.
-
-Licensed under the Apache License, Version 2.0 (the License);
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-
-Authors:
- Tomasz Kusmierz <t.kusmierz@samsung.com>
-
--->
-
-<html>
-<head>
-<title>ContentManager_update_name</title>
-<script src="support/unitcommon.js"></script>
-<script src="support/content_common.js"></script>
-</head>
-
-<body>
-<div id="log"></div>
-<script type="text/javascript">
-//==== TEST: ContentManager_update_name
-//==== LABEL Check if update() properly updates name attribute of first found item
-//==== PRIORITY P1
-//==== ONLOAD_DELAY 30
-//==== SPEC Tizen Web API:Content:Content:ContentManager:update M
-//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html
-//==== TEST_CRITERIA MAST MMINA
-
-setup({timeout: 30000});
-
-var t = async_test(document.title, {timeout: 30000}),
- successCallback, errorCallback, onSuccess, expected, updated = null, i,
- filter, typeFilter = new tizen.AttributeFilter("type", "EXACTLY", "IMAGE");
-
-
-setup_contents(t, t.step_func(function () {
-
- onSuccess = t.step_func(function (contents) {
- assert_type(contents, "array", "contents should be an array");
- assert_equals(contents.length, 1, "Updated image item should be found");
- assert_equals(contents[0].name, expected, "name attribute should be updated");
- t.done();
- });
-
- errorCallback = t.step_func(function (error) {
- assert_unreached("Find() error callback invoked: " + error.name + " with message: " + error.message);
- });
- successCallback = t.step_func(function (contents) {
- assert_type(contents, "array", "contents should be an array");
- assert_greater_than(contents.length, 0, "Image item should be found");
-
- for(i = 0; i < contents.length; i ++) {
- if (contents[i].editableAttributes.indexOf("name") >= 0) {
- updated = contents[i];
- break;
- }
- }
- assert_not_equals(updated, null, "Image should contain editable 'name' attribute.");
-
- updated.name += "updated";
- expected = updated.name;
- tizen.content.update(updated);
-
- filter = new tizen.AttributeFilter("id", "EXACTLY", updated.id);
- tizen.content.find(onSuccess, errorCallback, null, filter);
- });
- tizen.content.find(successCallback, errorCallback, null, typeFilter);
-}));
-
-</script>
-</body>
-</html>
+++ /dev/null
-<!DOCTYPE html>
-<!--
-Copyright (c) 2013 Samsung Electronics Co., Ltd.
-
-Licensed under the Apache License, Version 2.0 (the License);
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-
-Authors:
- Tomasz Kusmierz <t.kusmierz@samsung.com>
-
--->
-
-<html>
-<head>
-<title>ContentManager_update_video_geolocation</title>
-<script src="support/unitcommon.js"></script>
-<script src="support/content_common.js"></script>
-</head>
-
-<body>
-<div id="log"></div>
-<script type="text/javascript">
-//==== TEST: ContentManager_update_video_geolocation
-//==== LABEL Check if update() properly updates geolocation attribute of first found video item
-//==== PRIORITY P1
-//==== ONLOAD_DELAY 30
-//==== SPEC Tizen Web API:Content:Content:ContentManager:update M
-//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html
-//==== TEST_CRITERIA MAST MMINA
-
-setup({timeout: 30000});
-
-var t = async_test(document.title, {timeout: 30000}),
- successCallback, errorCallback, onSuccess, expected, updated = null, i,
- filter, typeFilter = new tizen.AttributeFilter("type", "EXACTLY", "VIDEO");
-
-setup_contents(t, t.step_func(function () {
-
- onSuccess = t.step_func(function (contents) {
- assert_type(contents, "array", "contents should be an array");
- assert_equals(contents.length, 1, "Updated video item should be found");
-
- assert_equals(contents[0].geolocation.latitude, expected.latitude,
- "geolocation latitude attribute should be updated");
- assert_equals(contents[0].geolocation.longitude, expected.longitude,
- "geolocation longitude attribute should be updated");
- t.done();
- });
-
- errorCallback = t.step_func(function (error) {
- assert_unreached("Find() error callback invoked: " + error.name + " with message: " + error.message);
- });
- successCallback = t.step_func(function (contents) {
- assert_type(contents, "array", "contents should be an array");
- assert_greater_than(contents.length, 0, "Video item should be found");
-
- for(i = 0; i < contents.length; i ++) {
- if (contents[i].editableAttributes.indexOf("geolocation") >= 0) {
- updated = contents[i];
- break;
- }
- }
- assert_not_equals(updated, null, "Video should contain editable 'geolocation' attribute.");
-
- if (updated.geolocation !== null) {
- if (updated.geolocation.latitude === 5) {
- updated.geolocation.latitude = 6;
- } else {
- updated.geolocation.latitude = 5;
- }
- if (updated.geolocation.longitude === 5) {
- updated.geolocation.longitude = 6;
- } else {
- updated.geolocation.longitude = 5;
- }
- } else {
- updated.geolocation = new tizen.SimpleCoordinates(5.555, 5.555);
- }
- expected = updated.geolocation;
- tizen.content.update(updated);
-
- filter = new tizen.AttributeFilter("id", "EXACTLY", updated.id);
- tizen.content.find(onSuccess, errorCallback, null, filter);
- });
- tizen.content.find(successCallback, errorCallback, null, typeFilter);
-}));
-
-</script>
-</body>
-</html>
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.");
}
</spec>
</specs>
</testcase>
- <testcase purpose="Check if update() properly updates description attribute of first found item" type="compliance" onload_delay="30" status="approved" component="Tizen Device APIs/Content/Content" execution_type="auto" priority="P1" id="ContentManager_update_description">
- <description>
- <test_script_entry>/opt/tct-content-tizen-tests/content/ContentManager_update_description.html</test_script_entry>
- </description>
- <specs>
- <spec>
- <spec_assertion interface="ContentManager" element_type="method" element_name="update" specification="Content" section="Content" category="Tizen Device API Specifications"/>
- <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html</spec_url>
- <spec_statement>TBD</spec_statement>
- </spec>
- </specs>
- </testcase>
- <testcase purpose="Check if updateBatch() method updates properly description of found content" type="compliance" onload_delay="30" status="approved" component="Tizen Device APIs/Content/Content" execution_type="auto" priority="P1" id="ContentManager_updateBatch_description">
- <description>
- <test_script_entry>/opt/tct-content-tizen-tests/content/ContentManager_updateBatch_description.html</test_script_entry>
- </description>
- <specs>
- <spec>
- <spec_assertion interface="ContentManager" element_type="method" element_name="updateBatch" specification="Content" section="Content" category="Tizen Device API Specifications"/>
- <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html</spec_url>
- <spec_statement>TBD</spec_statement>
- </spec>
- </specs>
- </testcase>
<testcase purpose="Check if Content type value is IMAGE for find method with filter IMAGE" type="compliance" onload_delay="30" status="approved" component="Tizen Device APIs/Content/Content" execution_type="auto" priority="P3" id="Content_type_IMAGE">
<description>
<test_script_entry>/opt/tct-content-tizen-tests/content/Content_type_IMAGE.html</test_script_entry>
</spec>
</specs>
</testcase>
- <testcase purpose="Check if update() properly updates name attribute of first found item" type="compliance" onload_delay="30" status="approved" component="Tizen Device APIs/Content/Content" execution_type="auto" priority="P1" id="ContentManager_update_name">
- <description>
- <test_script_entry>/opt/tct-content-tizen-tests/content/ContentManager_update_name.html</test_script_entry>
- </description>
- <specs>
- <spec>
- <spec_assertion interface="ContentManager" element_type="method" element_name="update" specification="Content" section="Content" category="Tizen Device API Specifications"/>
- <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html</spec_url>
- <spec_statement>TBD</spec_statement>
- </spec>
- </specs>
- </testcase>
- <testcase purpose="Check if update() properly updates geolocation attribute of first found video item" type="compliance" onload_delay="30" status="approved" component="Tizen Device APIs/Content/Content" execution_type="auto" priority="P1" id="ContentManager_update_video_geolocation">
- <description>
- <test_script_entry>/opt/tct-content-tizen-tests/content/ContentManager_update_video_geolocation.html</test_script_entry>
- </description>
- <specs>
- <spec>
- <spec_assertion interface="ContentManager" element_type="method" element_name="update" specification="Content" section="Content" category="Tizen Device API Specifications"/>
- <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html</spec_url>
- <spec_statement>TBD</spec_statement>
- </spec>
- </specs>
- </testcase>
- <testcase purpose="Check if update() properly updates geolocation attribute of first found image item" type="compliance" onload_delay="30" status="approved" component="Tizen Device APIs/Content/Content" execution_type="auto" priority="P1" id="ContentManager_update_image_geolocation">
- <description>
- <test_script_entry>/opt/tct-content-tizen-tests/content/ContentManager_update_image_geolocation.html</test_script_entry>
- </description>
- <specs>
- <spec>
- <spec_assertion interface="ContentManager" element_type="method" element_name="update" specification="Content" section="Content" category="Tizen Device API Specifications"/>
- <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html</spec_url>
- <spec_statement>TBD</spec_statement>
- </spec>
- </specs>
- </testcase>
- <testcase purpose="Check if update() properly updates orientation attribute of first found image item" type="compliance" onload_delay="30" status="approved" component="Tizen Device APIs/Content/Content" execution_type="auto" priority="P1" id="ContentManager_update_image_orientation">
- <description>
- <test_script_entry>/opt/tct-content-tizen-tests/content/ContentManager_update_image_orientation.html</test_script_entry>
- </description>
- <specs>
- <spec>
- <spec_assertion interface="ContentManager" element_type="method" element_name="update" specification="Content" section="Content" category="Tizen Device API Specifications"/>
- <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html</spec_url>
- <spec_statement>TBD</spec_statement>
- </spec>
- </specs>
- </testcase>
- <testcase purpose="Check if updateBatch() properly updates name attributes of multiple image items" type="compliance" onload_delay="30" status="approved" component="Tizen Device APIs/Content/Content" execution_type="auto" priority="P1" id="ContentManager_updateBatch_name">
- <description>
- <test_script_entry>/opt/tct-content-tizen-tests/content/ContentManager_updateBatch_name.html</test_script_entry>
- </description>
- <specs>
- <spec>
- <spec_assertion interface="ContentManager" element_type="method" element_name="updateBatch" specification="Content" section="Content" category="Tizen Device API Specifications"/>
- <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html</spec_url>
- <spec_statement>TBD</spec_statement>
- </spec>
- </specs>
- </testcase>
- <testcase purpose="Check if updateBatch() properly updates name attributes of multiple video items" type="compliance" onload_delay="30" status="approved" component="Tizen Device APIs/Content/Content" execution_type="auto" priority="P1" id="ContentManager_updateBatch_video_geolocation">
- <description>
- <test_script_entry>/opt/tct-content-tizen-tests/content/ContentManager_updateBatch_video_geolocation.html</test_script_entry>
- </description>
- <specs>
- <spec>
- <spec_assertion interface="ContentManager" element_type="method" element_name="updateBatch" specification="Content" section="Content" category="Tizen Device API Specifications"/>
- <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html</spec_url>
- <spec_statement>TBD</spec_statement>
- </spec>
- </specs>
- </testcase>
- <testcase purpose="Check if updateBatch() properly updates geolocation attributes of multiple image items" type="compliance" onload_delay="30" status="approved" component="Tizen Device APIs/Content/Content" execution_type="auto" priority="P1" id="ContentManager_updateBatch_image_geolocation">
- <description>
- <test_script_entry>/opt/tct-content-tizen-tests/content/ContentManager_updateBatch_image_geolocation.html</test_script_entry>
- </description>
- <specs>
- <spec>
- <spec_assertion interface="ContentManager" element_type="method" element_name="updateBatch" specification="Content" section="Content" category="Tizen Device API Specifications"/>
- <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html</spec_url>
- <spec_statement>TBD</spec_statement>
- </spec>
- </specs>
- </testcase>
- <testcase purpose="Check if updateBatch() properly updates orientation attributes of multiple image items" type="compliance" onload_delay="30" status="approved" component="Tizen Device APIs/Content/Content" execution_type="auto" priority="P1" id="ContentManager_updateBatch_image_orientation">
- <description>
- <test_script_entry>/opt/tct-content-tizen-tests/content/ContentManager_updateBatch_image_orientation.html</test_script_entry>
- </description>
- <specs>
- <spec>
- <spec_assertion interface="ContentManager" element_type="method" element_name="updateBatch" specification="Content" section="Content" category="Tizen Device API Specifications"/>
- <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html</spec_url>
- <spec_statement>TBD</spec_statement>
- </spec>
- </specs>
- </testcase>
<testcase purpose="Check if addChangeListener method works properly" type="compliance" onload_delay="30" status="approved" component="Tizen Device APIs/Content/Content" execution_type="auto" priority="P1" id="ContentManager_addChangeListener">
<description>
<test_script_entry>/opt/tct-content-tizen-tests/content/ContentManager_addChangeListener.html</test_script_entry>
</spec>
</specs>
</testcase>
- <!--<testcase purpose="Check exception in error callback of updateBatch() method" type="compliance" onload_delay="30" status="approved" component="Tizen Device APIs/Content/Content" execution_type="auto" priority="P2" id="ContentManager_updateBatch_errorCallback_invoked">
- <description>
- <test_script_entry>/opt/tct-content-tizen-tests/content/ContentManager_updateBatch_errorCallback_invoked.html</test_script_entry>
- </description>
- <specs>
- <spec>
- <spec_assertion interface="ContentManager" element_type="method" element_name="updateBatch" specification="Content" section="Content" category="Tizen Device API Specifications"/>
- <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html</spec_url>
- <spec_statement>TBD</spec_statement>
- </spec>
- </specs>
- </testcase>
- <testcase purpose="Check if update throws exception when content is invalid" type="compliance" onload_delay="30" status="approved" component="Tizen Device APIs/Content/Content" execution_type="auto" priority="P2" id="ContentManager_update_content_invalid">
- <description>
- <test_script_entry>/opt/tct-content-tizen-tests/content/ContentManager_update_content_invalid.html</test_script_entry>
- </description>
- <specs>
- <spec>
- <spec_assertion interface="ContentManager" element_type="method" element_name="update" specification="Content" section="Content" category="Tizen Device API Specifications"/>
- <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html</spec_url>
- <spec_statement>TBD</spec_statement>
- </spec>
- </specs>
- </testcase>-->
<testcase purpose="Check if createPlaylist exists" type="compliance" status="approved" component="Tizen Device APIs/Content/Content" execution_type="auto" priority="P0" id="ContentManager_createPlaylist_exist">
<description>
<test_script_entry>/opt/tct-content-tizen-tests/content/ContentManager_createPlaylist_exist.html</test_script_entry>
</spec>
</specs>
</testcase>
- <testcase purpose="Check if ContentManager createThumbnail method with invalid arguments would invoke errorCallback" type="compliance" onload_delay="30" status="approved" component="Tizen Device APIs/Content/Content" execution_type="auto" priority="P2" id="ContentManager_createThumbnail_errorCallback_invoked">
+ <!--testcase purpose="Check if ContentManager createThumbnail method with invalid arguments would invoke errorCallback" type="compliance" onload_delay="30" status="approved" component="Tizen Device APIs/Content/Content" execution_type="auto" priority="P2" id="ContentManager_createThumbnail_errorCallback_invoked">
<description>
<test_script_entry>/opt/tct-content-tizen-tests/content/ContentManager_createThumbnail_errorCallback_invoked.html</test_script_entry>
</description>
<spec_statement>TBD</spec_statement>
</spec>
</specs>
- </testcase>
+ </testcase-->
<testcase purpose="Check if createThumbnail exists" type="compliance" status="approved" component="Tizen Device APIs/Content/Content" execution_type="auto" priority="P0" id="ContentManager_createThumbnail_exist">
<description>
<test_script_entry>/opt/tct-content-tizen-tests/content/ContentManager_createThumbnail_exist.html</test_script_entry>
<test_script_entry>/opt/tct-content-tizen-tests/content/Content_type_AUDIO.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="Check if update() properly updates description attribute of first found item" onload_delay="30" component="Tizen Device APIs/Content/Content" execution_type="auto" priority="P1" id="ContentManager_update_description">
- <description>
- <test_script_entry>/opt/tct-content-tizen-tests/content/ContentManager_update_description.html</test_script_entry>
- </description>
- </testcase>
- <testcase purpose="Check if updateBatch() method updates properly description of found content" onload_delay="30" component="Tizen Device APIs/Content/Content" execution_type="auto" priority="P1" id="ContentManager_updateBatch_description">
- <description>
- <test_script_entry>/opt/tct-content-tizen-tests/content/ContentManager_updateBatch_description.html</test_script_entry>
- </description>
- </testcase>
<testcase purpose="Check if Content type value is IMAGE for find method with filter IMAGE" onload_delay="30" component="Tizen Device APIs/Content/Content" execution_type="auto" priority="P3" id="Content_type_IMAGE">
<description>
<test_script_entry>/opt/tct-content-tizen-tests/content/Content_type_IMAGE.html</test_script_entry>
<test_script_entry>/opt/tct-content-tizen-tests/content/ContentDirectory_modifiedDate_attribute.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="Check if update() properly updates name attribute of first found item" onload_delay="30" component="Tizen Device APIs/Content/Content" execution_type="auto" priority="P1" id="ContentManager_update_name">
- <description>
- <test_script_entry>/opt/tct-content-tizen-tests/content/ContentManager_update_name.html</test_script_entry>
- </description>
- </testcase>
- <testcase purpose="Check if update() properly updates geolocation attribute of first found video item" onload_delay="30" component="Tizen Device APIs/Content/Content" execution_type="auto" priority="P1" id="ContentManager_update_video_geolocation">
- <description>
- <test_script_entry>/opt/tct-content-tizen-tests/content/ContentManager_update_video_geolocation.html</test_script_entry>
- </description>
- </testcase>
- <testcase purpose="Check if update() properly updates geolocation attribute of first found image item" onload_delay="30" component="Tizen Device APIs/Content/Content" execution_type="auto" priority="P1" id="ContentManager_update_image_geolocation">
- <description>
- <test_script_entry>/opt/tct-content-tizen-tests/content/ContentManager_update_image_geolocation.html</test_script_entry>
- </description>
- </testcase>
- <testcase purpose="Check if update() properly updates orientation attribute of first found image item" onload_delay="30" component="Tizen Device APIs/Content/Content" execution_type="auto" priority="P1" id="ContentManager_update_image_orientation">
- <description>
- <test_script_entry>/opt/tct-content-tizen-tests/content/ContentManager_update_image_orientation.html</test_script_entry>
- </description>
- </testcase>
- <testcase purpose="Check if updateBatch() properly updates name attributes of multiple image items" onload_delay="30" component="Tizen Device APIs/Content/Content" execution_type="auto" priority="P1" id="ContentManager_updateBatch_name">
- <description>
- <test_script_entry>/opt/tct-content-tizen-tests/content/ContentManager_updateBatch_name.html</test_script_entry>
- </description>
- </testcase>
- <testcase purpose="Check if updateBatch() properly updates name attributes of multiple video items" onload_delay="30" component="Tizen Device APIs/Content/Content" execution_type="auto" priority="P1" id="ContentManager_updateBatch_video_geolocation">
- <description>
- <test_script_entry>/opt/tct-content-tizen-tests/content/ContentManager_updateBatch_video_geolocation.html</test_script_entry>
- </description>
- </testcase>
- <testcase purpose="Check if updateBatch() properly updates geolocation attributes of multiple image items" onload_delay="30" component="Tizen Device APIs/Content/Content" execution_type="auto" priority="P1" id="ContentManager_updateBatch_image_geolocation">
- <description>
- <test_script_entry>/opt/tct-content-tizen-tests/content/ContentManager_updateBatch_image_geolocation.html</test_script_entry>
- </description>
- </testcase>
- <testcase purpose="Check if updateBatch() properly updates orientation attributes of multiple image items" onload_delay="30" component="Tizen Device APIs/Content/Content" execution_type="auto" priority="P1" id="ContentManager_updateBatch_image_orientation">
- <description>
- <test_script_entry>/opt/tct-content-tizen-tests/content/ContentManager_updateBatch_image_orientation.html</test_script_entry>
- </description>
- </testcase>
<testcase purpose="Check if addChangeListener method works properly" onload_delay="30" component="Tizen Device APIs/Content/Content" execution_type="auto" priority="P1" id="ContentManager_addChangeListener">
<description>
<test_script_entry>/opt/tct-content-tizen-tests/content/ContentManager_addChangeListener.html</test_script_entry>
<test_script_entry>/opt/tct-content-tizen-tests/content/Content_in_tizen.html</test_script_entry>
</description>
</testcase>
-<!-- <testcase purpose="Check exception in error callback of updateBatch() method" onload_delay="30" component="Tizen Device APIs/Content/Content" execution_type="auto" priority="P2" id="ContentManager_updateBatch_errorCallback_invoked">
- <description>
- <test_script_entry>/opt/tct-content-tizen-tests/content/ContentManager_updateBatch_errorCallback_invoked.html</test_script_entry>
- </description>
- </testcase> -->
-<!-- <testcase purpose="Check if update throws exception when content is invalid" onload_delay="30" component="Tizen Device APIs/Content/Content" execution_type="auto" priority="P2" id="ContentManager_update_content_invalid">
- <description>
- <test_script_entry>/opt/tct-content-tizen-tests/content/ContentManager_update_content_invalid.html</test_script_entry>
- </description>
- </testcase> -->
<testcase purpose="Check if createPlaylist exists" component="Tizen Device APIs/Content/Content" execution_type="auto" priority="P0" id="ContentManager_createPlaylist_exist">
<description>
<test_script_entry>/opt/tct-content-tizen-tests/content/ContentManager_createPlaylist_exist.html</test_script_entry>