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

Unified Diff: ui/wm/core/focus_controller_unittest.cc

Issue 1182523003: Removes TextInputFocusManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit per comment. Created 5 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
« no previous file with comments | « ui/wm/core/focus_controller.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/wm/core/focus_controller_unittest.cc
diff --git a/ui/wm/core/focus_controller_unittest.cc b/ui/wm/core/focus_controller_unittest.cc
index a8bddb37c805beeee61b53e4203995176a76412f..c82e3dd85f4282f24a58eee961eedfe3e1dfb5bb 100644
--- a/ui/wm/core/focus_controller_unittest.cc
+++ b/ui/wm/core/focus_controller_unittest.cc
@@ -15,8 +15,6 @@
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tracker.h"
-#include "ui/base/ime/dummy_text_input_client.h"
-#include "ui/base/ime/text_input_focus_manager.h"
#include "ui/events/event.h"
#include "ui/events/event_constants.h"
#include "ui/events/event_handler.h"
@@ -265,25 +263,6 @@ class ScopedTargetFocusNotificationObserver : public FocusNotificationObserver {
DISALLOW_COPY_AND_ASSIGN(ScopedTargetFocusNotificationObserver);
};
-class ScopedFocusedTextInputClientChanger
- : public ScopedFocusNotificationObserver {
- public:
- ScopedFocusedTextInputClientChanger(aura::Window* root_window,
- ui::TextInputClient* text_input_client)
- : ScopedFocusNotificationObserver(root_window),
- text_input_client_(text_input_client) {}
-
- private:
- // Overridden from aura::client::FocusChangeObserver:
- void OnWindowFocused(aura::Window* gained_focus,
- aura::Window* lost_focus) override {
- ui::TextInputFocusManager::GetInstance()->FocusTextInputClient(
- text_input_client_);
- }
-
- ui::TextInputClient* text_input_client_;
-};
-
// Used to fake the handling of events in the pre-target phase.
class SimpleEventHandler : public ui::EventHandler {
public:
@@ -486,7 +465,6 @@ class FocusControllerTestBase : public aura::test::AuraTestBase {
virtual void FocusChangeDuringDrag() {}
virtual void ChangeFocusWhenNothingFocusedAndCaptured() {}
virtual void DontPassDeletedWindow() {}
- virtual void FocusedTextInputClient() {}
private:
scoped_ptr<FocusController> focus_controller_;
@@ -858,41 +836,6 @@ class FocusControllerDirectTestBase : public FocusControllerTestBase {
}
}
- // Verifies if the focused text input client is cleared when a window gains
- // or loses the focus.
- void FocusedTextInputClient() override {
- ui::TextInputFocusManager* text_input_focus_manager =
- ui::TextInputFocusManager::GetInstance();
- ui::DummyTextInputClient text_input_client;
- ui::TextInputClient* null_text_input_client = NULL;
-
- EXPECT_EQ(null_text_input_client,
- text_input_focus_manager->GetFocusedTextInputClient());
-
- text_input_focus_manager->FocusTextInputClient(&text_input_client);
- EXPECT_EQ(&text_input_client,
- text_input_focus_manager->GetFocusedTextInputClient());
- FocusWindowById(1);
- // The focused text input client gets cleared when a window gets focused
- // unless any of observers sets the focused text input client.
- EXPECT_EQ(null_text_input_client,
- text_input_focus_manager->GetFocusedTextInputClient());
-
- ScopedFocusedTextInputClientChanger text_input_focus_changer(
- root_window(), &text_input_client);
- EXPECT_EQ(null_text_input_client,
- text_input_focus_manager->GetFocusedTextInputClient());
- FocusWindowById(2);
- // |text_input_focus_changer| sets the focused text input client.
- EXPECT_EQ(&text_input_client,
- text_input_focus_manager->GetFocusedTextInputClient());
-
- FocusWindow(NULL);
- // The focused text input client gets cleared when a window loses the focus.
- EXPECT_EQ(null_text_input_client,
- text_input_focus_manager->GetFocusedTextInputClient());
- }
-
private:
DISALLOW_COPY_AND_ASSIGN(FocusControllerDirectTestBase);
};
@@ -1344,10 +1287,6 @@ FOCUS_CONTROLLER_TEST(FocusControllerApiTest, DontPassDeletedWindow);
FOCUS_CONTROLLER_TEST(FocusControllerParentHideTest,
TransientChildWindowActivationTest);
-// - Verifies that the focused text input client is cleard when the window focus
-// changes.
-ALL_FOCUS_TESTS(FocusedTextInputClient);
-
// If a mouse event was handled, it should not activate a window.
FOCUS_CONTROLLER_TEST(FocusControllerMouseEventTest, IgnoreHandledEvent);
« no previous file with comments | « ui/wm/core/focus_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698