Ewk_List_Style_Position ewk_settings_initial_list_style_position_get(const Ewk_Settings* settings)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(settings, EWK_LIST_STYLE_POSITION_OUTSIDE);
- // TODO: To be used when the functionality is required.
-#if !defined(EWK_BRINGUP)
return static_cast<Ewk_List_Style_Position>(settings->getPreferences().initial_list_style_position);
-#else
- return static_cast<Ewk_List_Style_Position>(0);
-#endif
}
Eina_Bool ewk_settings_initial_list_style_position_set(Ewk_Settings* settings, Ewk_List_Style_Position style)
{
- EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
-#if !defined(EWK_BRINGUP)
- settings->getPreferences().initial_list_style_position = static_cast<webkit_glue::ListStylePosition>(style);
-#endif
+ EINA_SAFETY_ON_NULL_RETURN_VAL(settings, EINA_FALSE);
+ settings->getPreferences().initial_list_style_position = static_cast<content::ListStylePosition>(style);
ewkUpdateWebkitPreferences(settings->getEvasObject());
- return true;
+ return EINA_TRUE;
}
Eina_Bool ewk_settings_webkit_text_size_adjust_enabled_set(Ewk_Settings* settings, Eina_Bool enabled)
--- /dev/null
+<html><head>
+ <title>List items</title>
+</head><body>
+<ul id="ul1">List items
+ <li id="li1">List item 1</li>
+ <li>List item 2</li>
+ <li>List item 3</li>
+</ul>
+<ul id="ul2" style="list-style-position: inside;">List items inside
+ <li id="li2">List item 1</li>
+ <li>List item 2</li>
+ <li>List item 3</li>
+</ul>
+<ul id="ul3" style="list-style-position: outside;">List items outside
+ <li id="li3">List item 1</li>
+ <li>List item 2</li>
+ <li>List item 3</li>
+</ul>
+<script type="text/javascript">
+ var ul1 = document.getElementById('ul1')
+ var css = window.getComputedStyle(ul1, null)
+ console.log(css.getPropertyValue('list-style-position'))
+</script>
+</body></html>
#include "utc_blink_ewk_base.h"
-class utc_blink_ewk_settings_initial_list_style_position_get : public utc_blink_ewk_base {
-};
+class utc_blink_ewk_settings_initial_list_style_position_get : public utc_blink_ewk_base
+{
+protected:
+ void PostSetUp()
+ {
+ settings = ewk_view_settings_get(GetEwkWebView());
+ }
+protected:
+ Ewk_Settings *settings;
+};
/**
-* @brief checking if returns EWK_LIST_STYLE_POSITION_OUTSIDE when initiated with a correct webview and
-* initial list style position set to EWK_LIST_STYLE_POSITION_OUTSIDE.
+* @brief checking if returns EWK_LIST_STYLE_POSITION_OUTSIDE when initiated with NULL webview.
*/
-TEST_F(utc_blink_ewk_settings_initial_list_style_position_get, POS_TEST1)
+TEST_F(utc_blink_ewk_settings_initial_list_style_position_get, NullArg)
{
- Ewk_Settings *settings = ewk_view_settings_get(GetEwkWebView());
- if (!settings) {
- FAIL();
- }
-
- Eina_Bool result = ewk_settings_initial_list_style_position_set(settings, EWK_LIST_STYLE_POSITION_OUTSIDE);
- if (!result) {
- FAIL();
- }
- EXPECT_EQ(ewk_settings_initial_list_style_position_get(settings), EWK_LIST_STYLE_POSITION_OUTSIDE);
+ EXPECT_EQ(EWK_LIST_STYLE_POSITION_OUTSIDE,
+ ewk_settings_initial_list_style_position_get(NULL));
}
/**
-* @brief checking if returns EWK_LIST_STYLE_POSITION_INSIDE when initiated with a correct webview and
-* initial list style position set to EWK_LIST_STYLE_POSITION_INSIDE.
+* @brief checking if returns EWK_LIST_STYLE_POSITION_INSIDE when initiated with a correct webview
+* and initial list style position set to EWK_LIST_STYLE_POSITION_INSIDE.
*/
-TEST_F(utc_blink_ewk_settings_initial_list_style_position_get, POS_TEST2)
+TEST_F(utc_blink_ewk_settings_initial_list_style_position_get, INSIDE)
{
- Ewk_Settings *settings = ewk_view_settings_get(GetEwkWebView());
- if (!settings) {
- FAIL();
- }
-
- Eina_Bool result = ewk_settings_initial_list_style_position_set(settings, EWK_LIST_STYLE_POSITION_INSIDE);
- if (!result) {
- FAIL();
- }
- EXPECT_EQ(ewk_settings_initial_list_style_position_get(settings), EWK_LIST_STYLE_POSITION_INSIDE);
+ ASSERT_TRUE(settings);
+ EXPECT_EQ(EINA_TRUE,
+ ewk_settings_initial_list_style_position_set(settings, EWK_LIST_STYLE_POSITION_INSIDE));
+ EXPECT_EQ(EWK_LIST_STYLE_POSITION_INSIDE, ewk_settings_initial_list_style_position_get(settings));
}
/**
-* @brief checking if returns EWK_LIST_STYLE_POSITION_OUTSIDE when initiated with NULL webview.
+* @brief checking if returns EWK_LIST_STYLE_POSITION_OUTSIDE when initiated with a correct webview
+* and initial list style position set to EWK_LIST_STYLE_POSITION_OUTSIDE.
*/
-TEST_F(utc_blink_ewk_settings_initial_list_style_position_get, NEG_TEST)
+TEST_F(utc_blink_ewk_settings_initial_list_style_position_get, OUTSIDE)
{
- Ewk_List_Style_Position result = ewk_settings_initial_list_style_position_get(NULL);
- EXPECT_EQ(result, EWK_LIST_STYLE_POSITION_OUTSIDE);
+ ASSERT_TRUE(settings);
+ EXPECT_EQ(EINA_TRUE,
+ ewk_settings_initial_list_style_position_set(settings, EWK_LIST_STYLE_POSITION_OUTSIDE));
+ EXPECT_EQ(EWK_LIST_STYLE_POSITION_OUTSIDE,
+ ewk_settings_initial_list_style_position_get(settings));
}
#include "utc_blink_ewk_base.h"
-class utc_blink_ewk_settings_initial_list_style_position_set : public utc_blink_ewk_base {
+class utc_blink_ewk_settings_initial_list_style_position_set : public utc_blink_ewk_base
+{
+ protected:
+ utc_blink_ewk_settings_initial_list_style_position_set()
+ : settings(NULL)
+ , list_style_position(NULL)
+ {
+ }
+
+ ~utc_blink_ewk_settings_initial_list_style_position_set()
+ {
+ eina_stringshare_del(list_style_position);
+ }
+
+ void PostSetUp()
+ {
+ settings = ewk_view_settings_get(GetEwkWebView());
+ ASSERT_TRUE(settings);
+ }
+
+ virtual void ConsoleMessage(Evas_Object* webview, const Ewk_Console_Message* msg)
+ {
+ utc_blink_ewk_base::ConsoleMessage(webview, msg);
+
+ if (!list_style_position) {
+ list_style_position = eina_stringshare_add(ewk_console_message_text_get(msg));
+ }
+
+ EventLoopStop(Success);
+ }
+
+ protected:
+ Ewk_Settings *settings;
+ Eina_Stringshare *list_style_position;
};
+
/**
-* @brief checking if returns EWK_LIST_STYLE_POSITION_OUTSIDE when initiated with a correct webview and
-* initial list style position set to EWK_LIST_STYLE_POSITION_OUTSIDE.
+* @brief checking if returns FALSE when initiated with NULL webview.
*/
-TEST_F(utc_blink_ewk_settings_initial_list_style_position_set, POS_TEST1)
+TEST_F(utc_blink_ewk_settings_initial_list_style_position_set, NullArg)
{
- Ewk_Settings *settings = ewk_view_settings_get(GetEwkWebView());
- if (!settings) {
- FAIL();
- }
-
- Eina_Bool result = ewk_settings_initial_list_style_position_set(settings, EWK_LIST_STYLE_POSITION_OUTSIDE);
- if (!result) {
- FAIL();
- }
- EXPECT_EQ(ewk_settings_initial_list_style_position_get(settings), EWK_LIST_STYLE_POSITION_OUTSIDE);
+ EXPECT_EQ(EINA_FALSE,
+ ewk_settings_initial_list_style_position_set(NULL, EWK_LIST_STYLE_POSITION_INSIDE));
}
/**
-* @brief checking if returns EWK_LIST_STYLE_POSITION_INSIDE when initiated with a correct webview and
-* initial list style position set to EWK_LIST_STYLE_POSITION_INSIDE.
+* @brief checking if returns EWK_LIST_STYLE_POSITION_INSIDE when initiated with a correct webview
+* and initial list style position set to EWK_LIST_STYLE_POSITION_INSIDE.
*/
-TEST_F(utc_blink_ewk_settings_initial_list_style_position_set, POS_TEST2)
+TEST_F(utc_blink_ewk_settings_initial_list_style_position_set, inside)
{
- Ewk_Settings *settings = ewk_view_settings_get(GetEwkWebView());
- if (!settings) {
- FAIL();
- }
+ EXPECT_EQ(EINA_TRUE,
+ ewk_settings_initial_list_style_position_set(settings, EWK_LIST_STYLE_POSITION_INSIDE));
- Eina_Bool result = ewk_settings_initial_list_style_position_set(settings, EWK_LIST_STYLE_POSITION_INSIDE);
- if (!result) {
- FAIL();
- }
- EXPECT_EQ(ewk_settings_initial_list_style_position_get(settings), EWK_LIST_STYLE_POSITION_INSIDE);
+ ASSERT_EQ(EINA_TRUE,
+ ewk_view_url_set(GetEwkWebView(), GetResourceUrl("common/ul_li.html").c_str()));
+ ASSERT_EQ(Success, EventLoopStart());
+
+ ASSERT_TRUE(list_style_position);
+ ASSERT_STREQ("inside", list_style_position);
}
/**
-* @brief checking if returns FALSE when initiated with NULL webview.
+* @brief checking if returns EWK_LIST_STYLE_POSITION_INSIDE when initiated with a correct webview
+* and initial list style position set to EWK_LIST_STYLE_POSITION_OUTSIDE.
*/
-TEST_F(utc_blink_ewk_settings_initial_list_style_position_set, NEG_TEST)
+TEST_F(utc_blink_ewk_settings_initial_list_style_position_set, outside)
{
- Eina_Bool result = ewk_settings_initial_list_style_position_set(NULL, EWK_LIST_STYLE_POSITION_INSIDE);
- EXPECT_EQ(result, EINA_FALSE);
+ EXPECT_EQ(EINA_TRUE,
+ ewk_settings_initial_list_style_position_set(settings, EWK_LIST_STYLE_POSITION_OUTSIDE));
+
+ ASSERT_EQ(EINA_TRUE,
+ ewk_view_url_set(GetEwkWebView(), GetResourceUrl("common/ul_li.html").c_str()));
+ ASSERT_EQ(Success, EventLoopStart());
+
+ ASSERT_TRUE(list_style_position);
+ ASSERT_STREQ("outside", list_style_position);
}