9be5d8327ae3e940a499448e28b569bffaa2cb2e
[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 Authors:
18         Krzysztof Lachacz <k.lachacz@samsung.com>
19
20 -->
21
22 <html>
23 <head>
24 <title>NetworkSuccessCallback_ondisconnected</title>
25 <script src="support/unitcommon.js"></script>
26 <script src="support/networkbearerselection_common.js"></script>
27 </head>
28
29 <body>
30 <div id="log"></div>
31 <script type="text/javascript">
32 //==== TEST: NetworkSuccessCallback_ondisconnected
33 //==== LABEL Check if NetworkSuccessCallback::ondisconnected is called
34 //==== SPEC Tizen Web API:Communication:NBS:NetworkSuccessCallback:ondisconnected M
35 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/networkbearerselection.html
36 //==== EXECUTION_TYPE manual
37 //==== PRE Please enable cellular data service
38 //==== POST Please re-enable cellular data service
39 //==== PRIORITY P1
40 //==== TEST_CRITERIA CBOA
41
42 setup({timeout: 90000});
43
44 var t = async_test(document.title, {timeout: 90000}),
45     requestRouteToHostSuccess, requestRouteToHostError;
46
47 t.step(function () {
48     requestRouteToHostError = t.step_func(function (error) {
49         assert_unreached("requestRouteToHost() error callback invoked: name: " + error.name + ", msg: " + error.message);
50     });
51
52     requestRouteToHostSuccess = {
53         onsuccess: t.step_func(function () {
54             confirm("Please disable cellular data service");
55         }),
56
57         ondisconnected: t.step_func(function () {
58             confirm("Please enable cellular data service");
59             t.done();
60         })
61     };
62
63     tizen.networkbearerselection.requestRouteToHost(NETWORK_TYPE, DOMAIN_NAME, requestRouteToHostSuccess, requestRouteToHostError);
64 });
65
66 </script>
67 </body>
68 </html>