[Notification] Notification.progressValue should be set to null when is not defined... 75/116775/1
authorSzymon Jastrzebski <s.jastrzebsk@partner.samsung.com>
Tue, 28 Feb 2017 07:25:49 +0000 (08:25 +0100)
committerSzymon Jastrzebski <s.jastrzebsk@partner.samsung.com>
Tue, 28 Feb 2017 07:27:30 +0000 (08:27 +0100)
Below comparision should always be true.
tizen.notification.post(noti);
tizen.notification.get(id).progressValue === noti.progressValue // true

[Verification] Notification TCT tests passed 100%

Change-Id: Ia53a25eaf5aee110e4fe3128d18e87fdaa2deb9f
Signed-off-by: Szymon Jastrzebski <s.jastrzebsk@partner.samsung.com>
src/notification/status_notification.cc

index 13fe62c..1b55a50 100644 (file)
@@ -1314,14 +1314,19 @@ PlatformResult StatusNotification::FromJson(const picojson::object& args,
     return status;
   }
 
+  double progressValue;
   if (val.contains("progressValue") && !IsNull(noti_obj, "progressValue")) {
-    double progressValue = common::FromJson<double>(noti_obj, "progressValue");
-    status = SetProgressValue(noti_handle, progress_type, progressValue,
-        is_update);
+    progressValue = common::FromJson<double>(noti_obj, "progressValue");
+  }
+  else {
+    progressValue = -1;
+  }
 
-    if (status.IsError()) {
-      return status;
-    }
+  status = SetProgressValue(noti_handle, progress_type, progressValue,
+      is_update);
+
+  if (status.IsError()) {
+    return status;
   }
 
   status = SetText(noti_handle,