4 Copyright (c) 2013 Samsung Electronics Co., Ltd.
6 Licensed under the Apache License, Version 2.0 (the License);
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
21 Andrzej Krolikowski <a.krolikowsk@samsung.com>
27 <title>SystemSettingManager_setProperty_no_errorCallback</title>
28 <script src="support/unitcommon.js"></script>
29 <script src="support/systemsetting_common.js"></script>
33 <script type="text/javascript">
34 //==== TEST: SystemSettingManager_setProperty_no_errorCallback
35 //==== LABEL Check if setProperty works for home_screen without error_callback
36 //==== SPEC Tizen Web API:System:SystemSetting:SystemSettingManager:setProperty M
37 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/systemsetting.html
39 //==== TEST_CRITERIA MMINA MAST MR
41 var t = async_test(document.title), type = "INCOMING_CALL",
42 previousValue, getPreviousValueCallback, newValue = IMAGE_FILE_PATH, newValue2 = IMAGE_FILE_PATH2, newValue_check,
43 setNewValueSuccessCallback, getNewValueSuccessCallback, returnedValue = null,
44 getNewValueSuccessCallback, setPreviousValueSuccessCallback, exception, getPropertyError,
45 setPropertyPreviousError;
48 setPropertyPreviousError = t.step_func(function (error) {
49 assert_unreached("setPropertyPreviousError() error: " + error.name + ": " + error.message);
52 setPreviousValueSuccessCallback = t.step_func(function () {
53 if (exception !== undefined){
59 getNewValueSuccessCallback = t.step_func(function (value) {
61 assert_not_equals(value, previousValue, "New value set incorrectly.");
62 assert_equals(value, newValue_check, "New value set incorrectly.");
66 if(newValue_check == newValue2){
67 tizen.systemsetting.setProperty(type, newValue, setPreviousValueSuccessCallback, setPropertyPreviousError);
70 tizen.systemsetting.setProperty(type, newValue2, setPreviousValueSuccessCallback, setPropertyPreviousError);
75 setNewValueSuccessCallback = t.step_func(function () {
76 assert_equals(returnedValue, undefined, "Incorrect value returned from setProperty method.");
77 tizen.systemsetting.getProperty(type, getNewValueSuccessCallback);
80 getPreviousValueCallback = t.step_func(function (value) {
81 if(value == newValue){
82 previousValue = value;
83 newValue_check = newValue2;
84 returnedValue = tizen.systemsetting.setProperty(type, newValue2, setNewValueSuccessCallback);
87 previousValue = value;
88 newValue_check = newValue;
89 returnedValue = tizen.systemsetting.setProperty(type, newValue, setNewValueSuccessCallback);
93 setNewValueSuccessCallback1 = t.step_func(function () {
94 assert_equals(returnedValue, undefined, "Incorrect value returned from setProperty method.");
95 tizen.systemsetting.getProperty(type, getPreviousValueCallback, getPropertyError);
98 setPropertyNewError = t.step_func(function (error) {
99 assert_unreached("setPropertyNewError() error: " + error.name + ": " + error.message);
102 getPropertyError = t.step_func(function (error) {
103 if(error.name == "UnknownError"){
104 returnedValue = tizen.systemsetting.setProperty(type, newValue, setNewValueSuccessCallback1, setPropertyNewError);
107 assert_unreached("getProperty() error: " + error.name + ": " + error.message);
111 tizen.systemsetting.getProperty(type, getPreviousValueCallback, getPropertyError);