[common][humanactivitymonitor][DPTTIZEN-3019, optimize readRecorderData_type_HRM tc] 49/178049/1
authorlin qunfang <qunfang.lin@samsung.com>
Tue, 8 May 2018 13:26:09 +0000 (21:26 +0800)
committerlin qunfang <qunfang.lin@samsung.com>
Tue, 8 May 2018 13:26:35 +0000 (21:26 +0800)
Change-Id: I224dbb37950e5119d361bc4615cc770e9bf29045
Signed-off-by: lin qunfang <qunfang.lin@samsung.com>
common/tct-humanactivitymonitor-tizen-tests/humanactivitymonitor/HumanActivityMonitorManager_readRecorderData_type_HRM.html
common/tct-humanactivitymonitor-tizen-tests/tests.full.xml
common/tct-humanactivitymonitor-tizen-tests/tests.xml

index 4d6ecb760d74101c72bee7ada9ae5301fc0d5015..3770738b530e733b1fbb72ade5e720c343444708 100755 (executable)
@@ -39,7 +39,9 @@ Authors:
 
 setup({timeout: 1500000});
 
-var t = async_test(document.title, {timeout: 1500000}), retValue = null, successCallback, date = new Date(), endTime = date.getTime() + 1200000, startTime = date.setDate(date.getDate() - 1),
+var t = async_test(document.title, {timeout: 1500000}), retValue = null, successCallback, date = new Date(),
+  endTime = date.getTime() + 1200000, startTime = date.setDate(date.getDate() - 1), tries = 120;
+
     options = {
         interval: 10,
         retentionPeriod: 1
@@ -50,9 +52,20 @@ var t = async_test(document.title, {timeout: 1500000}), retValue = null, success
         interval: 10
     };
 
+function testReadRecorderData() {
+    retValue = tizen.humanactivitymonitor.readRecorderData("HRM", query, successCallback);
+    tries--;
+    if (tries > 0) {
+        setTimeout(testReadRecorderData, 10000);
+    } else {
+        assert_unreached("No data has been collected");
+    }
+}
+
 t.step(function () {
     add_result_callback(function () {
         tizen.humanactivitymonitor.stopRecorder("HRM");
+        tizen.humanactivitymonitor.stop("HRM");
     });
 
     successCallback = t.step_func(function (humanactivitydata) {
@@ -64,9 +77,9 @@ t.step(function () {
         assert_unreached("Invalid error callback invoked:" + error.name + ": " + error.message);
     });
 
+    tizen.humanactivitymonitor.start("HRM");
     tizen.humanactivitymonitor.startRecorder("HRM", options);
-    setTimeout(function() {
-        retValue = tizen.humanactivitymonitor.readRecorderData("HRM", query, successCallback);}, 600000);
+    setTimeout(testReadRecorderData, 10000);
 
 });
 
index bb43d3eae837898b13f6009927fe93b1e873b494..d0b79c5c6321e9184bc6295ea9d39aa1bff8ff35 100755 (executable)
         <description>
           <steps>
             <step order="1">
-              <step_desc>Waiting for 10 minutes for the callback.</step_desc>
+              <step_desc>Watch has to be weared on wrist. Waiting for 10 minutes for the callback.</step_desc>
               <expected>Pass should be shown in the page after 10 minutes.</expected>
             </step>
           </steps>
index 40db9c61e0c996710f87b44ab83e62a4c7c783ed..44e8512ac54d6ae0459cc5934454a6dc8b4eca4c 100755 (executable)
         <description>
           <steps>
             <step order="1">
-              <step_desc>Waiting for 10 minutes for the callback.</step_desc>
+              <step_desc>Watch has to be weared on wrist. Waiting for 10 minutes for the callback.</step_desc>
               <expected>Pass should be shown in the page after 10 minutes.</expected>
             </step>
           </steps>