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

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

Issue 9320018: Revert 120092 - Reland 120074 -- Disable animations during aura tests. (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/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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 EXPECT_TRUE(IsActiveWindow(t2)); 161 EXPECT_TRUE(IsActiveWindow(t2));
162 162
163 // Both transients should be destroyed with parent. 163 // Both transients should be destroyed with parent.
164 parent.reset(); 164 parent.reset();
165 EXPECT_TRUE(do1.destroyed()); 165 EXPECT_TRUE(do1.destroyed());
166 EXPECT_TRUE(do2.destroyed()); 166 EXPECT_TRUE(do2.destroyed());
167 } 167 }
168 168
169 // Tests that we can activate an unrelated window after a modal window is closed 169 // Tests that we can activate an unrelated window after a modal window is closed
170 // for a window. 170 // for a window.
171 // TODO(beng): This test is disabled pending a solution re: visibility & target
172 // visibility.
171 TEST_F(SystemModalContainerLayoutManagerTest, 173 TEST_F(SystemModalContainerLayoutManagerTest,
172 CanActivateAfterEndModalSession) { 174 DISABLED_CanActivateAfterEndModalSession) {
173 scoped_ptr<aura::Window> unrelated(TestWindow::OpenTestWindow(NULL, false)); 175 scoped_ptr<aura::Window> unrelated(TestWindow::OpenTestWindow(NULL, false));
174 unrelated->SetBounds(gfx::Rect(100, 100, 50, 50)); 176 unrelated->SetBounds(gfx::Rect(100, 100, 50, 50));
175 scoped_ptr<aura::Window> parent(TestWindow::OpenTestWindow(NULL, false)); 177 scoped_ptr<aura::Window> parent(TestWindow::OpenTestWindow(NULL, false));
176 // parent should be active. 178 // parent should be active.
177 EXPECT_TRUE(IsActiveWindow(parent.get())); 179 EXPECT_TRUE(IsActiveWindow(parent.get()));
178 180
179 scoped_ptr<aura::Window> transient( 181 scoped_ptr<aura::Window> transient(
180 TestWindow::OpenTestWindow(parent.get(), true)); 182 TestWindow::OpenTestWindow(parent.get(), true));
181 // t1 should now be active. 183 // t1 should now be active.
182 EXPECT_TRUE(IsActiveWindow(transient.get())); 184 EXPECT_TRUE(IsActiveWindow(transient.get()));
183 185
184 // Attempting to click the parent should result in no activation change. 186 // Attempting to click the parent should result in no activation change.
185 aura::test::EventGenerator e1(parent.get()); 187 aura::test::EventGenerator e1(parent.get());
186 e1.ClickLeftButton(); 188 e1.ClickLeftButton();
187 EXPECT_TRUE(IsActiveWindow(transient.get())); 189 EXPECT_TRUE(IsActiveWindow(transient.get()));
188 190
189 // Now close the transient. 191 // Now close the transient.
190 transient.reset(); 192 transient.reset();
191 193
192 MessageLoopForUI::current()->RunAllPending();
193
194 // parent should now be active again. 194 // parent should now be active again.
195 EXPECT_TRUE(IsActiveWindow(parent.get())); 195 EXPECT_TRUE(IsActiveWindow(parent.get()));
196 196
197 // Attempting to click unrelated should activate it. 197 // Attempting to click unrelated should activate it.
198 aura::test::EventGenerator e2(unrelated.get()); 198 aura::test::EventGenerator e2(unrelated.get());
199 e2.ClickLeftButton(); 199 e2.ClickLeftButton();
200 EXPECT_TRUE(IsActiveWindow(unrelated.get())); 200 EXPECT_TRUE(IsActiveWindow(unrelated.get()));
201 } 201 }
202 202
203 TEST_F(SystemModalContainerLayoutManagerTest, 203 TEST_F(SystemModalContainerLayoutManagerTest,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 EXPECT_EQ(1, main_delegate->mouse_presses()); 237 EXPECT_EQ(1, main_delegate->mouse_presses());
238 238
239 // Verify that none of the other containers received any more mouse presses. 239 // Verify that none of the other containers received any more mouse presses.
240 EXPECT_EQ(1, transient_delegate->mouse_presses()); 240 EXPECT_EQ(1, transient_delegate->mouse_presses());
241 EXPECT_EQ(1, lock_delegate->mouse_presses()); 241 EXPECT_EQ(1, lock_delegate->mouse_presses());
242 EXPECT_EQ(1, lock_modal_delegate->mouse_presses()); 242 EXPECT_EQ(1, lock_modal_delegate->mouse_presses());
243 } 243 }
244 244
245 } // namespace test 245 } // namespace test
246 } // namespace ash 246 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/system_modal_container_layout_manager.cc ('k') | ash/wm/visibility_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698