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

Side by Side Diff: ui/aura_shell/root_window_event_filter_unittest.cc

Issue 8926004: Revert 114095 - Move the concept of Activation to the Shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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
« no previous file with comments | « ui/aura_shell/root_window_event_filter.cc ('k') | ui/aura_shell/shadow_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:mergeinfo
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ui/aura_shell/root_window_event_filter.h" 5 #include "ui/aura_shell/root_window_event_filter.h"
6 6
7 #include "ui/aura/client/activation_delegate.h"
8 #include "ui/aura/client/aura_constants.h"
9 #include "ui/aura/cursor.h" 7 #include "ui/aura/cursor.h"
10 #include "ui/aura/event.h" 8 #include "ui/aura/event.h"
11 #include "ui/aura/root_window.h" 9 #include "ui/aura/root_window.h"
12 #include "ui/aura/test/aura_test_base.h" 10 #include "ui/aura/test/aura_test_base.h"
13 #include "ui/aura/test/event_generator.h" 11 #include "ui/aura/test/event_generator.h"
14 #include "ui/aura/test/test_windows.h" 12 #include "ui/aura/test/test_windows.h"
15 #include "ui/aura/test/test_event_filter.h" 13 #include "ui/aura/test/test_event_filter.h"
16 #include "ui/aura/test/test_window_delegate.h" 14 #include "ui/aura/test/test_window_delegate.h"
17 #include "ui/aura/test/test_stacking_client.h" 15 #include "ui/aura/test/test_stacking_client.h"
18 #include "ui/aura_shell/activation_controller.h"
19 #include "ui/aura_shell/shell_window_ids.h" 16 #include "ui/aura_shell/shell_window_ids.h"
20 #include "ui/aura_shell/test/test_activation_delegate.h"
21 #include "ui/aura_shell/window_util.h"
22 #include "ui/base/hit_test.h" 17 #include "ui/base/hit_test.h"
23 #include "ui/gfx/screen.h" 18 #include "ui/gfx/screen.h"
24 19
25 namespace aura_shell { 20 namespace aura_shell {
26 namespace test { 21 namespace test {
27 22
28 class RootWindowEventFilterTest : public aura::test::AuraTestBase { 23 class RootWindowEventFilterTest : public aura::test::AuraTestBase {
29 public: 24 public:
30 RootWindowEventFilterTest() { 25 RootWindowEventFilterTest() {
31 aura::RootWindow::GetInstance()->SetEventFilter( 26 aura::RootWindow::GetInstance()->SetEventFilter(
32 new internal::RootWindowEventFilter); 27 new internal::RootWindowEventFilter);
33 28
34 aura::test::TestStackingClient* stacking_client = 29 aura::test::TestStackingClient* stacking_client =
35 static_cast<aura::test::TestStackingClient*>( 30 static_cast<aura::test::TestStackingClient*>(
36 aura::RootWindow::GetInstance()->stacking_client()); 31 aura::RootWindow::GetInstance()->stacking_client());
37 stacking_client->default_container()->set_id( 32 stacking_client->default_container()->set_id(
38 internal::kShellWindowId_DefaultContainer); 33 internal::kShellWindowId_DefaultContainer);
39 activation_controller_.reset(new internal::ActivationController);
40 activation_controller_->set_default_container_for_test(
41 stacking_client->default_container());
42 } 34 }
43 virtual ~RootWindowEventFilterTest() { 35 virtual ~RootWindowEventFilterTest() {
44 aura::RootWindow::GetInstance()->SetEventFilter(NULL); 36 aura::RootWindow::GetInstance()->SetEventFilter(NULL);
45 } 37 }
46 38
47 private: 39 private:
48 scoped_ptr<internal::ActivationController> activation_controller_;
49
50 DISALLOW_COPY_AND_ASSIGN(RootWindowEventFilterTest); 40 DISALLOW_COPY_AND_ASSIGN(RootWindowEventFilterTest);
51 }; 41 };
52 42
53 class HitTestWindowDelegate : public aura::test::TestWindowDelegate { 43 class HitTestWindowDelegate : public aura::test::TestWindowDelegate {
54 public: 44 public:
55 HitTestWindowDelegate() 45 HitTestWindowDelegate()
56 : hittest_code_(HTNOWHERE) { 46 : hittest_code_(HTNOWHERE) {
57 } 47 }
58 virtual ~HitTestWindowDelegate() {} 48 virtual ~HitTestWindowDelegate() {}
59 void set_hittest_code(int hittest_code) { hittest_code_ = hittest_code; } 49 void set_hittest_code(int hittest_code) { hittest_code_ = hittest_code; }
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 w12->RemoveChild(w122.get()); 117 w12->RemoveChild(w122.get());
128 EXPECT_EQ(NULL, w122->GetFocusManager()); 118 EXPECT_EQ(NULL, w122->GetFocusManager());
129 EXPECT_EQ(NULL, w12->GetFocusManager()->GetFocusedWindow()); 119 EXPECT_EQ(NULL, w12->GetFocusManager()->GetFocusedWindow());
130 EXPECT_FALSE(root_window->DispatchKeyEvent(&keyev)); 120 EXPECT_FALSE(root_window->DispatchKeyEvent(&keyev));
131 } 121 }
132 122
133 // Various assertion testing for activating windows. 123 // Various assertion testing for activating windows.
134 TEST_F(RootWindowEventFilterTest, ActivateOnMouse) { 124 TEST_F(RootWindowEventFilterTest, ActivateOnMouse) {
135 aura::RootWindow* root_window = aura::RootWindow::GetInstance(); 125 aura::RootWindow* root_window = aura::RootWindow::GetInstance();
136 126
137 TestActivationDelegate d1; 127 aura::test::ActivateWindowDelegate d1;
138 aura::test::TestWindowDelegate wd;
139 scoped_ptr<aura::Window> w1(aura::test::CreateTestWindowWithDelegate( 128 scoped_ptr<aura::Window> w1(aura::test::CreateTestWindowWithDelegate(
140 &wd, 1, gfx::Rect(10, 10, 50, 50), NULL)); 129 &d1, 1, gfx::Rect(10, 10, 50, 50), NULL));
141 d1.SetWindow(w1.get()); 130 aura::test::ActivateWindowDelegate d2;
142 TestActivationDelegate d2;
143 scoped_ptr<aura::Window> w2(aura::test::CreateTestWindowWithDelegate( 131 scoped_ptr<aura::Window> w2(aura::test::CreateTestWindowWithDelegate(
144 &wd, 2, gfx::Rect(70, 70, 50, 50), NULL)); 132 &d2, 2, gfx::Rect(70, 70, 50, 50), NULL));
145 d2.SetWindow(w2.get());
146
147 aura::internal::FocusManager* focus_manager = w1->GetFocusManager(); 133 aura::internal::FocusManager* focus_manager = w1->GetFocusManager();
148 134
149 d1.Clear(); 135 d1.Clear();
150 d2.Clear(); 136 d2.Clear();
151 137
152 // Activate window1. 138 // Activate window1.
153 aura_shell::ActivateWindow(w1.get()); 139 root_window->SetActiveWindow(w1.get(), NULL);
154 EXPECT_TRUE(IsActiveWindow(w1.get())); 140 EXPECT_EQ(w1.get(), root_window->active_window());
155 EXPECT_EQ(w1.get(), focus_manager->GetFocusedWindow()); 141 EXPECT_EQ(w1.get(), focus_manager->GetFocusedWindow());
156 EXPECT_EQ(1, d1.activated_count()); 142 EXPECT_EQ(1, d1.activated_count());
157 EXPECT_EQ(0, d1.lost_active_count()); 143 EXPECT_EQ(0, d1.lost_active_count());
158 d1.Clear(); 144 d1.Clear();
159 145
160 { 146 // Click on window2.
161 // Click on window2. 147 gfx::Point press_point = w2->bounds().CenterPoint();
162 gfx::Point press_point = w2->bounds().CenterPoint(); 148 aura::Window::ConvertPointToWindow(w2->parent(), root_window, &press_point);
163 aura::Window::ConvertPointToWindow(w2->parent(), root_window, &press_point); 149 aura::test::EventGenerator generator(press_point);
164 aura::test::EventGenerator generator(press_point); 150 generator.ClickLeftButton();
165 generator.ClickLeftButton();
166 151
167 // Window2 should have become active. 152 // Window2 should have become active.
168 EXPECT_TRUE(IsActiveWindow(w2.get())); 153 EXPECT_EQ(w2.get(), root_window->active_window());
169 EXPECT_EQ(w2.get(), focus_manager->GetFocusedWindow()); 154 EXPECT_EQ(w2.get(), focus_manager->GetFocusedWindow());
170 EXPECT_EQ(0, d1.activated_count()); 155 EXPECT_EQ(0, d1.activated_count());
171 EXPECT_EQ(1, d1.lost_active_count()); 156 EXPECT_EQ(1, d1.lost_active_count());
172 EXPECT_EQ(1, d2.activated_count()); 157 EXPECT_EQ(1, d2.activated_count());
173 EXPECT_EQ(0, d2.lost_active_count()); 158 EXPECT_EQ(0, d2.lost_active_count());
174 d1.Clear(); 159 d1.Clear();
175 d2.Clear(); 160 d2.Clear();
176 }
177 161
178 { 162 // Click back on window1, but set it up so w1 doesn't activate on click.
179 // Click back on window1, but set it up so w1 doesn't activate on click. 163 press_point = w1->bounds().CenterPoint();
180 gfx::Point press_point = w1->bounds().CenterPoint(); 164 aura::Window::ConvertPointToWindow(w1->parent(), root_window, &press_point);
181 aura::Window::ConvertPointToWindow(w1->parent(), root_window, &press_point); 165 d1.set_activate(false);
182 aura::test::EventGenerator generator(press_point); 166 generator.ClickLeftButton();
183 d1.set_activate(false);
184 generator.ClickLeftButton();
185 167
186 // Window2 should still be active and focused. 168 // Window2 should still be active and focused.
187 EXPECT_TRUE(IsActiveWindow(w2.get())); 169 EXPECT_EQ(w2.get(), root_window->active_window());
188 EXPECT_EQ(w2.get(), focus_manager->GetFocusedWindow()); 170 EXPECT_EQ(w2.get(), focus_manager->GetFocusedWindow());
189 EXPECT_EQ(0, d1.activated_count()); 171 EXPECT_EQ(0, d1.activated_count());
190 EXPECT_EQ(0, d1.lost_active_count()); 172 EXPECT_EQ(0, d1.lost_active_count());
191 EXPECT_EQ(0, d2.activated_count()); 173 EXPECT_EQ(0, d2.activated_count());
192 EXPECT_EQ(0, d2.lost_active_count()); 174 EXPECT_EQ(0, d2.lost_active_count());
193 d1.Clear(); 175 d1.Clear();
194 d2.Clear(); 176 d2.Clear();
195 }
196 177
197 // Destroy window2, this should make window1 active. 178 // Destroy window2, this should make window1 active.
198 d1.set_activate(true); 179 d1.set_activate(true);
199 w2.reset(); 180 w2.reset();
200 EXPECT_EQ(0, d2.activated_count()); 181 EXPECT_EQ(0, d2.activated_count());
201 EXPECT_EQ(0, d2.lost_active_count()); 182 EXPECT_EQ(0, d2.lost_active_count());
202 EXPECT_TRUE(IsActiveWindow(w1.get())); 183 EXPECT_EQ(w1.get(), root_window->active_window());
203 EXPECT_EQ(w1.get(), focus_manager->GetFocusedWindow()); 184 EXPECT_EQ(w1.get(), focus_manager->GetFocusedWindow());
204 EXPECT_EQ(1, d1.activated_count()); 185 EXPECT_EQ(1, d1.activated_count());
205 EXPECT_EQ(0, d1.lost_active_count()); 186 EXPECT_EQ(0, d1.lost_active_count());
206 } 187 }
207 188
208 // Essentially the same as ActivateOnMouse, but for touch events. 189 // Essentially the same as ActivateOnMouse, but for touch events.
209 TEST_F(RootWindowEventFilterTest, ActivateOnTouch) { 190 TEST_F(RootWindowEventFilterTest, ActivateOnTouch) {
210 aura::RootWindow* root_window = aura::RootWindow::GetInstance(); 191 aura::RootWindow* root_window = aura::RootWindow::GetInstance();
211 192
212 TestActivationDelegate d1; 193 aura::test::ActivateWindowDelegate d1;
213 aura::test::TestWindowDelegate wd;
214 scoped_ptr<aura::Window> w1(aura::test::CreateTestWindowWithDelegate( 194 scoped_ptr<aura::Window> w1(aura::test::CreateTestWindowWithDelegate(
215 &wd, -1, gfx::Rect(10, 10, 50, 50), NULL)); 195 &d1, -1, gfx::Rect(10, 10, 50, 50), NULL));
216 d1.SetWindow(w1.get()); 196 aura::test::ActivateWindowDelegate d2;
217 TestActivationDelegate d2;
218 scoped_ptr<aura::Window> w2(aura::test::CreateTestWindowWithDelegate( 197 scoped_ptr<aura::Window> w2(aura::test::CreateTestWindowWithDelegate(
219 &wd, -2, gfx::Rect(70, 70, 50, 50), NULL)); 198 &d2, -2, gfx::Rect(70, 70, 50, 50), NULL));
220 d2.SetWindow(w2.get());
221
222 aura::internal::FocusManager* focus_manager = w1->GetFocusManager(); 199 aura::internal::FocusManager* focus_manager = w1->GetFocusManager();
223 200
224 d1.Clear(); 201 d1.Clear();
225 d2.Clear(); 202 d2.Clear();
226 203
227 // Activate window1. 204 // Activate window1.
228 aura_shell::ActivateWindow(w1.get()); 205 root_window->SetActiveWindow(w1.get(), NULL);
229 EXPECT_TRUE(IsActiveWindow(w1.get())); 206 EXPECT_EQ(w1.get(), root_window->active_window());
230 EXPECT_EQ(w1.get(), focus_manager->GetFocusedWindow()); 207 EXPECT_EQ(w1.get(), focus_manager->GetFocusedWindow());
231 EXPECT_EQ(1, d1.activated_count()); 208 EXPECT_EQ(1, d1.activated_count());
232 EXPECT_EQ(0, d1.lost_active_count()); 209 EXPECT_EQ(0, d1.lost_active_count());
233 d1.Clear(); 210 d1.Clear();
234 211
235 // Touch window2. 212 // Touch window2.
236 gfx::Point press_point = w2->bounds().CenterPoint(); 213 gfx::Point press_point = w2->bounds().CenterPoint();
237 aura::Window::ConvertPointToWindow(w2->parent(), root_window, &press_point); 214 aura::Window::ConvertPointToWindow(w2->parent(), root_window, &press_point);
238 aura::TouchEvent touchev1(ui::ET_TOUCH_PRESSED, press_point, 0); 215 aura::TouchEvent touchev1(ui::ET_TOUCH_PRESSED, press_point, 0);
239 root_window->DispatchTouchEvent(&touchev1); 216 root_window->DispatchTouchEvent(&touchev1);
240 217
241 // Window2 should have become active. 218 // Window2 should have become active.
242 EXPECT_TRUE(IsActiveWindow(w2.get())); 219 EXPECT_EQ(w2.get(), root_window->active_window());
243 EXPECT_EQ(w2.get(), focus_manager->GetFocusedWindow()); 220 EXPECT_EQ(w2.get(), focus_manager->GetFocusedWindow());
244 EXPECT_EQ(0, d1.activated_count()); 221 EXPECT_EQ(0, d1.activated_count());
245 EXPECT_EQ(1, d1.lost_active_count()); 222 EXPECT_EQ(1, d1.lost_active_count());
246 EXPECT_EQ(1, d2.activated_count()); 223 EXPECT_EQ(1, d2.activated_count());
247 EXPECT_EQ(0, d2.lost_active_count()); 224 EXPECT_EQ(0, d2.lost_active_count());
248 d1.Clear(); 225 d1.Clear();
249 d2.Clear(); 226 d2.Clear();
250 227
251 // Touch window1, but set it up so w1 doesn't activate on touch. 228 // Touch window1, but set it up so w1 doesn't activate on touch.
252 press_point = w1->bounds().CenterPoint(); 229 press_point = w1->bounds().CenterPoint();
253 aura::Window::ConvertPointToWindow(w1->parent(), root_window, &press_point); 230 aura::Window::ConvertPointToWindow(w1->parent(), root_window, &press_point);
254 d1.set_activate(false); 231 d1.set_activate(false);
255 aura::TouchEvent touchev2(ui::ET_TOUCH_PRESSED, press_point, 0); 232 aura::TouchEvent touchev2(ui::ET_TOUCH_PRESSED, press_point, 0);
256 root_window->DispatchTouchEvent(&touchev2); 233 root_window->DispatchTouchEvent(&touchev2);
257 234
258 // Window2 should still be active and focused. 235 // Window2 should still be active and focused.
259 EXPECT_TRUE(IsActiveWindow(w2.get())); 236 EXPECT_EQ(w2.get(), root_window->active_window());
260 EXPECT_EQ(w2.get(), focus_manager->GetFocusedWindow()); 237 EXPECT_EQ(w2.get(), focus_manager->GetFocusedWindow());
261 EXPECT_EQ(0, d1.activated_count()); 238 EXPECT_EQ(0, d1.activated_count());
262 EXPECT_EQ(0, d1.lost_active_count()); 239 EXPECT_EQ(0, d1.lost_active_count());
263 EXPECT_EQ(0, d2.activated_count()); 240 EXPECT_EQ(0, d2.activated_count());
264 EXPECT_EQ(0, d2.lost_active_count()); 241 EXPECT_EQ(0, d2.lost_active_count());
265 d1.Clear(); 242 d1.Clear();
266 d2.Clear(); 243 d2.Clear();
267 244
268 // Destroy window2, this should make window1 active. 245 // Destroy window2, this should make window1 active.
269 d1.set_activate(true); 246 d1.set_activate(true);
270 w2.reset(); 247 w2.reset();
271 EXPECT_EQ(0, d2.activated_count()); 248 EXPECT_EQ(0, d2.activated_count());
272 EXPECT_EQ(0, d2.lost_active_count()); 249 EXPECT_EQ(0, d2.lost_active_count());
273 EXPECT_TRUE(IsActiveWindow(w1.get())); 250 EXPECT_EQ(w1.get(), root_window->active_window());
274 EXPECT_EQ(w1.get(), focus_manager->GetFocusedWindow()); 251 EXPECT_EQ(w1.get(), focus_manager->GetFocusedWindow());
275 EXPECT_EQ(1, d1.activated_count()); 252 EXPECT_EQ(1, d1.activated_count());
276 EXPECT_EQ(0, d1.lost_active_count()); 253 EXPECT_EQ(0, d1.lost_active_count());
277 } 254 }
278 255
279 TEST_F(RootWindowEventFilterTest, MouseEventCursors) { 256 TEST_F(RootWindowEventFilterTest, MouseEventCursors) {
280 aura::RootWindow* root_window = aura::RootWindow::GetInstance(); 257 aura::RootWindow* root_window = aura::RootWindow::GetInstance();
281 258
282 // Create a window. 259 // Create a window.
283 const int kWindowLeft = 123; 260 const int kWindowLeft = 123;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 gfx::Size size = root_window->GetHostSize(); 322 gfx::Size size = root_window->GetHostSize();
346 EXPECT_EQ(gfx::Rect(size), 323 EXPECT_EQ(gfx::Rect(size),
347 gfx::Screen::GetMonitorAreaNearestPoint(gfx::Point())); 324 gfx::Screen::GetMonitorAreaNearestPoint(gfx::Point()));
348 325
349 // Rotate it clock-wise 90 degrees. 326 // Rotate it clock-wise 90 degrees.
350 ui::Transform transform; 327 ui::Transform transform;
351 transform.SetRotate(90.0f); 328 transform.SetRotate(90.0f);
352 transform.ConcatTranslate(size.width(), 0); 329 transform.ConcatTranslate(size.width(), 0);
353 root_window->SetTransform(transform); 330 root_window->SetTransform(transform);
354 331
355 TestActivationDelegate d1; 332 aura::test::ActivateWindowDelegate d1;
356 aura::test::TestWindowDelegate wd;
357 scoped_ptr<aura::Window> w1( 333 scoped_ptr<aura::Window> w1(
358 CreateTestWindowWithDelegate(&wd, 1, gfx::Rect(0, 10, 50, 50), NULL)); 334 CreateTestWindowWithDelegate(&d1, 1, gfx::Rect(0, 10, 50, 50), NULL));
359 d1.SetWindow(w1.get());
360 w1->Show(); 335 w1->Show();
361 336
362 gfx::Point miss_point(5, 5); 337 gfx::Point miss_point(5, 5);
363 transform.TransformPoint(miss_point); 338 transform.TransformPoint(miss_point);
364 aura::MouseEvent mouseev1(ui::ET_MOUSE_PRESSED, 339 aura::MouseEvent mouseev1(ui::ET_MOUSE_PRESSED,
365 miss_point, 340 miss_point,
366 ui::EF_LEFT_BUTTON_DOWN); 341 ui::EF_LEFT_BUTTON_DOWN);
367 root_window->DispatchMouseEvent(&mouseev1); 342 root_window->DispatchMouseEvent(&mouseev1);
368 EXPECT_FALSE(w1->GetFocusManager()->GetFocusedWindow()); 343 EXPECT_FALSE(w1->GetFocusManager()->GetFocusedWindow());
369 aura::MouseEvent mouseup(ui::ET_MOUSE_RELEASED, 344 aura::MouseEvent mouseup(ui::ET_MOUSE_RELEASED,
370 miss_point, 345 miss_point,
371 ui::EF_LEFT_BUTTON_DOWN); 346 ui::EF_LEFT_BUTTON_DOWN);
372 root_window->DispatchMouseEvent(&mouseup); 347 root_window->DispatchMouseEvent(&mouseup);
373 348
374 gfx::Point hit_point(5, 15); 349 gfx::Point hit_point(5, 15);
375 transform.TransformPoint(hit_point); 350 transform.TransformPoint(hit_point);
376 aura::MouseEvent mouseev2(ui::ET_MOUSE_PRESSED, 351 aura::MouseEvent mouseev2(ui::ET_MOUSE_PRESSED,
377 hit_point, 352 hit_point,
378 ui::EF_LEFT_BUTTON_DOWN); 353 ui::EF_LEFT_BUTTON_DOWN);
379 root_window->DispatchMouseEvent(&mouseev2); 354 root_window->DispatchMouseEvent(&mouseev2);
380 EXPECT_TRUE(IsActiveWindow(w1.get())); 355 EXPECT_EQ(w1.get(), root_window->active_window());
381 EXPECT_EQ(w1.get(), w1->GetFocusManager()->GetFocusedWindow()); 356 EXPECT_EQ(w1.get(), w1->GetFocusManager()->GetFocusedWindow());
382 } 357 }
383 358
384 TEST_F(RootWindowEventFilterTest, AdditionalFilters) { 359 TEST_F(RootWindowEventFilterTest, AdditionalFilters) {
385 aura::RootWindow* root_window = aura::RootWindow::GetInstance(); 360 aura::RootWindow* root_window = aura::RootWindow::GetInstance();
386 361
387 // Creates a window and make it active 362 // Creates a window and make it active
388 scoped_ptr<aura::Window> w1(aura::test::CreateTestWindow( 363 scoped_ptr<aura::Window> w1(aura::test::CreateTestWindow(
389 SK_ColorWHITE, -1, gfx::Rect(0, 0, 100, 100), NULL)); 364 SK_ColorWHITE, -1, gfx::Rect(0, 0, 100, 100), NULL));
390 aura_shell::ActivateWindow(w1.get()); 365 root_window->SetActiveWindow(w1.get(), NULL);
391 366
392 // Creates two addition filters 367 // Creates two addition filters
393 scoped_ptr<aura::test::TestEventFilter> f1( 368 scoped_ptr<aura::test::TestEventFilter> f1(
394 new aura::test::TestEventFilter(NULL)); 369 new aura::test::TestEventFilter(NULL));
395 scoped_ptr<aura::test::TestEventFilter> f2( 370 scoped_ptr<aura::test::TestEventFilter> f2(
396 new aura::test::TestEventFilter(NULL)); 371 new aura::test::TestEventFilter(NULL));
397 372
398 // Adds them to root window event filter. 373 // Adds them to root window event filter.
399 internal::RootWindowEventFilter* root_window_filter = 374 internal::RootWindowEventFilter* root_window_filter =
400 static_cast<internal::RootWindowEventFilter*>( 375 static_cast<internal::RootWindowEventFilter*>(
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 EXPECT_EQ(0, f1->key_event_count()); 421 EXPECT_EQ(0, f1->key_event_count());
447 EXPECT_EQ(0, f1->mouse_event_count()); 422 EXPECT_EQ(0, f1->mouse_event_count());
448 EXPECT_EQ(1, f2->key_event_count()); 423 EXPECT_EQ(1, f2->key_event_count());
449 EXPECT_EQ(1, f2->mouse_event_count()); 424 EXPECT_EQ(1, f2->mouse_event_count());
450 425
451 root_window_filter->RemoveFilter(f2.get()); 426 root_window_filter->RemoveFilter(f2.get());
452 } 427 }
453 428
454 } // namespace test 429 } // namespace test
455 } // namespace aura_shell 430 } // namespace aura_shell
OLDNEW
« no previous file with comments | « ui/aura_shell/root_window_event_filter.cc ('k') | ui/aura_shell/shadow_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698