#include "tc_main.h"
#include "mockclient.h"
#include "mockcompositor.h"
-#include <libds-tizen/launch/appinfo.h>
+#include <libds-tizen/launch.h>
#include <tizen-launch-server-protocol.h>
#include <tizen-launch-client-protocol.h>
#define TIZEN_APPINFO_VERSION 1
-class MockAppinfoCompositor : public MockCompositor
+class MockLaunchAppinfoCompositor : public MockCompositor
{
public:
- MockAppinfoCompositor()
- : MockCompositor(&MockAppinfoCompositor::TestSetup, this)
+ MockLaunchAppinfoCompositor()
+ : MockCompositor(&MockLaunchAppinfoCompositor::TestSetup, this)
{
ds_inf("%s : this(%p)", __func__, this);
bMetadataReady = false;
}
- ~MockAppinfoCompositor()
+ ~MockLaunchAppinfoCompositor()
{
ds_inf("%s : this(%p)", __func__, this);
}
static void TestSetup(void *data)
{
- MockAppinfoCompositor *mockComp =
- static_cast<MockAppinfoCompositor *>(data);
+ MockLaunchAppinfoCompositor *mockComp =
+ static_cast<MockLaunchAppinfoCompositor *>(data);
Compositor *comp = mockComp->compositor;
ds_inf("%s: mockComp(%p)", __func__, mockComp);
- mockComp->mAppinfoMgr = ds_tizen_appinfo_mgr_create(comp->display);
+ mockComp->mAppinfoMgr = ds_tizen_launch_appinfo_mgr_create(comp->display);
// destroy listener
mockComp->mDestroyListener.notify =
- MockAppinfoCompositor::DestroyCallback;
+ MockLaunchAppinfoCompositor::DestroyCallback;
mockComp->mDestroyListener.parent = mockComp;
- ds_tizen_appinfo_mgr_add_destroy_listener(mockComp->mAppinfoMgr,
+ ds_tizen_launch_appinfo_mgr_add_destroy_listener(mockComp->mAppinfoMgr,
&mockComp->mDestroyListener);
// set_pid listener
mockComp->mSetPidListener.notify =
- MockAppinfoCompositor::SetPidCallback;
+ MockLaunchAppinfoCompositor::SetPidCallback;
mockComp->mSetPidListener.parent = mockComp;
- ds_tizen_appinfo_mgr_add_set_pid_listener(mockComp->mAppinfoMgr,
+ ds_tizen_launch_appinfo_mgr_add_set_pid_listener(mockComp->mAppinfoMgr,
&mockComp->mSetPidListener);
// set_appid listener
mockComp->mSetAppidListener.notify =
- MockAppinfoCompositor::SetAppidCallback;
+ MockLaunchAppinfoCompositor::SetAppidCallback;
mockComp->mSetAppidListener.parent = mockComp;
- ds_tizen_appinfo_mgr_add_set_appid_listener(mockComp->mAppinfoMgr,
+ ds_tizen_launch_appinfo_mgr_add_set_appid_listener(mockComp->mAppinfoMgr,
&mockComp->mSetAppidListener);
// metadata_ready listener
mockComp->mMetadataReadyListener.notify =
- MockAppinfoCompositor::MetadataReadyCallback;
+ MockLaunchAppinfoCompositor::MetadataReadyCallback;
mockComp->mMetadataReadyListener.parent = mockComp;
- ds_tizen_appinfo_mgr_add_metadata_ready_listener(
+ ds_tizen_launch_appinfo_mgr_add_metadata_ready_listener(
mockComp->mAppinfoMgr,
&mockComp->mMetadataReadyListener);
}
{
ds_inf("%s", __func__);
- MockAppinfoCompositor *mockComp =
+ MockLaunchAppinfoCompositor *mockComp =
reinterpret_cast<DestroyListener *>(listener)->parent;
mockComp->bDestroyed = true;
{
ds_inf("%s", __func__);
- MockAppinfoCompositor *mockComp =
+ MockLaunchAppinfoCompositor *mockComp =
reinterpret_cast<SetPidListener *>(listener)->parent;
- struct ds_tizen_appinfo *info = static_cast<struct ds_tizen_appinfo *>(data);
+ struct ds_tizen_launch_appinfo *info = static_cast<struct ds_tizen_launch_appinfo *>(data);
ds_inf("%s: mockComp(%p), appinfo(%p)", __func__, mockComp, info);
{
ds_inf("%s", __func__);
- MockAppinfoCompositor *mockComp =
+ MockLaunchAppinfoCompositor *mockComp =
reinterpret_cast<SetAppidListener *>(listener)->parent;
- struct ds_tizen_appinfo *info = static_cast<struct ds_tizen_appinfo *>(data);
+ struct ds_tizen_launch_appinfo *info = static_cast<struct ds_tizen_launch_appinfo *>(data);
ds_inf("%s: mockComp(%p), appinfo(%p)", __func__, mockComp, info);
{
ds_inf("%s", __func__);
- MockAppinfoCompositor *mockComp =
+ MockLaunchAppinfoCompositor *mockComp =
reinterpret_cast<MetadataReadyListener *>(listener)->parent;
- struct ds_tizen_appinfo *info = static_cast<struct ds_tizen_appinfo *>(data);
+ struct ds_tizen_launch_appinfo *info = static_cast<struct ds_tizen_launch_appinfo *>(data);
ds_inf("%s: mockComp(%p), appinfo(%p)", __func__, mockComp, info);
{
ds_inf("%s", __func__);
- wl_resource *res_appinfo = ds_tizen_appinfo_mgr_get_appinfo_resource(mAppinfoMgr);
+ wl_resource *res_appinfo = ds_tizen_launch_appinfo_mgr_get_appinfo_resource(mAppinfoMgr);
tizen_launch_appinfo_send_base_output_resolution_done(res_appinfo, pid, width, height);
}
bool bMetadataReady;
private:
- struct ds_tizen_appinfo_mgr *mAppinfoMgr;
+ struct ds_tizen_launch_appinfo_mgr *mAppinfoMgr;
struct DestroyListener: ::wl_listener {
- MockAppinfoCompositor *parent;
+ MockLaunchAppinfoCompositor *parent;
};
DestroyListener mDestroyListener;
struct SetPidListener: ::wl_listener {
- MockAppinfoCompositor *parent;
+ MockLaunchAppinfoCompositor *parent;
};
SetPidListener mSetPidListener;
struct SetAppidListener: ::wl_listener {
- MockAppinfoCompositor *parent;
+ MockLaunchAppinfoCompositor *parent;
};
SetAppidListener mSetAppidListener;
struct MetadataReadyListener: ::wl_listener {
- MockAppinfoCompositor *parent;
+ MockLaunchAppinfoCompositor *parent;
};
MetadataReadyListener mMetadataReadyListener;
};
-class MockAppinfoClient : public MockClient
+class MockLaunchAppinfoClient : public MockClient
{
public:
- MockAppinfoClient()
+ MockLaunchAppinfoClient()
: bBaseOutputResolutionDone(false),
mBaseOutputResolutionWidth(0),
mBaseOutputResolutionHeight(0),
compositor_res(nullptr),
tizen_launch_appinfo(nullptr)
{}
- MockAppinfoClient(const struct wl_registry_listener *listener)
+ MockLaunchAppinfoClient(const struct wl_registry_listener *listener)
: MockClient(listener, this)
{
ds_inf("%s", __func__);
mBaseOutputResolutionWidth = 0;
mBaseOutputResolutionHeight = 0;
}
- ~MockAppinfoClient()
+ ~MockLaunchAppinfoClient()
{
ds_inf("%s", __func__);
}
return compositor_res;
}
- void SetTizenAppinfo(struct tizen_launch_appinfo *global_res)
+ void SetTizenLaunchAppinfo(struct tizen_launch_appinfo *global_res)
{
ds_inf("%s", __func__);
tizen_launch_appinfo = global_res;
}
- struct tizen_launch_appinfo *GetTizenAppinfo()
+ struct tizen_launch_appinfo *GetTizenLaunchAppinfo()
{
ds_inf("%s", __func__);
{
ds_inf("%s", __func__);
- MockAppinfoClient *client = static_cast<MockAppinfoClient *>(data);
+ MockLaunchAppinfoClient *client = static_cast<MockLaunchAppinfoClient *>(data);
client->bBaseOutputResolutionDone = true;
client->mBaseOutputResolutionWidth = width;
{
ds_inf("%s", __func__);
- MockAppinfoClient *client = static_cast<MockAppinfoClient *>(data);
+ MockLaunchAppinfoClient *client = static_cast<MockLaunchAppinfoClient *>(data);
struct wl_compositor *compositor_res;
struct tizen_launch_appinfo *tizen_launch_appinfo;
ds_err("wl_registry_bind() failed. tizen_launch_appinfo resource.");
return;
}
- client->SetTizenAppinfo(tizen_launch_appinfo);
+ client->SetTizenLaunchAppinfo(tizen_launch_appinfo);
tizen_launch_appinfo_add_listener(tizen_launch_appinfo, &appinfo_cb_listener,
client);
{
ds_inf("%s", __func__);
- MockAppinfoClient *client = static_cast<MockAppinfoClient *>(data);
+ MockLaunchAppinfoClient *client = static_cast<MockLaunchAppinfoClient *>(data);
struct wl_compositor *compositor_res = client->GetWlCompositor();
- struct tizen_launch_appinfo *appinfo_res = client->GetTizenAppinfo();
+ struct tizen_launch_appinfo *appinfo_res = client->GetTizenLaunchAppinfo();
tizen_launch_appinfo_destroy(appinfo_res);
wl_compositor_destroy(compositor_res);
.global_remove = client_registry_cb_global_remove
};
-class AppinfoTest : public ::testing::Test
+class LaunchAppinfoTest : public ::testing::Test
{
public:
void SetUp(void) override;
void TearDown(void) override;
- MockAppinfoCompositor *comp;
- MockAppinfoClient *client;
+ MockLaunchAppinfoCompositor *comp;
+ MockLaunchAppinfoClient *client;
struct wl_compositor *compositor_res;
struct tizen_launch_appinfo *appinfo_res;
};
void
-AppinfoTest::SetUp(void)
+LaunchAppinfoTest::SetUp(void)
{
ds_inf("%s", __func__);
- comp = new MockAppinfoCompositor();
- client = new MockAppinfoClient(®istry_listener);
+ comp = new MockLaunchAppinfoCompositor();
+ client = new MockLaunchAppinfoClient(®istry_listener);
compositor_res = client->GetWlCompositor();
- appinfo_res = client->GetTizenAppinfo();
+ appinfo_res = client->GetTizenLaunchAppinfo();
client->RoundTrip();
}
void
-AppinfoTest::TearDown(void)
+LaunchAppinfoTest::TearDown(void)
{
ds_inf("%s", __func__);
delete comp;
}
-TEST_F(AppinfoTest, Create_P)
+TEST_F(LaunchAppinfoTest, Create_P)
{
EXPECT_TRUE(true);
}
-TEST_F(AppinfoTest, Req_TizenAppinfoRegisterPid)
+TEST_F(LaunchAppinfoTest, Req_TizenLaunchAppinfoRegisterPid)
{
uint32_t pid = 1234;
EXPECT_TRUE(comp->bSetPid);
}
-TEST_F(AppinfoTest, Req_TizenAppinfoSetAppid)
+TEST_F(LaunchAppinfoTest, Req_TizenLaunchAppinfoSetAppid)
{
uint32_t pid = 1234;
const char *appid = "org.tizen.libds-tizen-appinfo-test";
EXPECT_TRUE(comp->bSetAppid);
}
-TEST_F(AppinfoTest, Req_TizenAppinfoRegisterAppid)
+TEST_F(LaunchAppinfoTest, Req_TizenLaunchAppinfoRegisterAppid)
{
const char *appid = "org.tizen.libds-tizen-appinfo-test";
EXPECT_TRUE(comp->bSetAppid);
}
-TEST_F(AppinfoTest, Req_TizenAppinfoSetPid)
+TEST_F(LaunchAppinfoTest, Req_TizenLaunchAppinfoSetPid)
{
uint32_t pid = 1234;
const char *appid = "org.tizen.libds-tizen-appinfo-test";
EXPECT_TRUE(comp->bSetPid);
}
-TEST_F(AppinfoTest, Req_TizenAppinfoMetadataReady)
+TEST_F(LaunchAppinfoTest, Req_TizenLaunchAppinfoMetadataReady)
{
const char *appid = "org.tizen.libds-tizen-appinfo-test";
uint32_t pid = 1234;
EXPECT_TRUE(comp->bMetadataReady);
}
-TEST_F(AppinfoTest, Req_TizenAppinfoGetBaseOutputResolution)
+TEST_F(LaunchAppinfoTest, Req_TizenLaunchAppinfoGetBaseOutputResolution)
{
uint32_t pid = 1234;
EXPECT_TRUE(client->mBaseOutputResolutionHeight == 1920); // default value
}
-TEST_F(AppinfoTest, Ev_TizenAppinfoBaseOutputResolutionDone)
+TEST_F(LaunchAppinfoTest, Ev_TizenLaunchAppinfoBaseOutputResolutionDone)
{
uint32_t pid = 1234, width = 1920, height = 1080;