Use ExecuteJavaScriptForTests instead of ExecuteJavaScript
authorArnaud Renevier <a.renevier@samsung.com>
Mon, 23 Nov 2015 23:06:20 +0000 (15:06 -0800)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 07:55:23 +0000 (07:55 +0000)
This ensures that Javascript can be executed (and also, fixes a crash in
unittest utc_blink_ewk_view_script_execute_func.cpp)

Bug: http://web.sec.samsung.net/bugzilla/show_bug.cgi?id=14494

Reviewed by: a1.gomes, sns.park

Change-Id: Ifcdefbacbf796d0eac9455aa1d6f67c017e7058b

tizen_src/ewk/efl_integration/eweb_view.cc

index 846879c..1668a5e 100644 (file)
@@ -785,7 +785,10 @@ bool EWebView::ExecuteJavaScript(const char* script, Ewk_View_Script_Execute_Cal
   base::UTF8ToUTF16(script, strlen(script), &js_script);
   if (callback) {
     JavaScriptCallbackDetails* script_callback_data = new JavaScriptCallbackDetails(callback, userdata, evas_object_);
-    render_frame_host->ExecuteJavaScript(js_script, base::Bind(&JavaScriptComplete, base::Owned(script_callback_data)));
+    // In M47, it isn't possible anymore to execute javascript in the generic
+    // case. We need to call ExecuteJavaScriptForTests to keep the behaviour
+    // unchanged @see https://codereview.chromium.org/1123783002
+    render_frame_host->ExecuteJavaScriptForTests(js_script, base::Bind(&JavaScriptComplete, base::Owned(script_callback_data)));
   } else {
     // We use ExecuteJavaScriptWithUserGestureForTests instead of ExecuteJavaScript because
     // ExecuteJavaScriptWithUserGestureForTests sets user_gesture to true. This was the