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

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

Issue 1412923009: Route touch-events for WebViewGuest directly to guest renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update comments (saving first this time). Created 5 years 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
« no previous file with comments | « no previous file | content/browser/browser_plugin/browser_plugin_guest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/apps/guest_view/web_view_browsertest.cc
diff --git a/chrome/browser/apps/guest_view/web_view_browsertest.cc b/chrome/browser/apps/guest_view/web_view_browsertest.cc
index 1cb92bd9780513bf4ea6e2d1c2ee4dd234e82107..1d745f40719897fc94457c6a62530b197cef93ba 100644
--- a/chrome/browser/apps/guest_view/web_view_browsertest.cc
+++ b/chrome/browser/apps/guest_view/web_view_browsertest.cc
@@ -2804,38 +2804,6 @@ class WebViewFocusTest : public WebViewTest {
scoped_refptr<content::FrameWatcher> frame_watcher_;
};
-class FocusWaiter : public views::FocusChangeListener {
- public:
- explicit FocusWaiter(views::View* view_to_wait_for)
- : view_to_wait_for_(view_to_wait_for) {
- view_to_wait_for_->GetFocusManager()->AddFocusChangeListener(this);
- }
- ~FocusWaiter() override {
- view_to_wait_for_->GetFocusManager()->RemoveFocusChangeListener(this);
- }
-
- void Wait() {
- if (view_to_wait_for_->HasFocus())
- return;
-
- base::MessageLoop::current()->Run();
- }
-
- // FocusChangeListener implementation.
- void OnWillChangeFocus(views::View* focused_before,
- views::View* focused_now) override {}
- void OnDidChangeFocus(views::View* focused_before,
- views::View* focused_now) override {
- if (view_to_wait_for_ == focused_now)
- base::MessageLoop::current()->QuitWhenIdle();
- }
-
- private:
- views::View* view_to_wait_for_;
-
- DISALLOW_COPY_AND_ASSIGN(FocusWaiter);
-};
-
// The following test verifies that a views::WebView hosting an embedder
// gains focus on touchstart.
IN_PROC_BROWSER_TEST_F(WebViewFocusTest, TouchFocusesEmbedder) {
@@ -2895,13 +2863,9 @@ IN_PROC_BROWSER_TEST_F(WebViewFocusTest, TouchFocusesEmbedder) {
guest_rect.Offset(-embedder_origin.x(), -embedder_origin.y());
// Generate and send synthetic touch event.
- FocusWaiter waiter(aura_webview);
content::SimulateTouchPressAt(GetEmbedderWebContents(),
guest_rect.CenterPoint());
-
- // Wait for the TouchStart to propagate and restore focus. Test times out
- // on failure.
- waiter.Wait();
+ EXPECT_TRUE(aura_webview->HasFocus());
}
#endif
« no previous file with comments | « no previous file | content/browser/browser_plugin/browser_plugin_guest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698