3 Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
9 http://www.apache.org/licenses/LICENSE-2.0
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.
18 Hyukin Kwon <hyukin.kwon@samsung.com>
23 <title>HumanActivityMonitorOption_sampleInterval_type_GPS_default</title>
24 <meta charset="utf-8"/>
25 <script src="support/unitcommon.js"></script>
26 <script src="support/humanactivitymonitor_common.js"></script>
31 //==== TEST: HumanActivityMonitorOption_sampleInterval_type_GPS_default
32 //==== LABEL Check if method HumanActivityMonitorOption::sampleInterval works properly when set to null
34 //==== EXECUTION_TYPE manual
35 //==== SPEC Tizen Web API:System:HumanActivityMonitor:HumanActivityMonitorOption:sampleInterval A
37 //==== STEP Wait 120 seconds for the callback
38 //==== EXPECT Pass should be shown in the page after 120 seconds
40 //==== ONLOAD_DELAY 300
42 setup({"timeout": 300000});
44 var t = async_test(document.title, {"timeout": 300000}), onScreenStateChanged, changedCallback, humanActivityType = "GPS", cbFlag = 0;
47 add_result_callback(function () {
48 tizen.humanactivitymonitor.stop(humanActivityType);
51 changedCallback = t.step_func(function (gpsInfo) {
53 assert_approx_equals(gpsInfo.gpsInfo.length, 120, 5, "GPS information should be sampled approximately 120 times");
61 onScreenStateChanged = t.step_func(function (previousState, changedState) {
62 if (changedState === "SCREEN_OFF") {
63 tizen.humanactivitymonitor.start(humanActivityType, changedCallback, null, {callbackInterval:120000, sampleInterval:null});
64 tizen.power.unsetScreenStateChangeListener();
68 alert('Please turn off the screen');
69 tizen.power.setScreenStateChangeListener(onScreenStateChanged);