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

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

Issue 8968022: Shell related switches -> aura shell switches. (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/activation_controller.cc ('k') | ui/aura_shell/always_on_top_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/activation_controller.h" 5 #include "ui/aura_shell/activation_controller.h"
6 6
7 #include "ui/aura/client/aura_constants.h"
8 #include "ui/aura/focus_manager.h" 7 #include "ui/aura/focus_manager.h"
9 #include "ui/aura/root_window.h" 8 #include "ui/aura/root_window.h"
10 #include "ui/aura/test/event_generator.h" 9 #include "ui/aura/test/event_generator.h"
11 #include "ui/aura/test/test_windows.h" 10 #include "ui/aura/test/test_windows.h"
12 #include "ui/aura/test/test_window_delegate.h" 11 #include "ui/aura/test/test_window_delegate.h"
13 #include "ui/aura_shell/test/aura_shell_test_base.h" 12 #include "ui/aura_shell/test/aura_shell_test_base.h"
14 #include "ui/aura_shell/test/test_activation_delegate.h" 13 #include "ui/aura_shell/test/test_activation_delegate.h"
15 #include "ui/aura_shell/window_util.h" 14 #include "ui/aura_shell/window_util.h"
16 15
17 #if defined(OS_WIN) 16 #if defined(OS_WIN)
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 ad1.SetWindow(w1.get()); 131 ad1.SetWindow(w1.get());
133 EXPECT_TRUE(IsActiveWindow(NULL)); 132 EXPECT_TRUE(IsActiveWindow(NULL));
134 133
135 // Clicking on an activatable window activtes the window. 134 // Clicking on an activatable window activtes the window.
136 aura::test::EventGenerator generator(w1.get()); 135 aura::test::EventGenerator generator(w1.get());
137 generator.ClickLeftButton(); 136 generator.ClickLeftButton();
138 EXPECT_TRUE(IsActiveWindow(w1.get())); 137 EXPECT_TRUE(IsActiveWindow(w1.get()));
139 138
140 // Creates a menu that covers the transient parent. 139 // Creates a menu that covers the transient parent.
141 scoped_ptr<aura::Window> menu(aura::test::CreateTestWindowWithDelegateAndType( 140 scoped_ptr<aura::Window> menu(aura::test::CreateTestWindowWithDelegateAndType(
142 &wd, aura::WINDOW_TYPE_MENU, 2, gfx::Rect(100, 100), NULL)); 141 &wd, aura::client::WINDOW_TYPE_MENU, 2, gfx::Rect(100, 100), NULL));
143 ad2.SetWindow(menu.get()); 142 ad2.SetWindow(menu.get());
144 w1->AddTransientChild(menu.get()); 143 w1->AddTransientChild(menu.get());
145 144
146 // Clicking on a menu whose transient parent is active window shouldn't 145 // Clicking on a menu whose transient parent is active window shouldn't
147 // change the active window. 146 // change the active window.
148 generator.ClickLeftButton(); 147 generator.ClickLeftButton();
149 EXPECT_TRUE(IsActiveWindow(w1.get())); 148 EXPECT_TRUE(IsActiveWindow(w1.get()));
150 } 149 }
151 150
152 // Various assertions for activating/deactivating. 151 // Various assertions for activating/deactivating.
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 271
273 // Try focusing |w21|. Same rules apply. 272 // Try focusing |w21|. Same rules apply.
274 EXPECT_FALSE(IsActiveWindow(w2.get())); 273 EXPECT_FALSE(IsActiveWindow(w2.get()));
275 EXPECT_FALSE(w21->HasFocus()); 274 EXPECT_FALSE(w21->HasFocus());
276 EXPECT_TRUE(IsActiveWindow(w1.get())); 275 EXPECT_TRUE(IsActiveWindow(w1.get()));
277 EXPECT_TRUE(w1->HasFocus()); 276 EXPECT_TRUE(w1->HasFocus());
278 } 277 }
279 278
280 } // namespace test 279 } // namespace test
281 } // namespace aura_shell 280 } // namespace aura_shell
OLDNEW
« no previous file with comments | « ui/aura_shell/activation_controller.cc ('k') | ui/aura_shell/always_on_top_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698