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

Unified Diff: chrome/browser/ui/views/accessibility_event_router_views_unittest.cc

Issue 10378043: Allow the RWHVW to be focused when a window is restored from minimized. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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 | « no previous file | ui/base/test/dummy_input_method.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/accessibility_event_router_views_unittest.cc
===================================================================
--- chrome/browser/ui/views/accessibility_event_router_views_unittest.cc (revision 137127)
+++ chrome/browser/ui/views/accessibility_event_router_views_unittest.cc (working copy)
@@ -25,12 +25,16 @@
#include "ui/views/widget/widget_delegate.h"
#if defined(USE_AURA)
+#include "ui/aura/client/aura_constants.h"
#include "ui/aura/env.h"
#include "ui/aura/monitor_manager.h"
#include "ui/aura/root_window.h"
#include "ui/aura/single_monitor_manager.h"
+#include "ui/aura/test/test_activation_client.h"
#include "ui/aura/test/test_screen.h"
#include "ui/aura/test/test_stacking_client.h"
+#include "ui/base/ime/input_method.h"
+#include "ui/base/test/dummy_input_method.h"
#include "ui/gfx/screen.h"
#endif
@@ -139,15 +143,23 @@
: public testing::Test,
public content::NotificationObserver {
public:
+ AccessibilityEventRouterViewsTest() {
+#if defined(USE_AURA)
+ test_input_method_.reset(new ui::test::DummyInputMethod);
+#endif
+ }
+
virtual void SetUp() {
views::ViewsDelegate::views_delegate = new AccessibilityViewsDelegate();
#if defined(USE_AURA)
aura::Env::GetInstance()->SetMonitorManager(new aura::SingleMonitorManager);
root_window_.reset(
aura::MonitorManager::CreateRootWindowForPrimaryMonitor());
-#if defined(USE_AURA)
gfx::Screen::SetInstance(new aura::TestScreen(root_window_.get()));
-#endif // USE_ASH
+ root_window_->SetProperty(aura::client::kRootWindowInputMethodKey,
+ test_input_method_.get());
+ test_activation_client_.reset(
+ new aura::test::TestActivationClient(root_window_.get()));
test_stacking_client_.reset(
new aura::test::TestStackingClient(root_window_.get()));
#endif // USE_AURA
@@ -156,6 +168,7 @@
virtual void TearDown() {
#if defined(USE_AURA)
test_stacking_client_.reset();
+ test_activation_client_.reset();
root_window_.reset();
#endif
delete views::ViewsDelegate::views_delegate;
@@ -193,7 +206,9 @@
std::string last_control_context_;
#if defined(USE_AURA)
scoped_ptr<aura::RootWindow> root_window_;
+ scoped_ptr<aura::test::TestActivationClient> test_activation_client_;
scoped_ptr<aura::test::TestStackingClient> test_stacking_client_;
+ scoped_ptr<ui::InputMethod> test_input_method_;
#endif
};
@@ -217,6 +232,8 @@
// Put the view in a window.
views::Widget* window = CreateWindowWithContents(contents);
+ window->Show();
+ window->Activate();
// Set focus to the first button initially.
button1->RequestFocus();
« no previous file with comments | « no previous file | ui/base/test/dummy_input_method.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698