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

Unified Diff: content/browser/site_per_process_browsertest.cc

Issue 1934703002: Fix keyboard focus for OOPIF-<webview>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed test flakiness and comments in PS 7,8. Created 4 years, 6 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: content/browser/site_per_process_browsertest.cc
diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc
index 5543138fca9e051921f62d3aebf500f15527f05e..fccc071146af600131b8a1d589ce54ee7f55f184 100644
--- a/content/browser/site_per_process_browsertest.cc
+++ b/content/browser/site_per_process_browsertest.cc
@@ -407,31 +407,6 @@ class UserInteractionObserver : public WebContentsObserver {
DISALLOW_COPY_AND_ASSIGN(UserInteractionObserver);
};
-// This observer is used to wait for its owner FrameTreeNode to become focused.
-class FrameFocusedObserver : public FrameTreeNode::Observer {
- public:
- FrameFocusedObserver(FrameTreeNode* owner)
- : owner_(owner), message_loop_runner_(new MessageLoopRunner) {
- owner->AddObserver(this);
- }
-
- ~FrameFocusedObserver() override { owner_->RemoveObserver(this); }
-
- void Wait() { message_loop_runner_->Run(); }
-
- private:
- // FrameTreeNode::Observer
- void OnFrameTreeNodeFocused(FrameTreeNode* node) override {
- if (node == owner_)
- message_loop_runner_->Quit();
- }
-
- FrameTreeNode* owner_;
- scoped_refptr<MessageLoopRunner> message_loop_runner_;
-
- DISALLOW_COPY_AND_ASSIGN(FrameFocusedObserver);
-};
-
// This observer is used to wait for its owner FrameTreeNode to become deleted.
class FrameDeletedObserver : public FrameTreeNode::Observer {
public:
@@ -458,7 +433,7 @@ class FrameDeletedObserver : public FrameTreeNode::Observer {
// Helper function to focus a frame by sending it a mouse click and then
// waiting for it to become focused.
void FocusFrame(FrameTreeNode* frame) {
- FrameFocusedObserver focus_observer(frame);
+ FrameFocusedObserver focus_observer(frame->current_frame_host());
SimulateMouseClick(frame->current_frame_host()->GetRenderWidgetHost(), 1, 1);
focus_observer.Wait();
}

Powered by Google App Engine
This is Rietveld 408576698