OLD | NEW |
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/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
9 #include "ash/test/ash_test_base.h" | 9 #include "ash/test/ash_test_base.h" |
10 #include "ash/test/test_activation_delegate.h" | 10 #include "ash/test/test_activation_delegate.h" |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 Shell::GetContainer(Shell::GetPrimaryRootWindow(), c3); | 526 Shell::GetContainer(Shell::GetPrimaryRootWindow(), c3); |
527 aura::test::TestWindowDelegate wd; | 527 aura::test::TestWindowDelegate wd; |
528 scoped_ptr<aura::Window> w1(aura::test::CreateTestWindowWithDelegate( | 528 scoped_ptr<aura::Window> w1(aura::test::CreateTestWindowWithDelegate( |
529 &wd, -1, gfx::Rect(50, 50, 50, 50), lock_container)); | 529 &wd, -1, gfx::Rect(50, 50, 50, 50), lock_container)); |
530 | 530 |
531 lock_container->layer()->SetVisible(false); | 531 lock_container->layer()->SetVisible(false); |
532 w1->Focus(); | 532 w1->Focus(); |
533 EXPECT_TRUE(w1->HasFocus()); | 533 EXPECT_TRUE(w1->HasFocus()); |
534 } | 534 } |
535 | 535 |
536 #if defined(OS_WIN) | |
537 // Multiple displays are not supported on Windows Ash. http://crbug.com/165962 | |
538 #define MAYBE_NextActiveWindowOnMultipleDisplays \ | |
539 DISABLED_NextActiveWindowOnMultipleDisplays | |
540 #else | |
541 #define MAYBE_NextActiveWindowOnMultipleDisplays \ | |
542 NextActiveWindowOnMultipleDisplays | |
543 #endif | |
544 | |
545 // Verifies that a next active window is chosen from current | 536 // Verifies that a next active window is chosen from current |
546 // active display. | 537 // active display. |
547 TEST_F(ActivationControllerTest, MAYBE_NextActiveWindowOnMultipleDisplays) { | 538 TEST_F(ActivationControllerTest, NextActiveWindowOnMultipleDisplays) { |
| 539 if (!SupportsMultipleDisplays()) |
| 540 return; |
| 541 |
548 UpdateDisplay("300x300,300x300"); | 542 UpdateDisplay("300x300,300x300"); |
549 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); | 543 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); |
550 | 544 |
551 scoped_ptr<aura::Window> w1_d1(CreateTestWindowInShellWithBounds( | 545 scoped_ptr<aura::Window> w1_d1(CreateTestWindowInShellWithBounds( |
552 gfx::Rect(10, 10, 100, 100))); | 546 gfx::Rect(10, 10, 100, 100))); |
553 scoped_ptr<aura::Window> w2_d1(CreateTestWindowInShellWithBounds( | 547 scoped_ptr<aura::Window> w2_d1(CreateTestWindowInShellWithBounds( |
554 gfx::Rect(20, 20, 100, 100))); | 548 gfx::Rect(20, 20, 100, 100))); |
555 | 549 |
556 EXPECT_EQ(root_windows[0], w1_d1->GetRootWindow()); | 550 EXPECT_EQ(root_windows[0], w1_d1->GetRootWindow()); |
557 EXPECT_EQ(root_windows[0], w2_d1->GetRootWindow()); | 551 EXPECT_EQ(root_windows[0], w2_d1->GetRootWindow()); |
(...skipping 14 matching lines...) Expand all Loading... |
572 EXPECT_EQ(w2_d1.get(), client->GetActiveWindow()); | 566 EXPECT_EQ(w2_d1.get(), client->GetActiveWindow()); |
573 | 567 |
574 client->ActivateWindow(w3_d2.get()); | 568 client->ActivateWindow(w3_d2.get()); |
575 EXPECT_EQ(w3_d2.get(), client->GetActiveWindow()); | 569 EXPECT_EQ(w3_d2.get(), client->GetActiveWindow()); |
576 w3_d2.reset(); | 570 w3_d2.reset(); |
577 EXPECT_EQ(w4_d2.get(), client->GetActiveWindow()); | 571 EXPECT_EQ(w4_d2.get(), client->GetActiveWindow()); |
578 } | 572 } |
579 | 573 |
580 } // namespace test | 574 } // namespace test |
581 } // namespace ash | 575 } // namespace ash |
OLD | NEW |