00238fb54ba4739fc3eb63dcff5bb6712b27e5e5
[test/tct/web/api.git] /
1 <!DOCTYPE html>
2 <!--
3 Copyright (c) 2013 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
18 Authors:
19         Lukasz Bardeli <l.bardeli@samsung.com>
20
21 -->
22 <html>
23 <head>
24 <title>Messaging_email_getMessageServices_with_errorCallback</title>
25 <meta charset="utf-8"/>
26 <script type="text/javascript" src="support/unitcommon.js"></script>
27 <script type="text/javascript" src="support/messaging_common.js"></script>
28 </head>
29
30 <body>
31 <div id="log"></div>
32 <script>
33 //==== TEST: Messaging_email_getMessageServices_with_errorCallback
34 //==== LABEL Check if getMessageServices works properly with all arguments (email)
35 //==== ONLOAD_DELAY 180
36 //==== TIMEOUT 180
37 //==== SPEC Tizen Web API:Communication:Messaging:Messaging:getMessageServices M
38 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/messaging.html
39 //==== TEST_CRITERIA MR MOA
40 setup({timeout: 180000});
41 var t = async_test(document.title, {timeout: 180000}), serviceSuccess, serviceError, i, returnedValue = null;
42 t.step(function () {
43
44     serviceSuccess = t.step_func(function (services) {
45         assert_equals(returnedValue, undefined, "Incorrect returned value.");
46
47         assert_type(services, "array", "Not an array");
48         assert_greater_than(services.length, 0, "Received empty services array");
49
50         for(i = 0; i< services.length; i++){
51             assert_true("type" in services[i], "Name type doesn't exist in provided object.");
52             assert_equals(services[i].type, "messaging.email", "Type is not equal email");
53         }
54
55         t.done();
56     });
57
58     serviceError = t.step_func(function (error) {
59         assert_unreached("getMessageServices() error callback: name:" + error.name + ", msg:" + error.message);
60     });
61
62     returnedValue = tizen.messaging.getMessageServices("messaging.email", serviceSuccess, serviceError);
63 });
64
65 </script>
66 </body>
67 </html>