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

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

Issue 9222018: reland -- Disable animations during aura tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address reviewer comments. Created 8 years, 11 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/system_modal_container_layout_manager.h" 5 #include "ash/wm/system_modal_container_layout_manager.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/shell_window_ids.h" 8 #include "ash/shell_window_ids.h"
9 #include "ash/test/aura_shell_test_base.h" 9 #include "ash/test/aura_shell_test_base.h"
10 #include "ash/wm/window_util.h" 10 #include "ash/wm/window_util.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 EXPECT_TRUE(IsActiveWindow(t2)); 134 EXPECT_TRUE(IsActiveWindow(t2));
135 135
136 // Both transients should be destroyed with parent. 136 // Both transients should be destroyed with parent.
137 parent.reset(); 137 parent.reset();
138 EXPECT_TRUE(do1.destroyed()); 138 EXPECT_TRUE(do1.destroyed());
139 EXPECT_TRUE(do2.destroyed()); 139 EXPECT_TRUE(do2.destroyed());
140 } 140 }
141 141
142 // Tests that we can activate an unrelated window after a modal window is closed 142 // Tests that we can activate an unrelated window after a modal window is closed
143 // for a window. 143 // for a window.
144 // TODO(beng): This test is disabled pending a solution re: visibility & target
145 // visibility.
146 TEST_F(SystemModalContainerLayoutManagerTest, 144 TEST_F(SystemModalContainerLayoutManagerTest,
147 DISABLED_CanActivateAfterEndModalSession) { 145 CanActivateAfterEndModalSession) {
148 scoped_ptr<aura::Window> unrelated(TestWindow::OpenTestWindow(NULL, false)); 146 scoped_ptr<aura::Window> unrelated(TestWindow::OpenTestWindow(NULL, false));
149 unrelated->SetBounds(gfx::Rect(100, 100, 50, 50)); 147 unrelated->SetBounds(gfx::Rect(100, 100, 50, 50));
150 scoped_ptr<aura::Window> parent(TestWindow::OpenTestWindow(NULL, false)); 148 scoped_ptr<aura::Window> parent(TestWindow::OpenTestWindow(NULL, false));
151 // parent should be active. 149 // parent should be active.
152 EXPECT_TRUE(IsActiveWindow(parent.get())); 150 EXPECT_TRUE(IsActiveWindow(parent.get()));
153 151
154 scoped_ptr<aura::Window> transient( 152 scoped_ptr<aura::Window> transient(
155 TestWindow::OpenTestWindow(parent.get(), true)); 153 TestWindow::OpenTestWindow(parent.get(), true));
156 // t1 should now be active. 154 // t1 should now be active.
157 EXPECT_TRUE(IsActiveWindow(transient.get())); 155 EXPECT_TRUE(IsActiveWindow(transient.get()));
158 156
159 // Attempting to click the parent should result in no activation change. 157 // Attempting to click the parent should result in no activation change.
160 aura::test::EventGenerator e1(parent.get()); 158 aura::test::EventGenerator e1(parent.get());
161 e1.ClickLeftButton(); 159 e1.ClickLeftButton();
162 EXPECT_TRUE(IsActiveWindow(transient.get())); 160 EXPECT_TRUE(IsActiveWindow(transient.get()));
163 161
164 // Now close the transient. 162 // Now close the transient.
165 transient.reset(); 163 transient.reset();
166 164
165 MessageLoopForUI::current()->RunAllPending();
166
167 // parent should now be active again. 167 // parent should now be active again.
168 EXPECT_TRUE(IsActiveWindow(parent.get())); 168 EXPECT_TRUE(IsActiveWindow(parent.get()));
169 169
170 // Attempting to click unrelated should activate it. 170 // Attempting to click unrelated should activate it.
171 aura::test::EventGenerator e2(unrelated.get()); 171 aura::test::EventGenerator e2(unrelated.get());
172 e2.ClickLeftButton(); 172 e2.ClickLeftButton();
173 EXPECT_TRUE(IsActiveWindow(unrelated.get())); 173 EXPECT_TRUE(IsActiveWindow(unrelated.get()));
174 } 174 }
175 175
176 } // namespace test 176 } // namespace test
177 } // namespace ash 177 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698