Activites usable from batch must be now marked 48/164548/22
authorRadoslaw Cybulski <r.cybulski@partner.samsung.com>
Tue, 19 Dec 2017 14:45:48 +0000 (15:45 +0100)
committerRadoslaw Cybulski <r.cybulski@partner.samsung.com>
Wed, 10 Jan 2018 12:05:15 +0000 (13:05 +0100)
Activities, that are suuposed to be callable from batch test, must
override getRequiredNumberOfArgumentsIfAllowedInTesting method
and return number of expected arguments.

Change-Id: Iffeb1b4ee7576a11bf260a47e98748f422f94786

src/Activity.hpp
src/GestureActivity.cpp
src/TapActivity.cpp

index 4bd222e..1f3f011 100644 (file)
@@ -20,6 +20,7 @@
 #include "ActivityChangeRequest.hpp"
 #include "Subject.hpp"
 #include "DoneCallback.hpp"
+#include "Optional.hpp"
 
 #include <memory>
 
@@ -36,6 +37,11 @@ public:
 
        virtual void process(DoneCallback) = 0;
 
+       virtual Optional<unsigned int> getRequiredNumberOfArgumentsIfAllowedInBatchProcessing() const
+       {
+               return {};
+       }
+
        bool isCompleted() const;
        void markAsCompleted();
 
index e29023d..bb6bc21 100644 (file)
@@ -75,6 +75,11 @@ class SwipeRightActivity : public DispatchGestureEventActivity<SwipeRightActivit
 public:
        static constexpr const char *activityType = "SWIPE_RIGHT";
        static constexpr const SwipeType swipeType = SWIPE_RIGHT;
+
+       Optional<unsigned int> getRequiredNumberOfArgumentsIfAllowedInBatchProcessing() const
+       {
+               return 0;
+       }
 };
 
 class SwipeLeftActivity : public DispatchGestureEventActivity<SwipeLeftActivity>
@@ -82,6 +87,11 @@ class SwipeLeftActivity : public DispatchGestureEventActivity<SwipeLeftActivity>
 public:
        static constexpr const char *activityType = "SWIPE_LEFT";
        static constexpr SwipeType swipeType = SWIPE_LEFT;
+
+       Optional<unsigned int> getRequiredNumberOfArgumentsIfAllowedInBatchProcessing() const
+       {
+               return 0;
+       }
 };
 
 class SwipeUpActivity : public DispatchGestureEventActivity<SwipeUpActivity>
@@ -89,6 +99,11 @@ class SwipeUpActivity : public DispatchGestureEventActivity<SwipeUpActivity>
 public:
        static constexpr const char *activityType = "SWIPE_UP";
        static constexpr SwipeType swipeType = SWIPE_UP;
+
+       Optional<unsigned int> getRequiredNumberOfArgumentsIfAllowedInBatchProcessing() const
+       {
+               return 0;
+       }
 };
 
 class SwipeDownActivity : public DispatchGestureEventActivity<SwipeDownActivity>
@@ -96,6 +111,11 @@ class SwipeDownActivity : public DispatchGestureEventActivity<SwipeDownActivity>
 public:
        static constexpr const char *activityType = "SWIPE_DOWN";
        static constexpr SwipeType swipeType = SWIPE_DOWN;
+
+       Optional<unsigned int> getRequiredNumberOfArgumentsIfAllowedInBatchProcessing() const
+       {
+               return 0;
+       }
 };
 
 class ZoomInActivity : public DispatchGestureEventActivity<ZoomInActivity>
index 37274c7..e159a3f 100644 (file)
@@ -40,4 +40,8 @@ public:
                markAsCompleted();
        }
 
+       Optional<unsigned int> getRequiredNumberOfArgumentsIfAllowedInBatchProcessing() const
+       {
+               return 1;
+       }
 };