Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / content / browser / renderer_host / render_view_host_browsertest.cc
index b26d355..31ecee9 100644 (file)
@@ -18,8 +18,8 @@
 #include "content/public/test/content_browser_test.h"
 #include "content/public/test/content_browser_test_utils.h"
 #include "content/shell/browser/shell.h"
+#include "net/base/filename_util.h"
 #include "net/base/host_port_pair.h"
-#include "net/base/net_util.h"
 #include "net/test/embedded_test_server/embedded_test_server.h"
 
 namespace content {
@@ -117,4 +117,16 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostTest, BasicRenderFrameHost) {
             new_root->current_frame_host()->routing_id());
 }
 
+IN_PROC_BROWSER_TEST_F(RenderViewHostTest, IsFocusedElementEditable) {
+  ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+
+  GURL test_url = embedded_test_server()->GetURL("/touch_selection.html");
+  NavigateToURL(shell(), test_url);
+
+  RenderViewHost* rvh = shell()->web_contents()->GetRenderViewHost();
+  EXPECT_FALSE(rvh->IsFocusedElementEditable());
+  EXPECT_TRUE(ExecuteScript(shell()->web_contents(), "focus_textfield();"));
+  EXPECT_TRUE(rvh->IsFocusedElementEditable());
+}
+
 }  // namespace content