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

Side by Side Diff: ash/wm/activation_controller_unittest.cc

Issue 9421016: Change EventGenerator to take a RootWindow at construction instead of just assuming one via RootWin… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 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 "ash/wm/activation_controller.h" 5 #include "ash/wm/activation_controller.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/test/ash_test_base.h" 8 #include "ash/test/ash_test_base.h"
9 #include "ash/test/test_activation_delegate.h" 9 #include "ash/test/test_activation_delegate.h"
10 #include "ash/wm/window_util.h" 10 #include "ash/wm/window_util.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 aura::test::TestWindowDelegate wd; 126 aura::test::TestWindowDelegate wd;
127 TestActivationDelegate ad1; 127 TestActivationDelegate ad1;
128 TestActivationDelegate ad2(false); 128 TestActivationDelegate ad2(false);
129 129
130 scoped_ptr<aura::Window> w1(aura::test::CreateTestWindowWithDelegate( 130 scoped_ptr<aura::Window> w1(aura::test::CreateTestWindowWithDelegate(
131 &wd, 1, gfx::Rect(100, 100), NULL)); 131 &wd, 1, gfx::Rect(100, 100), NULL));
132 ad1.SetWindow(w1.get()); 132 ad1.SetWindow(w1.get());
133 EXPECT_TRUE(IsActiveWindow(NULL)); 133 EXPECT_TRUE(IsActiveWindow(NULL));
134 134
135 // Clicking on an activatable window activtes the window. 135 // Clicking on an activatable window activtes the window.
136 aura::test::EventGenerator generator(w1.get()); 136 aura::test::EventGenerator generator(Shell::GetRootWindow(), w1.get());
137 generator.ClickLeftButton(); 137 generator.ClickLeftButton();
138 EXPECT_TRUE(IsActiveWindow(w1.get())); 138 EXPECT_TRUE(IsActiveWindow(w1.get()));
139 139
140 // Creates a menu that covers the transient parent. 140 // Creates a menu that covers the transient parent.
141 scoped_ptr<aura::Window> menu(aura::test::CreateTestWindowWithDelegateAndType( 141 scoped_ptr<aura::Window> menu(aura::test::CreateTestWindowWithDelegateAndType(
142 &wd, aura::client::WINDOW_TYPE_MENU, 2, gfx::Rect(100, 100), NULL)); 142 &wd, aura::client::WINDOW_TYPE_MENU, 2, gfx::Rect(100, 100), NULL));
143 ad2.SetWindow(menu.get()); 143 ad2.SetWindow(menu.get());
144 w1->AddTransientChild(menu.get()); 144 w1->AddTransientChild(menu.get());
145 145
146 // Clicking on a menu whose transient parent is active window shouldn't 146 // Clicking on a menu whose transient parent is active window shouldn't
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 283
284 // Try focusing |w21|. Same rules apply. 284 // Try focusing |w21|. Same rules apply.
285 EXPECT_FALSE(IsActiveWindow(w2.get())); 285 EXPECT_FALSE(IsActiveWindow(w2.get()));
286 EXPECT_FALSE(w21->HasFocus()); 286 EXPECT_FALSE(w21->HasFocus());
287 EXPECT_TRUE(IsActiveWindow(w1.get())); 287 EXPECT_TRUE(IsActiveWindow(w1.get()));
288 EXPECT_TRUE(w1->HasFocus()); 288 EXPECT_TRUE(w1->HasFocus());
289 } 289 }
290 290
291 } // namespace test 291 } // namespace test
292 } // namespace ash 292 } // namespace ash
OLDNEW
« no previous file with comments | « ash/tooltips/tooltip_controller_unittest.cc ('k') | ash/wm/root_window_event_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698