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

Side by Side Diff: ash/extended_desktop_unittest.cc

Issue 10700057: Add always on top windows to the alt+tab list (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use most recently used windows. Created 8 years, 5 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
« no previous file with comments | « no previous file | ash/focus_cycler.cc » ('j') | ash/wm/window_cycle_controller.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/display/display_controller.h" 5 #include "ash/display/display_controller.h"
6 #include "ash/display/multi_display_manager.h" 6 #include "ash/display/multi_display_manager.h"
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/wm/window_cycle_controller.h" 9 #include "ash/wm/window_cycle_controller.h"
10 #include "ash/wm/window_util.h" 10 #include "ash/wm/window_util.h"
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 controller->HandleCycleWindow(WindowCycleController::BACKWARD, false); 208 controller->HandleCycleWindow(WindowCycleController::BACKWARD, false);
209 EXPECT_TRUE(wm::IsActiveWindow(d2_w1->GetNativeView())); 209 EXPECT_TRUE(wm::IsActiveWindow(d2_w1->GetNativeView()));
210 210
211 // Cycle through all windows across root windows. 211 // Cycle through all windows across root windows.
212 views::Widget* d1_w2 = CreateTestWidget(gfx::Rect(10, 200, 100, 100)); 212 views::Widget* d1_w2 = CreateTestWidget(gfx::Rect(10, 200, 100, 100));
213 EXPECT_EQ(root_windows[0], d1_w2->GetNativeView()->GetRootWindow()); 213 EXPECT_EQ(root_windows[0], d1_w2->GetNativeView()->GetRootWindow());
214 views::Widget* d2_w2 = CreateTestWidget(gfx::Rect(800, 200, 100, 100)); 214 views::Widget* d2_w2 = CreateTestWidget(gfx::Rect(800, 200, 100, 100));
215 EXPECT_EQ(root_windows[1], d2_w2->GetNativeView()->GetRootWindow()); 215 EXPECT_EQ(root_windows[1], d2_w2->GetNativeView()->GetRootWindow());
216 216
217 controller->HandleCycleWindow(WindowCycleController::FORWARD, true); 217 controller->HandleCycleWindow(WindowCycleController::FORWARD, true);
218 EXPECT_TRUE(wm::IsActiveWindow(d1_w2->GetNativeView()));
219 controller->HandleCycleWindow(WindowCycleController::FORWARD, true);
218 EXPECT_TRUE(wm::IsActiveWindow(d2_w1->GetNativeView())); 220 EXPECT_TRUE(wm::IsActiveWindow(d2_w1->GetNativeView()));
219 controller->HandleCycleWindow(WindowCycleController::FORWARD, true); 221 controller->HandleCycleWindow(WindowCycleController::FORWARD, true);
220 EXPECT_TRUE(wm::IsActiveWindow(d1_w2->GetNativeView()));
221 controller->HandleCycleWindow(WindowCycleController::FORWARD, true);
222 EXPECT_TRUE(wm::IsActiveWindow(d1_w1->GetNativeView())); 222 EXPECT_TRUE(wm::IsActiveWindow(d1_w1->GetNativeView()));
223 controller->HandleCycleWindow(WindowCycleController::FORWARD, true); 223 controller->HandleCycleWindow(WindowCycleController::FORWARD, true);
224 EXPECT_TRUE(wm::IsActiveWindow(d2_w2->GetNativeView())); 224 EXPECT_TRUE(wm::IsActiveWindow(d2_w2->GetNativeView()));
225 225
226 // Backwards 226 // Backwards
227 controller->HandleCycleWindow(WindowCycleController::BACKWARD, true); 227 controller->HandleCycleWindow(WindowCycleController::BACKWARD, true);
228 EXPECT_TRUE(wm::IsActiveWindow(d1_w1->GetNativeView())); 228 EXPECT_TRUE(wm::IsActiveWindow(d1_w1->GetNativeView()));
229 controller->HandleCycleWindow(WindowCycleController::BACKWARD, true); 229 controller->HandleCycleWindow(WindowCycleController::BACKWARD, true);
230 EXPECT_TRUE(wm::IsActiveWindow(d2_w1->GetNativeView()));
231 controller->HandleCycleWindow(WindowCycleController::BACKWARD, true);
230 EXPECT_TRUE(wm::IsActiveWindow(d1_w2->GetNativeView())); 232 EXPECT_TRUE(wm::IsActiveWindow(d1_w2->GetNativeView()));
231 controller->HandleCycleWindow(WindowCycleController::BACKWARD, true); 233 controller->HandleCycleWindow(WindowCycleController::BACKWARD, true);
232 EXPECT_TRUE(wm::IsActiveWindow(d2_w1->GetNativeView()));
233 controller->HandleCycleWindow(WindowCycleController::BACKWARD, true);
234 EXPECT_TRUE(wm::IsActiveWindow(d2_w2->GetNativeView())); 234 EXPECT_TRUE(wm::IsActiveWindow(d2_w2->GetNativeView()));
235 internal::DisplayController::SetVirtualScreenCoordinatesEnabled(false); 235 internal::DisplayController::SetVirtualScreenCoordinatesEnabled(false);
236 } 236 }
237 237
238 TEST_F(ExtendedDesktopTest, GetRootWindowAt) { 238 TEST_F(ExtendedDesktopTest, GetRootWindowAt) {
239 internal::DisplayController::SetVirtualScreenCoordinatesEnabled(true); 239 internal::DisplayController::SetVirtualScreenCoordinatesEnabled(true);
240 UpdateDisplay("0+0-700x500,0+0-500x500"); 240 UpdateDisplay("0+0-700x500,0+0-500x500");
241 Shell::GetInstance()->display_controller()->SetSecondaryDisplayLayout( 241 Shell::GetInstance()->display_controller()->SetSecondaryDisplayLayout(
242 internal::DisplayController::LEFT); 242 internal::DisplayController::LEFT);
243 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); 243 Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 // Convert point in the Root1's window to the Root2's window Coord. 380 // Convert point in the Root1's window to the Root2's window Coord.
381 p.SetPoint(0, 0); 381 p.SetPoint(0, 0);
382 aura::Window::ConvertPointToWindow(root_windows[0], root_windows[1], &p); 382 aura::Window::ConvertPointToWindow(root_windows[0], root_windows[1], &p);
383 EXPECT_EQ("-500,-500", p.ToString()); 383 EXPECT_EQ("-500,-500", p.ToString());
384 p.SetPoint(0, 0); 384 p.SetPoint(0, 0);
385 aura::Window::ConvertPointToWindow(d1, d2, &p); 385 aura::Window::ConvertPointToWindow(d1, d2, &p);
386 EXPECT_EQ("-510,-510", p.ToString()); 386 EXPECT_EQ("-510,-510", p.ToString());
387 } 387 }
388 } // namespace internal 388 } // namespace internal
389 } // namespace ash 389 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/focus_cycler.cc » ('j') | ash/wm/window_cycle_controller.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698