Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / xwalk / runtime / browser / xwalk_runtime_browsertest.cc
index 09744ee..6e3f772 100644 (file)
@@ -165,9 +165,9 @@ IN_PROC_BROWSER_TEST_F(XWalkRuntimeTest, HTML5FullscreenAPI) {
   EXPECT_TRUE(false == runtime()->window()->IsFullscreen());
 
   FullscreenNotificationObserver enter_observer;
-  runtime()->web_contents()->GetRenderViewHost()->ExecuteJavascriptInWebFrame(
-      base::string16(),
-      base::ASCIIToUTF16("doFullscreenClick();"));
+  bool ret = content::ExecuteScript(
+      runtime()->web_contents(), "doFullscreenClick();");
+  EXPECT_TRUE(ret);
   content::RunAllPendingInMessageLoop();
   enter_observer.Wait();
   // Calling doFullscreenClick defined in fullscreen.html leads to enter into
@@ -175,9 +175,9 @@ IN_PROC_BROWSER_TEST_F(XWalkRuntimeTest, HTML5FullscreenAPI) {
   EXPECT_TRUE(true == runtime()->window()->IsFullscreen());
 
   FullscreenNotificationObserver exit_observer;
-  runtime()->web_contents()->GetRenderViewHost()->ExecuteJavascriptInWebFrame(
-      base::string16(),
-      base::ASCIIToUTF16("doExitFullscreenClick();"));
+  ret = content::ExecuteScript(
+      runtime()->web_contents(), "doExitFullscreenClick();");
+  EXPECT_TRUE(ret);
   content::RunAllPendingInMessageLoop();
   exit_observer.Wait();
   // Calling doExitFullscreenClick defined in fullscreen.html leads to exit
@@ -206,9 +206,8 @@ IN_PROC_BROWSER_TEST_F(XWalkRuntimeTest, OpenLinkInNewRuntime) {
   GURL url = xwalk_test_utils::GetTestURL(
       base::FilePath(), base::FilePath().AppendASCII("new_target.html"));
   xwalk_test_utils::NavigateToURL(runtime(), url);
-  runtime()->web_contents()->GetRenderViewHost()->ExecuteJavascriptInWebFrame(
-      base::string16(),
-      base::ASCIIToUTF16("doClick();"));
+  bool ret = content::ExecuteScript(runtime()->web_contents(), "doClick();");
+  EXPECT_TRUE(ret);
   content::RunAllPendingInMessageLoop();
   // Calling doClick defined in new_target.html leads to open a href in a new
   // target window, and so it is expected to create a new Runtime instance.