[common][humanactivitymonitor][DPTTIZEN-3019, optimize readRecorderData_type_HRM tc] 45/178045/1
authorlin qunfang <qunfang.lin@samsung.com>
Tue, 8 May 2018 13:09:00 +0000 (21:09 +0800)
committerlin qunfang <qunfang.lin@samsung.com>
Tue, 8 May 2018 13:10:58 +0000 (21:10 +0800)
Change-Id: Iec0554f40b35ff1c72cad578b48e61b7c8f453ec
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 26515ec66842a384ee842bb244989792ec921fbf..6310654a7e58b5c176ee4c2d34f0ac0fe5f79f8c 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 e70dcecab7c0611e5d2e065af1508ba0d786daa7..b22276209bf2dfdc4eb7be969b1e504c5db6ac18 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>