return -ENOMEM;
}
+ if (access(PLUGIN_DISPLAY_CONF_FILE, F_OK) == 0)
+ return config_parse(PLUGIN_DISPLAY_CONF_FILE, display_config_parse, g_display_config);
+
return config_parse(DISPLAY_CONF_FILE, display_config_parse, g_display_config);
}
#include <system/syscommon-plugin-deviced-display-interface.h>
#define DISPLAY_CONF_FILE "/etc/deviced/display.conf"
+#define PLUGIN_DISPLAY_CONF_FILE "/etc/deviced/conf.d/display.conf"
/**
* FIXME: Add getters for all member variables not to expose it with extern keyword
#include "syscommon-plugin-test.h"
+#define DISPLAY_FEATURE "http://tizen.org/feature/display"
+
class DisplayTest : public testing::Test {
protected:
void SetUp() override {
display_plugin_backend_supported = true;
else
display_plugin_backend_supported = false;
+
+ ret_val = system_info_get_platform_bool(DISPLAY_FEATURE, &display_feature);
+ if (ret_val < 0)
+ display_feature = false;
}
~DisplayTest() {}
void TearDown() override {}
bool display_plugin_backend_supported;
+ bool display_feature;
};
TEST_F(DisplayTest, LoadConfig)
ret_val = syscommon_plugin_deviced_display_load_config(&display_config);
EXPECT_TRUE(ret_val == 0 || ret_val == -ENOTSUP || ret_val == -EOPNOTSUPP);
}
+
+TEST_F(DisplayTest, CheckDisplayDPMSTypeInHeadless)
+{
+ int ret_val = -1;
+ struct syscommon_deviced_display_config *display_config = NULL;
+
+ if (!display_plugin_backend_supported)
+ return;
+
+ if (display_feature) {
+ DEBUG_MESSAGE("This image is not headless image, display feature is true.");
+ return;
+ }
+
+ ret_val = syscommon_plugin_deviced_display_load_config(&display_config);
+ if (ret_val == 0 && display_config)
+ EXPECT_EQ(display_config->display_dpms_type, SYSCOMMON_DEVICED_DPMS_TYPE_NONE);
+}
\ No newline at end of file