{
blink::WebView* view = render_view()->GetWebView();
if (view && view->settings()) {
- view->settings()->setShrinksViewportContentToFit(web_preferences_efl.shrinks_viewport_content_to_fit);
+ blink::WebSettings* settings = view->settings();
+ settings->setShrinksViewportContentToFit(web_preferences_efl.shrinks_viewport_content_to_fit);
+ // Allows resetting the scale factor when "auto fitting" gets disabled.
+ settings->setLoadWithOverviewMode(web_preferences_efl.shrinks_viewport_content_to_fit);
// and more if they exist in web_preferences_efl.
}
settings = ewk_view_settings_get(GetEwkWebView());
ASSERT_TRUE(settings);
// make sure default value is proper
- ASSERT_EQ(EINA_FALSE, ewk_settings_scripts_can_open_windows_get(settings));
+ ASSERT_EQ(EINA_TRUE, ewk_settings_scripts_can_open_windows_get(settings));
}
protected:
/**
* @brief Positive test case of ewk_settings_scripts_can_open_windows_get()
*/
-TEST_F(utc_blink_ewk_settings_scripts_can_open_windows_get, SetTrue)
+TEST_F(utc_blink_ewk_settings_scripts_can_open_windows_get, SetFalse)
{
// toggle option
- ASSERT_EQ(EINA_TRUE, ewk_settings_scripts_can_open_windows_set(settings, EINA_TRUE));
+ ASSERT_EQ(EINA_TRUE, ewk_settings_scripts_can_open_windows_set(settings, EINA_FALSE));
// check if option was toggled
- ASSERT_EQ(EINA_TRUE, ewk_settings_scripts_can_open_windows_get(settings));
+ ASSERT_EQ(EINA_FALSE, ewk_settings_scripts_can_open_windows_get(settings));
}
/**
/**
* @brief Positive test case of ewk_settings_scripts_can_open_windows_set()
*/
-TEST_F(utc_blink_ewk_settings_scripts_can_open_windows_set, SetTrue)
+TEST_F(utc_blink_ewk_settings_scripts_can_open_windows_set, SetFalse)
{
- // first check if new windows are blocked
+ // first check if new windows are created
char htmlBuffer[] = "<html>"
"<head></head>"
"<body onload=\"window.open('http://www.google.com/')\"></body>"
// check if option was toggled
ASSERT_EQ(EINA_FALSE, ewk_settings_scripts_can_open_windows_get(settings));
- // reload page and expect create window smart callback
+ // reload page and expect popup,blocked window smart callback
ASSERT_EQ(EINA_TRUE, ewk_view_html_string_load(GetEwkWebView(), htmlBuffer, NULL, NULL));
ASSERT_EQ(Success, EventLoopStart());
}
// it may not work. This TC checks such case and tests provided solution
// toggle option
- ASSERT_EQ(EINA_TRUE, ewk_settings_scripts_can_open_windows_set(settings, EINA_TRUE));
+ ASSERT_EQ(EINA_TRUE, ewk_settings_scripts_can_open_windows_set(settings, EINA_FALSE));
// check if option was toggled
- ASSERT_EQ(EINA_TRUE, ewk_settings_scripts_can_open_windows_get(settings));
+ ASSERT_EQ(EINA_FALSE, ewk_settings_scripts_can_open_windows_get(settings));
char htmlBuffer[] = "<html>"
"<head></head>"
"</html>";
ASSERT_EQ(EINA_TRUE, ewk_view_html_string_load(GetEwkWebView(), htmlBuffer, NULL, NULL));
- // Expect that window,create is called - option did work
- ASSERT_EQ(Failure, EventLoopStart());
+ // Expect that popup,blocked is called - option did work
+ ASSERT_EQ(Success, EventLoopStart());
// toggle option again
- ASSERT_EQ(EINA_TRUE, ewk_settings_scripts_can_open_windows_set(settings, EINA_FALSE));
+ ASSERT_EQ(EINA_TRUE, ewk_settings_scripts_can_open_windows_set(settings, EINA_TRUE));
// check if option was toggled
- ASSERT_EQ(EINA_FALSE, ewk_settings_scripts_can_open_windows_get(settings));
+ ASSERT_EQ(EINA_TRUE, ewk_settings_scripts_can_open_windows_get(settings));
- // reload page and expect create window smart callback
+ // reload page and expect create,window smart callback
ASSERT_EQ(EINA_TRUE, ewk_view_html_string_load(GetEwkWebView(), htmlBuffer, NULL, NULL));
- // window.open should be blocked again - popup,blocked smart callback should be invoked
- ASSERT_EQ(Success, EventLoopStart());
+ ASSERT_EQ(Failure, EventLoopStart());
}
/**
settings = ewk_view_settings_get(GetEwkWebView());
ASSERT_TRUE(settings);
// make sure default value is proper
- ASSERT_EQ(EINA_FALSE, ewk_settings_scripts_window_open_get(settings));
+ ASSERT_EQ(EINA_TRUE, ewk_settings_scripts_window_open_get(settings));
}
protected:
/**
* @brief Positive test case of ewk_settings_scripts_window_open_get()
*/
-TEST_F(utc_blink_ewk_settings_scripts_window_open_get, SetTrue)
+TEST_F(utc_blink_ewk_settings_scripts_window_open_get, SetFalse)
{
// toggle option
- ASSERT_EQ(EINA_TRUE, ewk_settings_scripts_window_open_set(settings, EINA_TRUE));
+ ASSERT_EQ(EINA_TRUE, ewk_settings_scripts_window_open_set(settings, EINA_FALSE));
// check if option was toggled
- ASSERT_EQ(EINA_TRUE, ewk_settings_scripts_window_open_get(settings));
+ ASSERT_EQ(EINA_FALSE, ewk_settings_scripts_window_open_get(settings));
}
/**
settings = ewk_view_settings_get(GetEwkWebView());
ASSERT_TRUE(settings);
// make sure default value is proper
- ASSERT_EQ(EINA_FALSE, ewk_settings_scripts_window_open_get(settings));
+ ASSERT_EQ(EINA_TRUE, ewk_settings_scripts_window_open_get(settings));
evas_object_smart_callback_add(GetEwkWebView(), "popup,blocked", ToSmartCallback(popup_blocked_cb), this);
evas_object_smart_callback_add(GetEwkWebView(), "create,window", ToSmartCallback(create_window_cb), this);
/**
* @brief Positive test case of ewk_settings_scripts_window_open_set()
*/
-TEST_F(utc_blink_ewk_settings_scripts_window_open_set, SetTrue)
+TEST_F(utc_blink_ewk_settings_scripts_window_open_set, SetFalse)
{
- // first check if new windows are blocked
+ // first check if new windows are created
char htmlBuffer[] = "<html>"
"<head></head>"
"<body onload=\"window.open('http://www.google.com/')\"></body>"
"</html>";
ASSERT_EQ(EINA_TRUE, ewk_view_html_string_load(GetEwkWebView(), htmlBuffer, NULL, NULL));
- ASSERT_EQ(Success, EventLoopStart());
+ ASSERT_EQ(Failure, EventLoopStart());
// now toggle option
- ASSERT_EQ(EINA_TRUE, ewk_settings_scripts_window_open_set(settings, EINA_TRUE));
+ ASSERT_EQ(EINA_TRUE, ewk_settings_scripts_window_open_set(settings, EINA_FALSE));
// check if option was toggled
- ASSERT_EQ(EINA_TRUE, ewk_settings_scripts_window_open_get(settings));
+ ASSERT_EQ(EINA_FALSE, ewk_settings_scripts_window_open_get(settings));
- // reload page and expect create window smart callback
+ // reload page and expect popup,blocked smart callback
ASSERT_EQ(EINA_TRUE, ewk_view_html_string_load(GetEwkWebView(), htmlBuffer, NULL, NULL));
- ASSERT_EQ(Failure, EventLoopStart());
+ ASSERT_EQ(Success, EventLoopStart());
}
TEST_F(utc_blink_ewk_settings_scripts_window_open_set, ToggleBeforeLoad)
// it may not work. This TC checks such case and tests provided solution
// toggle option
- ASSERT_EQ(EINA_TRUE, ewk_settings_scripts_window_open_set(settings, EINA_TRUE));
+ ASSERT_EQ(EINA_TRUE, ewk_settings_scripts_window_open_set(settings, EINA_FALSE));
// check if option was toggled
- ASSERT_EQ(EINA_TRUE, ewk_settings_scripts_window_open_get(settings));
+ ASSERT_EQ(EINA_FALSE, ewk_settings_scripts_window_open_get(settings));
char htmlBuffer[] = "<html>"
"<head></head>"
"</html>";
ASSERT_EQ(EINA_TRUE, ewk_view_html_string_load(GetEwkWebView(), htmlBuffer, NULL, NULL));
- // Expect that window,create is called - option did work
- ASSERT_EQ(Failure, EventLoopStart());
+ // Expect that popup,blocked is called - option did work
+ ASSERT_EQ(Success, EventLoopStart());
// toggle option again
- ASSERT_EQ(EINA_TRUE, ewk_settings_scripts_window_open_set(settings, EINA_FALSE));
+ ASSERT_EQ(EINA_TRUE, ewk_settings_scripts_window_open_set(settings, EINA_TRUE));
// check if option was toggled
- ASSERT_EQ(EINA_FALSE, ewk_settings_scripts_window_open_get(settings));
+ ASSERT_EQ(EINA_TRUE, ewk_settings_scripts_window_open_get(settings));
- // reload page and expect create window smart callback
+ // reload page and expect create,window smart callback
ASSERT_EQ(EINA_TRUE, ewk_view_html_string_load(GetEwkWebView(), htmlBuffer, NULL, NULL));
- // window.open should be blocked again - popup,blocked smart callback should be invoked
- ASSERT_EQ(Success, EventLoopStart());
+ ASSERT_EQ(Failure, EventLoopStart());
}
/**