[common][tct-alarm-tizen-tests][Modify TC to fix issue] 22/129122/2
authorxy.qian <xy.qian@samsung.com>
Mon, 15 May 2017 05:52:51 +0000 (13:52 +0800)
committerxy.qian <xy.qian@samsung.com>
Mon, 15 May 2017 07:28:26 +0000 (15:28 +0800)
Change-Id: I3a75a1d132de3b5ef8880b4a15f5236facf73fef
Signed-off-by: xy.qian <xy.qian@samsung.com>
common/tct-alarm-tizen-tests/alarm/AlarmManager_addAlarmNotification.html

index eb65e5b0cc85bf47941afeab95b77ad6caf8ed13..2f2001aee39e9e6864767b28c1f2b050b13fd34c 100644 (file)
@@ -47,7 +47,7 @@ test(function () {
         }
     });
 
-    var date, alarm, alarm1,notificationDict, notification, retVal;
+    var date, alarm, noti, notificationDict, notification, retVal, key;
     date = new Date();
     date.setHours(date.getHours() + 1);
     alarm = new tizen.AlarmAbsolute(date);
@@ -58,9 +58,15 @@ test(function () {
     };
     notification = new tizen.StatusNotification("SIMPLE", "Simple notification", notificationDict);
     retVal = tizen.alarm.addAlarmNotification(alarm, notification);
-    alarm1 = tizen.alarm.getAlarmNotification(alarm.id);
+    noti = tizen.alarm.getAlarmNotification(alarm.id);
     assert_type(retVal, "undefined", "method returned value");
-    assert_equals(alarm.id, alarm1.id, "the object is not the same which was added");
+    for (key in notification) {
+        if (notification[key] instanceof Array) {
+            assert_equals(JSON.stringify(noti[key]), JSON.stringify(notification[key]), "arrays are not same");
+        } else {
+            assert_equals(noti[key], notification[key], "properties are not same"); 
+        }
+    }
 }, document.title);
 
 </script>