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

Side by Side Diff: chrome/browser/ui/views/accessibility_event_router_views_unittest.cc

Issue 9960042: Refactor screen/monitor so that gfx::Screen returns monitor object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <string> 5 #include <string>
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/accessibility/accessibility_extension_api.h" 10 #include "chrome/browser/accessibility/accessibility_extension_api.h"
(...skipping 13 matching lines...) Expand all
24 #include "ui/views/widget/widget.h" 24 #include "ui/views/widget/widget.h"
25 #include "ui/views/widget/widget_delegate.h" 25 #include "ui/views/widget/widget_delegate.h"
26 26
27 #if defined(USE_AURA) 27 #if defined(USE_AURA)
28 #include "ui/aura/env.h" 28 #include "ui/aura/env.h"
29 #include "ui/aura/monitor_manager.h" 29 #include "ui/aura/monitor_manager.h"
30 #include "ui/aura/root_window.h" 30 #include "ui/aura/root_window.h"
31 #include "ui/aura/test/single_monitor_manager.h" 31 #include "ui/aura/test/single_monitor_manager.h"
32 #include "ui/aura/test/test_screen.h" 32 #include "ui/aura/test/test_screen.h"
33 #include "ui/aura/test/test_stacking_client.h" 33 #include "ui/aura/test/test_stacking_client.h"
34 #include "ui/gfx/screen.h"
34 #endif 35 #endif
35 36
36 #if defined(TOOLKIT_VIEWS) 37 #if defined(TOOLKIT_VIEWS)
37 38
38 class AccessibilityViewsDelegate : public views::ViewsDelegate { 39 class AccessibilityViewsDelegate : public views::ViewsDelegate {
39 public: 40 public:
40 AccessibilityViewsDelegate() {} 41 AccessibilityViewsDelegate() {}
41 virtual ~AccessibilityViewsDelegate() {} 42 virtual ~AccessibilityViewsDelegate() {}
42 43
43 // Overridden from views::ViewsDelegate: 44 // Overridden from views::ViewsDelegate:
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 : public testing::Test, 126 : public testing::Test,
126 public content::NotificationObserver { 127 public content::NotificationObserver {
127 public: 128 public:
128 virtual void SetUp() { 129 virtual void SetUp() {
129 views::ViewsDelegate::views_delegate = new AccessibilityViewsDelegate(); 130 views::ViewsDelegate::views_delegate = new AccessibilityViewsDelegate();
130 #if defined(USE_AURA) 131 #if defined(USE_AURA)
131 aura::Env::GetInstance()->SetMonitorManager( 132 aura::Env::GetInstance()->SetMonitorManager(
132 new aura::test::SingleMonitorManager); 133 new aura::test::SingleMonitorManager);
133 root_window_.reset( 134 root_window_.reset(
134 aura::MonitorManager::CreateRootWindowForPrimaryMonitor()); 135 aura::MonitorManager::CreateRootWindowForPrimaryMonitor());
135 #if defined(USE_ASH) 136 #if defined(USE_AURA)
136 gfx::Screen::SetInstance(new aura::TestScreen(root_window_.get())); 137 gfx::Screen::SetInstance(new aura::TestScreen(root_window_.get()));
137 #endif // USE_ASH 138 #endif // USE_ASH
138 test_stacking_client_.reset( 139 test_stacking_client_.reset(
139 new aura::test::TestStackingClient(root_window_.get())); 140 new aura::test::TestStackingClient(root_window_.get()));
140 #endif // USE_AURA 141 #endif // USE_AURA
141 } 142 }
142 143
143 virtual void TearDown() { 144 virtual void TearDown() {
144 #if defined(USE_AURA) 145 #if defined(USE_AURA)
145 test_stacking_client_.reset(); 146 test_stacking_client_.reset();
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 328
328 // Test that we got the event with the expected name and context. 329 // Test that we got the event with the expected name and context.
329 EXPECT_EQ(1, focus_event_count_); 330 EXPECT_EQ(1, focus_event_count_);
330 EXPECT_EQ(kButtonNameASCII, last_control_name_); 331 EXPECT_EQ(kButtonNameASCII, last_control_name_);
331 EXPECT_EQ(kAlertTextASCII, last_control_context_); 332 EXPECT_EQ(kAlertTextASCII, last_control_context_);
332 333
333 window->CloseNow(); 334 window->CloseNow();
334 } 335 }
335 336
336 #endif // defined(TOOLKIT_VIEWS) 337 #endif // defined(TOOLKIT_VIEWS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698