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

Unified Diff: trunk/src/ui/views/corewm/focus_controller_unittest.cc

Issue 82913009: Revert 236417 "Makes FocusdController honor focus change if no p..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 1 month 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 | « trunk/src/ui/views/corewm/focus_controller.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/ui/views/corewm/focus_controller_unittest.cc
===================================================================
--- trunk/src/ui/views/corewm/focus_controller_unittest.cc (revision 236878)
+++ trunk/src/ui/views/corewm/focus_controller_unittest.cc (working copy)
@@ -305,7 +305,6 @@
virtual void NoShiftActiveOnActivation() {}
virtual void NoFocusChangeOnClickOnCaptureWindow() {}
virtual void ChangeFocusWhenNothingFocusedAndCaptured() {}
- virtual void ChangeFocusWithinActivate() {}
private:
scoped_ptr<FocusController> focus_controller_;
@@ -314,38 +313,6 @@
DISALLOW_COPY_AND_ASSIGN(FocusControllerTestBase);
};
-// ActivationChangeObserver that attempts to focus another window on an
-// activation change.
-class TestActivationChangeObserver
- : public aura::client::ActivationChangeObserver {
- public:
- TestActivationChangeObserver() : gained_active_(NULL), to_focus_(NULL) {}
- virtual ~TestActivationChangeObserver() {}
-
- // Sets the window to focus (|to_focus|) when a window is made active.
- void SetWindows(aura::Window* gained_active, aura::Window* to_focus) {
- gained_active_ = gained_active;
- to_focus_ = to_focus;
- }
-
- // aura::client::ActivationChangeObserver:
- virtual void OnWindowActivated(aura::Window* gained_active,
- aura::Window* lost_active) OVERRIDE {
- if (gained_active == gained_active_ && to_focus_) {
- aura::Window* to_focus = to_focus_;
- to_focus_ = NULL;
- gained_active_ = NULL;
- to_focus->Focus();
- }
- }
-
- private:
- aura::Window* gained_active_;
- aura::Window* to_focus_;
-
- DISALLOW_COPY_AND_ASSIGN(TestActivationChangeObserver);
-};
-
// Test base for tests where focus is directly set to a target window.
class FocusControllerDirectTestBase : public FocusControllerTestBase {
protected:
@@ -651,25 +618,6 @@
aura::client::GetCaptureClient(root_window())->ReleaseCapture(w1);
}
- // Verifies a request to focus a window is honored if the
- // ActivationChangeObserver changes focus.
- virtual void ChangeFocusWithinActivate() OVERRIDE {
- TestActivationChangeObserver test_observer;
- aura::client::GetActivationClient(root_window())->
- AddObserver(&test_observer);
- // Set things such that when |w1| is made active a request is made to focus
- // |w11|.
- test_observer.SetWindows(root_window()->GetChildById(1),
- root_window()->GetChildById(11));
- // Attempt to activate |w12|. This should activate |w1| (its the child of
- // the root
- ActivateWindowById(12);
- EXPECT_EQ(1, GetActiveWindowId());
- EXPECT_EQ(12, GetFocusedWindowId());
- aura::client::GetActivationClient(root_window())->RemoveObserver(
- &test_observer);
- }
-
private:
DISALLOW_COPY_AND_ASSIGN(FocusControllerDirectTestBase);
};
@@ -1071,7 +1019,5 @@
FOCUS_CONTROLLER_TEST(FocusControllerApiTest,
ChangeFocusWhenNothingFocusedAndCaptured);
-FOCUS_CONTROLLER_TEST(FocusControllerApiTest, ChangeFocusWithinActivate);
-
} // namespace corewm
} // namespace views
« no previous file with comments | « trunk/src/ui/views/corewm/focus_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698