Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3827)

Unified Diff: chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc

Issue 2149493004: [refactor] Removing the dead method RenderWidgetHostView::GetSelectedText() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Made const Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc
diff --git a/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc b/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc
index e25a322b3b25e03d4ec16ab89b16c4c44d7c413f..642df281bc542984da87f3fc5b94d605d81a7cd6 100644
--- a/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc
+++ b/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc
@@ -34,6 +34,7 @@
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_test_utils.h"
+#include "content/public/test/text_input_test_utils.h"
#include "extensions/browser/api/extensions_api_client.h"
#include "extensions/browser/app_window/app_window.h"
#include "extensions/browser/app_window/app_window_registry.h"
@@ -1287,11 +1288,11 @@ IN_PROC_BROWSER_TEST_P(WebViewInteractiveTest, DISABLED_Focus_InputMethod) {
#if defined(OS_MACOSX)
IN_PROC_BROWSER_TEST_P(WebViewInteractiveTest, TextSelection) {
-#if defined(OS_MACOSX)
- // TODO(ekaramad): This test is failing under OOPIF for MAC.
+ // TODO(ekaramad): This test is failing under OOPIF for MAC
+ // (crbug.com/582562).
if (GetParam())
return;
-#endif
+
SetupTest("web_view/text_selection",
"/extensions/platform_apps/web_view/text_selection/guest.html");
ASSERT_TRUE(guest_web_contents());
@@ -1306,10 +1307,11 @@ IN_PROC_BROWSER_TEST_P(WebViewInteractiveTest, TextSelection) {
ASSERT_TRUE(ctx_listener.WaitUntilSatisfied());
// Now verify that the selection text propagates properly to RWHV.
- content::RenderWidgetHostView* guest_rwhv =
- guest_web_contents()->GetRenderWidgetHostView();
- ASSERT_TRUE(guest_rwhv);
- std::string selected_text = base::UTF16ToUTF8(guest_rwhv->GetSelectedText());
+ content::RenderWidgetHostView* embedder_rwhv =
+ embedder_web_contents()->GetRenderWidgetHostView();
+ ASSERT_TRUE(embedder_rwhv);
+ std::string selected_text = base::UTF16ToUTF8(
+ content::GetSelectedTextForRenderWidgetHostView(embedder_rwhv));
Charlie Reis 2016/07/13 21:16:52 I don't suppose you can use GetTextFromRange (and
EhsanK 2016/07/13 21:31:41 You are right, but I am afraid it is not possible
Charlie Reis 2016/07/14 18:28:39 Ah, that's unfortunate. Let's put a TODO on the d
EhsanK 2016/07/14 19:09:17 Yes. For me this is were IME becomes complicated.
ASSERT_TRUE(selected_text.size() >= 10u);
ASSERT_EQ("AAAAAAAAAA", selected_text.substr(0, 10));
}

Powered by Google App Engine
This is Rietveld 408576698