ca6b651587dd10dc4543353d5352079cbcfd311e
[test/tct/web/api.git] /
1 <!DOCTYPE html>
2 <!--
3 Copyright (c) 2014 Samsung Electronics Co., Ltd.
4
5 Licensed under the Apache License, Version 2.0 (the License);
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
8
9     http://www.apache.org/licenses/LICENSE-2.0
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16
17 Authors:
18         Saud Mohammad Mostafa <saud.mm@samsung.com>
19
20 -->
21 <html>
22 <head>
23 <title>MappedDataControlConsumer_removeValue_errorCallback_invoked</title>
24 <script src="support/unitcommon.js"></script>
25 <script src="support/datacontrol_common.js"></script>
26 </head>
27 <body>
28 <div id="log"></div>
29 <script type="text/javascript">
30 //==== TEST: MappedDataControlConsumer_removeValue_errorCallback_invoked
31 //==== LABEL Check exception in error callback of removeValue method
32 //==== SPEC Tizen Web API:TBD:Datacontrol:MappedDataControlConsumer:removeValue M
33 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/datacontrol.html
34 //==== ONLOAD_DELAY 30
35 //==== PRIORITY P2
36 //==== TEST_CRITERIA MERRCB
37
38 setup({timeout: 30000});
39 var t = async_test(document.title, {timeout: 30000}), dataConsumer, globalReqId = generateGlobalReqId(),
40     addSuccessCallback, addErrorCallback, removeSuccessCallback, removeErrorCallback;
41
42 t.step(function () {
43
44     removeErrorCallback = t.step_func(function (reqId, error) {
45         assert_equals(error.name, "NotFoundError", "incorrect error code");
46         t.done();
47     });
48
49     removeSuccessCallback = t.step_func(function (reqId) {
50         assert_unreached("removeValue() error callback");
51     });
52
53     addSuccessCallback = t.step_func(function (reqId) {
54         globalReqId++;
55         dataConsumer.removeValue(globalReqId, "android", "intel", removeSuccessCallback, removeErrorCallback);
56     });
57
58     addErrorCallback = t.step_func(function (reqId, error) {
59         assert_unreached("addValue() error callback");
60     });
61
62     dataConsumer = tizen.datacontrol.getDataControlConsumer(PROVIDER_ID, DATA_ID, TYPE_MAP);
63     dataConsumer.addValue(globalReqId, "tizen", "samsung", addSuccessCallback, addErrorCallback);
64 });
65
66 </script>
67 </body>
68 </html>