The elements of enumeration are changed.
Change-Id: I0c084f1fd88761bac580d3a840a1485dbdf41e9d
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
* @since_tizen 5.5
*/
typedef enum {
- COMPONENT_STATE_UNDEFINED, /**< The undefined state. */
- COMPONENT_STATE_FOREGROUND, /**< The frame component is running in the foreground. */
- COMPONENT_STATE_BACKGROUND, /**< The frame component is running in the background. */
- COMPONENT_STATE_SERVICE, /**< The service component is running. */
- COMPONENT_STATE_TERMINATED, /**< The component is terminated. */
+ COMPONENT_STATE_INITIALIZED, /**< The initialized state. This is the state when the component is constructed but the create callback is not called yet */
+ COMPONENT_STATE_CREATED, /**< The created state. This state is reached after the create callback is called. */
+ COMPONENT_STATE_STARTED, /**< The started state. This state is reached after the start callback is called. */
+ COMPONENT_STATE_RESUMED, /**< The resumed state. This state is reached after the resume callback is called. */
+ COMPONENT_STATE_PAUSED, /**< The paused state. This state is reached after the pause callback is called. */
+ COMPONENT_STATE_DESTROYED, /**< The destroyed state. This state is reached right before the destroy callback call. */
} component_state_e;
/**
component_state_e state;
switch (status) {
- case STATUS_VISIBLE:
- state = COMPONENT_STATE_FOREGROUND;
+ case COMP_STATUS_INITIALIZED:
+ state = COMPONENT_STATE_INITIALIZED;
break;
- case STATUS_LAUNCHING:
- case STATUS_BG:
- state = COMPONENT_STATE_BACKGROUND;
+ case COMP_STATUS_CREATED:
+ state = COMPONENT_STATE_CREATED;
break;
- case STATUS_SERVICE:
- state = COMPONENT_STATE_SERVICE;
+ case COMP_STATUS_STARTED:
+ state = COMPONENT_STATE_STARTED;
break;
- case STATUS_TERMINATE:
- state = COMPONENT_STATE_TERMINATED;
+ case COMP_STATUS_RESUMED:
+ state = COMPONENT_STATE_RESUMED;
+ break;
+ case COMP_STATUS_PAUSED:
+ state = COMPONENT_STATE_PAUSED;
break;
default:
- state = COMPONENT_STATE_UNDEFINED;
+ state = COMPONENT_STATE_DESTROYED;
break;
}
--- /dev/null
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef UNIT_TESTS_MOCK_MOCK_AUL_COMP_TYPES_H__
+#define UNIT_TESTS_MOCK_MOCK_AUL_COMP_TYPES_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum {
+ COMP_STATUS_INITIALIZED,
+ COMP_STATUS_CREATED,
+ COMP_STATUS_STARTED,
+ COMP_STATUS_RESUMED,
+ COMP_STATUS_PAUSED,
+ COMP_STATUS_DESTROYED,
+} comp_status_e;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // UNIT_TESTS_MOCK_MOCK_AUL_COMP_TYPES_H__
#include <iostream>
#include <memory>
+#include "mock_aul_comp_types.h"
#include "mock_aul_comp_context.h"
#include "component_manager.h"
static int __fake_aul_comp_context_get_status(aul_comp_context_h handle,
int* status) {
- *status = STATUS_VISIBLE;
+ *status = COMP_STATUS_RESUMED;
return AUL_R_OK;
}
TEST_F(ComponentContextTest, component_context_get_component_state_Positive) {
component_context_h handle = GetHandle();
- component_state_e state = COMPONENT_STATE_UNDEFINED;
+ component_state_e state = COMPONENT_STATE_INITIALIZED;
int ret = component_context_get_component_state(handle, &state);
EXPECT_EQ(ret, COMPONENT_MANAGER_ERROR_NONE);
- EXPECT_EQ(state, COMPONENT_STATE_FOREGROUND);
+ EXPECT_EQ(state, COMPONENT_STATE_RESUMED);
}
TEST_F(ComponentContextTest, component_context_get_component_state_Negative) {