e_test_event: Added auxHintEventItem class. 43/256843/2
authorJunseok, Kim <juns.kim@samsung.com>
Wed, 14 Apr 2021 01:49:27 +0000 (10:49 +0900)
committerJunseok, Kim <juns.kim@samsung.com>
Wed, 14 Apr 2021 03:27:09 +0000 (12:27 +0900)
Added auxHintEventItem class inherits eventItem.
It will be used by Aux hint test cases.

Change-Id: I07906ae3cbd0eb09a3cf1fa22fc8e6680cdc9194

src/e_test_event.cpp
src/e_test_event.h

index 84b2929..94d4dd5 100644 (file)
@@ -2047,6 +2047,7 @@ _cb_signal_aux_hint_changed(void *data,
    Eina_Bool res = EINA_FALSE;
    Ecore_Window win = 0;
    uint32_t hint_id;
+   std::shared_ptr<auxHintEventItem> hint = NULL;
    const char *hint_key, *hint_val;
 
    res = eldbus_message_error_get(msg, &name, &text);
@@ -2055,7 +2056,10 @@ _cb_signal_aux_hint_changed(void *data,
    res = eldbus_message_arguments_get(msg, "uuss", &win, &hint_id, &hint_key, &hint_val);
    EINA_SAFETY_ON_FALSE_GOTO(res, finish);
 
-   runner->insertEventQueue(win, E_TC_EVENT_TYPE_AUX_HINT_CHANGED);
+   hint = std::make_shared<auxHintEventItem>(win, E_TC_EVENT_TYPE_AUX_HINT_CHANGED, hint_id, hint_key, hint_val);
+   EINA_SAFETY_ON_NULL_GOTO(hint, finish);
+
+   runner->insertEventQueue(hint);
 
 finish:
    if ((name) || (text))
index 908957f..c8c7fd5 100644 (file)
@@ -31,6 +31,34 @@ protected:
    E_TC_Event_Type type;
 };
 
+class auxHintEventItem : public eventItem
+{
+public:
+   auxHintEventItem() = delete;
+   auxHintEventItem (Ecore_Window win, E_TC_Event_Type type, int id, const char *hint, const char *val) :
+   eventItem(win, type),
+   id(id),
+   hint(std::string(hint)),
+   val(std::string(val))
+   {
+   }
+   ~auxHintEventItem()
+   {
+   }
+
+   Eina_Bool isSameID(int id) { return id == this->id; }
+   Eina_Bool isSameHint(std::string hint) { return !strncmp(hint.c_str(), this->hint.c_str(), hint.size()); }
+   Eina_Bool isSameVal(std::string val) { return val == this->val; }
+   int getID() { return this->id; }
+   std::string getHint() { return this->hint; }
+   std::string getVal() { return this->val; }
+
+private:
+   int id;
+   std::string hint;
+   std::string val;
+};
+
 class etRunner
 {
 private: