3 Copyright (c) 2016 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>HumanActivityMonitorManager_removeActivityRecognitionListener</title>
24 <meta charset="utf-8"/>
25 <script src="support/unitcommon.js"></script>
26 <script src="support/humanactivitymonitor_common.js"></script>
31 //==== TEST: HumanActivityMonitorManager_removeActivityRecognitionListener_STATIONARY
32 //==== LABEL Check if the method removeActivityRecognitionListener of HumanActivityMonitorManager returns proper value with errorcallback assigned
33 //==== SPEC Tizen Web API:Sensor:HumanActivityMonitor:HumanActivityMonitorManager:removeActivityRecognitionListener M
36 //==== EXECUTION_TYPE manual
37 //==== STEP Press run button, then pretend walking with the device for 15 seconds
39 //==== TEST_CRITERIA MR MMINA CBT
40 //==== ONLOAD_DELAY 20
42 setup({"timeout": 20000});
44 var t = async_test(document.title, {"timeout": 20000}), returnedId = null, returnedValue = undefined, humanActivityType = "WALKING", listener, errorCallback;
47 listener = t.step_func(function (info) {
48 assert_unreached("Callback should not be invoked after removeActivityRecognitionListener call");
51 errorCallback = t.step_func(function (error) {
52 assert_unreached("Error callback should not be invoked, but was invoked with the error " + error.name);
55 returnedId = tizen.humanactivitymonitor.addActivityRecognitionListener(humanActivityType, listener);
56 returnedValue = tizen.humanactivitymonitor.removeActivityRecognitionListener(returnedId, errorCallback);
57 assert_equals(returnedValue, undefined, "Should return nothing");
58 alert("Grab the device, and pretend walking for 15 seconds after pressing OK");
59 setTimeout(function () {t.done();}, 15000);