| 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/workspace/workspace_window_resizer.h" | 5 #include "ash/wm/workspace/workspace_window_resizer.h" |
| 6 | 6 |
| 7 #include "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
| 8 #include "ash/display/mouse_cursor_event_filter.h" | 8 #include "ash/display/mouse_cursor_event_filter.h" |
| 9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
| 10 #include "ash/screen_ash.h" | 10 #include "ash/screen_ash.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 scoped_ptr<aura::Window> window2_; | 156 scoped_ptr<aura::Window> window2_; |
| 157 scoped_ptr<aura::Window> window3_; | 157 scoped_ptr<aura::Window> window3_; |
| 158 scoped_ptr<aura::Window> window4_; | 158 scoped_ptr<aura::Window> window4_; |
| 159 | 159 |
| 160 private: | 160 private: |
| 161 DISALLOW_COPY_AND_ASSIGN(WorkspaceWindowResizerTest); | 161 DISALLOW_COPY_AND_ASSIGN(WorkspaceWindowResizerTest); |
| 162 }; | 162 }; |
| 163 | 163 |
| 164 } // namespace | 164 } // namespace |
| 165 | 165 |
| 166 // Fails on win_aura since ash::GetRootWindowRelativeToWindow is not implemented |
| 167 // yet for the platform. |
| 168 #if defined(OS_WIN) |
| 169 #define MAYBE_WindowDragWithMultiDisplays \ |
| 170 DISABLED_WindowDragWithMultiDisplays |
| 171 #define MAYBE_WindowDragWithMultiDisplaysRightToLeft \ |
| 172 DISABLED_WindowDragWithMultiDisplaysRightToLeft |
| 173 #define MAYBE_PhantomStyle DISABLED_PhantomStyle |
| 174 #define MAYBE_CancelSnapPhantom DISABLED_CancelSnapPhantom |
| 175 #define MAYBE_CursorDeviceScaleFactor DISABLED_CursorDeviceScaleFactor |
| 176 #else |
| 177 #define MAYBE_WindowDragWithMultiDisplays WindowDragWithMultiDisplays |
| 178 #define MAYBE_WindowDragWithMultiDisplaysRightToLeft \ |
| 179 WindowDragWithMultiDisplaysRightToLeft |
| 180 #define MAYBE_PhantomStyle PhantomStyle |
| 181 #define MAYBE_CancelSnapPhantom CancelSnapPhantom |
| 182 #define MAYBE_CursorDeviceScaleFactor CursorDeviceScaleFactor |
| 183 #endif |
| 184 |
| 166 // Assertions around attached window resize dragging from the right with 2 | 185 // Assertions around attached window resize dragging from the right with 2 |
| 167 // windows. | 186 // windows. |
| 168 TEST_F(WorkspaceWindowResizerTest, AttachedResize_RIGHT_2) { | 187 TEST_F(WorkspaceWindowResizerTest, AttachedResize_RIGHT_2) { |
| 169 window_->SetBounds(gfx::Rect(0, 300, 400, 300)); | 188 window_->SetBounds(gfx::Rect(0, 300, 400, 300)); |
| 170 window2_->SetBounds(gfx::Rect(400, 200, 100, 200)); | 189 window2_->SetBounds(gfx::Rect(400, 200, 100, 200)); |
| 171 | 190 |
| 172 std::vector<aura::Window*> windows; | 191 std::vector<aura::Window*> windows; |
| 173 windows.push_back(window2_.get()); | 192 windows.push_back(window2_.get()); |
| 174 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( | 193 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( |
| 175 window_.get(), gfx::Point(), HTRIGHT, windows)); | 194 window_.get(), gfx::Point(), HTRIGHT, windows)); |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 | 383 |
| 365 // Revert and make sure everything moves back. | 384 // Revert and make sure everything moves back. |
| 366 resizer->Drag(CalculateDragPoint(*resizer, 800, 20), 0); | 385 resizer->Drag(CalculateDragPoint(*resizer, 800, 20), 0); |
| 367 resizer->RevertDrag(); | 386 resizer->RevertDrag(); |
| 368 EXPECT_EQ("0,50 400x200", window_->bounds().ToString()); | 387 EXPECT_EQ("0,50 400x200", window_->bounds().ToString()); |
| 369 EXPECT_EQ("0,250 200x100", window2_->bounds().ToString()); | 388 EXPECT_EQ("0,250 200x100", window2_->bounds().ToString()); |
| 370 } | 389 } |
| 371 | 390 |
| 372 // Assertions around attached window resize dragging from the bottom with 3 | 391 // Assertions around attached window resize dragging from the bottom with 3 |
| 373 // windows. | 392 // windows. |
| 374 TEST_F(WorkspaceWindowResizerTest, AttachedResize_BOTTOM_3) { | 393 // TODO(oshima): Host window doesn't get a resize event after |
| 394 // SetHostSize on Windows trybot, which gives wrong work/display area. |
| 395 // crbug.com/141577. |
| 396 #if defined(OS_WIN) |
| 397 #define MAYBE_AttachedResize_BOTTOM_3 DISABLED_AttachedResize_BOTTOM_3 |
| 398 #else |
| 399 #define MAYBE_AttachedResize_BOTTOM_3 AttachedResize_BOTTOM_3 |
| 400 #endif |
| 401 TEST_F(WorkspaceWindowResizerTest, MAYBE_AttachedResize_BOTTOM_3) { |
| 375 aura::RootWindow* root = Shell::GetPrimaryRootWindow(); | 402 aura::RootWindow* root = Shell::GetPrimaryRootWindow(); |
| 376 root->SetHostSize(gfx::Size(600, 800)); | 403 root->SetHostSize(gfx::Size(600, 800)); |
| 377 | 404 |
| 378 Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets()); | 405 Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets()); |
| 379 | 406 |
| 380 window_->SetBounds(gfx::Rect( 300, 100, 300, 200)); | 407 window_->SetBounds(gfx::Rect( 300, 100, 300, 200)); |
| 381 window2_->SetBounds(gfx::Rect(300, 300, 200, 150)); | 408 window2_->SetBounds(gfx::Rect(300, 300, 200, 150)); |
| 382 window3_->SetBounds(gfx::Rect(300, 450, 200, 100)); | 409 window3_->SetBounds(gfx::Rect(300, 450, 200, 100)); |
| 383 delegate2_.set_min_size(gfx::Size(50, 52)); | 410 delegate2_.set_min_size(gfx::Size(50, 52)); |
| 384 delegate3_.set_min_size(gfx::Size(50, 38)); | 411 delegate3_.set_min_size(gfx::Size(50, 38)); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 ASSERT_TRUE(resizer.get()); | 499 ASSERT_TRUE(resizer.get()); |
| 473 resizer->Drag(CalculateDragPoint(*resizer, 800, 10), 0); | 500 resizer->Drag(CalculateDragPoint(*resizer, 800, 10), 0); |
| 474 resizer->CompleteDrag(0); | 501 resizer->CompleteDrag(0); |
| 475 EXPECT_EQ("80,0 720x" + base::IntToString(bottom), | 502 EXPECT_EQ("80,0 720x" + base::IntToString(bottom), |
| 476 window_->bounds().ToString()); | 503 window_->bounds().ToString()); |
| 477 ASSERT_TRUE(GetRestoreBoundsInScreen(window_.get())); | 504 ASSERT_TRUE(GetRestoreBoundsInScreen(window_.get())); |
| 478 EXPECT_EQ("20,30 50x60", | 505 EXPECT_EQ("20,30 50x60", |
| 479 GetRestoreBoundsInScreen(window_.get())->ToString()); | 506 GetRestoreBoundsInScreen(window_.get())->ToString()); |
| 480 } | 507 } |
| 481 | 508 |
| 509 #if !defined(OS_WIN) |
| 482 // Test if the restore bounds is correct in multiple displays. | 510 // Test if the restore bounds is correct in multiple displays. |
| 483 ClearRestoreBounds(window_.get()); | 511 ClearRestoreBounds(window_.get()); |
| 484 UpdateDisplay("800x600,200x600"); | 512 UpdateDisplay("800x600,200x600"); |
| 485 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); | 513 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); |
| 486 EXPECT_EQ(root_windows[0], window_->GetRootWindow()); | 514 EXPECT_EQ(root_windows[0], window_->GetRootWindow()); |
| 487 window_->SetBoundsInScreen(gfx::Rect(800, 10, 50, 60), | 515 window_->SetBoundsInScreen(gfx::Rect(800, 10, 50, 60), |
| 488 ScreenAsh::GetSecondaryDisplay()); | 516 ScreenAsh::GetSecondaryDisplay()); |
| 489 EXPECT_EQ(root_windows[1], window_->GetRootWindow()); | 517 EXPECT_EQ(root_windows[1], window_->GetRootWindow()); |
| 490 { | 518 { |
| 491 bottom = | 519 bottom = |
| 492 ScreenAsh::GetDisplayWorkAreaBoundsInParent(window_.get()).bottom(); | 520 ScreenAsh::GetDisplayWorkAreaBoundsInParent(window_.get()).bottom(); |
| 493 EXPECT_EQ("800,10 50x60", window_->GetBoundsInScreen().ToString()); | 521 EXPECT_EQ("800,10 50x60", window_->GetBoundsInScreen().ToString()); |
| 494 | 522 |
| 495 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( | 523 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( |
| 496 window_.get(), gfx::Point(), HTCAPTION, empty_windows())); | 524 window_.get(), gfx::Point(), HTCAPTION, empty_windows())); |
| 497 ASSERT_TRUE(resizer.get()); | 525 ASSERT_TRUE(resizer.get()); |
| 498 | 526 |
| 499 resizer->Drag(CalculateDragPoint(*resizer, 199, 00), 0); | 527 resizer->Drag(CalculateDragPoint(*resizer, 199, 00), 0); |
| 500 resizer->CompleteDrag(0); | 528 resizer->CompleteDrag(0); |
| 501 // With the resolution of 200x600 we will hit in this case the 50% screen | 529 // With the resolution of 200x600 we will hit in this case the 50% screen |
| 502 // size setting. | 530 // size setting. |
| 503 EXPECT_EQ("100,0 100x" + base::IntToString(bottom), | 531 EXPECT_EQ("100,0 100x" + base::IntToString(bottom), |
| 504 window_->bounds().ToString()); | 532 window_->bounds().ToString()); |
| 505 EXPECT_EQ("800,10 50x60", | 533 EXPECT_EQ("800,10 50x60", |
| 506 GetRestoreBoundsInScreen(window_.get())->ToString()); | 534 GetRestoreBoundsInScreen(window_.get())->ToString()); |
| 507 } | 535 } |
| 536 #endif |
| 508 } | 537 } |
| 509 | 538 |
| 510 // Check that non resizable windows will not get resized. | 539 // Check that non resizable windows will not get resized. |
| 511 TEST_F(WorkspaceWindowResizerTest, NonResizableWindows) { | 540 TEST_F(WorkspaceWindowResizerTest, NonResizableWindows) { |
| 512 window_->SetBounds(gfx::Rect(20, 30, 50, 60)); | 541 window_->SetBounds(gfx::Rect(20, 30, 50, 60)); |
| 513 window_->SetProperty(aura::client::kCanResizeKey, false); | 542 window_->SetProperty(aura::client::kCanResizeKey, false); |
| 514 | 543 |
| 515 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( | 544 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( |
| 516 window_.get(), gfx::Point(), HTCAPTION, empty_windows())); | 545 window_.get(), gfx::Point(), HTCAPTION, empty_windows())); |
| 517 ASSERT_TRUE(resizer.get()); | 546 ASSERT_TRUE(resizer.get()); |
| 518 resizer->Drag(CalculateDragPoint(*resizer, -20, 0), 0); | 547 resizer->Drag(CalculateDragPoint(*resizer, -20, 0), 0); |
| 519 resizer->CompleteDrag(0); | 548 resizer->CompleteDrag(0); |
| 520 EXPECT_EQ("0,30 50x60", window_->bounds().ToString()); | 549 EXPECT_EQ("0,30 50x60", window_->bounds().ToString()); |
| 521 } | 550 } |
| 522 | 551 |
| 523 // Verifies a window can be moved from the primary display to another. | 552 // Verifies a window can be moved from the primary display to another. |
| 524 TEST_F(WorkspaceWindowResizerTest, WindowDragWithMultiDisplays) { | 553 TEST_F(WorkspaceWindowResizerTest, MAYBE_WindowDragWithMultiDisplays) { |
| 525 // The secondary display is logically on the right, but on the system (e.g. X) | 554 // The secondary display is logically on the right, but on the system (e.g. X) |
| 526 // layer, it's below the primary one. See UpdateDisplay() in ash_test_base.cc. | 555 // layer, it's below the primary one. See UpdateDisplay() in ash_test_base.cc. |
| 527 UpdateDisplay("800x600,800x600"); | 556 UpdateDisplay("800x600,800x600"); |
| 528 shelf_layout_manager()->LayoutShelf(); | 557 shelf_layout_manager()->LayoutShelf(); |
| 529 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); | 558 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); |
| 530 ASSERT_EQ(2U, root_windows.size()); | 559 ASSERT_EQ(2U, root_windows.size()); |
| 531 | 560 |
| 532 window_->SetBoundsInScreen(gfx::Rect(0, 0, 50, 60), | 561 window_->SetBoundsInScreen(gfx::Rect(0, 0, 50, 60), |
| 533 Shell::GetScreen()->GetPrimaryDisplay()); | 562 Shell::GetScreen()->GetPrimaryDisplay()); |
| 534 EXPECT_EQ(root_windows[0], window_->GetRootWindow()); | 563 EXPECT_EQ(root_windows[0], window_->GetRootWindow()); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 // Since the pointer is on the secondary, the parent should be changed | 606 // Since the pointer is on the secondary, the parent should be changed |
| 578 // even though only small fraction of the window is within the secondary | 607 // even though only small fraction of the window is within the secondary |
| 579 // root window's bounds. | 608 // root window's bounds. |
| 580 EXPECT_EQ(root_windows[1], window_->GetRootWindow()); | 609 EXPECT_EQ(root_windows[1], window_->GetRootWindow()); |
| 581 EXPECT_EQ("-49,10 50x60", window_->bounds().ToString()); | 610 EXPECT_EQ("-49,10 50x60", window_->bounds().ToString()); |
| 582 } | 611 } |
| 583 } | 612 } |
| 584 | 613 |
| 585 // Verifies a window can be moved from the secondary display to primary. | 614 // Verifies a window can be moved from the secondary display to primary. |
| 586 TEST_F(WorkspaceWindowResizerTest, | 615 TEST_F(WorkspaceWindowResizerTest, |
| 587 WindowDragWithMultiDisplaysRightToLeft) { | 616 MAYBE_WindowDragWithMultiDisplaysRightToLeft) { |
| 588 UpdateDisplay("800x600,800x600"); | 617 UpdateDisplay("800x600,800x600"); |
| 589 shelf_layout_manager()->LayoutShelf(); | 618 shelf_layout_manager()->LayoutShelf(); |
| 590 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); | 619 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); |
| 591 ASSERT_EQ(2U, root_windows.size()); | 620 ASSERT_EQ(2U, root_windows.size()); |
| 592 | 621 |
| 593 window_->SetBoundsInScreen( | 622 window_->SetBoundsInScreen( |
| 594 gfx::Rect(800, 00, 50, 60), | 623 gfx::Rect(800, 00, 50, 60), |
| 595 Shell::GetScreen()->GetDisplayNearestWindow(root_windows[1])); | 624 Shell::GetScreen()->GetDisplayNearestWindow(root_windows[1])); |
| 596 EXPECT_EQ(root_windows[1], window_->GetRootWindow()); | 625 EXPECT_EQ(root_windows[1], window_->GetRootWindow()); |
| 597 { | 626 { |
| 598 // Grab (0, 0) of the window. | 627 // Grab (0, 0) of the window. |
| 599 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( | 628 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( |
| 600 window_.get(), gfx::Point(), HTCAPTION, empty_windows())); | 629 window_.get(), gfx::Point(), HTCAPTION, empty_windows())); |
| 601 ASSERT_TRUE(resizer.get()); | 630 ASSERT_TRUE(resizer.get()); |
| 602 // Move the mouse near the right edge, (798, 0), of the primary display. | 631 // Move the mouse near the right edge, (798, 0), of the primary display. |
| 603 resizer->Drag(CalculateDragPoint(*resizer, -2, 0), ui::EF_CONTROL_DOWN); | 632 resizer->Drag(CalculateDragPoint(*resizer, -2, 0), ui::EF_CONTROL_DOWN); |
| 604 resizer->CompleteDrag(0); | 633 resizer->CompleteDrag(0); |
| 605 EXPECT_EQ(root_windows[0], window_->GetRootWindow()); | 634 EXPECT_EQ(root_windows[0], window_->GetRootWindow()); |
| 606 EXPECT_EQ("798,0 50x60", window_->bounds().ToString()); | 635 EXPECT_EQ("798,0 50x60", window_->bounds().ToString()); |
| 607 } | 636 } |
| 608 } | 637 } |
| 609 | 638 |
| 610 // Verifies the style of the drag phantom window is correct. | 639 // Verifies the style of the drag phantom window is correct. |
| 611 TEST_F(WorkspaceWindowResizerTest, PhantomStyle) { | 640 TEST_F(WorkspaceWindowResizerTest, MAYBE_PhantomStyle) { |
| 612 UpdateDisplay("800x600,800x600"); | 641 UpdateDisplay("800x600,800x600"); |
| 613 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); | 642 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); |
| 614 ASSERT_EQ(2U, root_windows.size()); | 643 ASSERT_EQ(2U, root_windows.size()); |
| 615 | 644 |
| 616 window_->SetBoundsInScreen(gfx::Rect(0, 0, 50, 60), | 645 window_->SetBoundsInScreen(gfx::Rect(0, 0, 50, 60), |
| 617 Shell::GetScreen()->GetPrimaryDisplay()); | 646 Shell::GetScreen()->GetPrimaryDisplay()); |
| 618 EXPECT_EQ(root_windows[0], window_->GetRootWindow()); | 647 EXPECT_EQ(root_windows[0], window_->GetRootWindow()); |
| 619 EXPECT_FLOAT_EQ(1.0f, window_->layer()->opacity()); | 648 EXPECT_FLOAT_EQ(1.0f, window_->layer()->opacity()); |
| 620 { | 649 { |
| 621 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( | 650 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 EXPECT_FALSE(resizer->drag_phantom_window_controller_.get()); | 705 EXPECT_FALSE(resizer->drag_phantom_window_controller_.get()); |
| 677 | 706 |
| 678 resizer->Drag(CalculateDragPoint(*resizer, 0, 610), 0); | 707 resizer->Drag(CalculateDragPoint(*resizer, 0, 610), 0); |
| 679 resizer->RevertDrag(); | 708 resizer->RevertDrag(); |
| 680 EXPECT_EQ(root_windows[0], window_->GetRootWindow()); | 709 EXPECT_EQ(root_windows[0], window_->GetRootWindow()); |
| 681 EXPECT_FLOAT_EQ(1.0f, window_->layer()->opacity()); | 710 EXPECT_FLOAT_EQ(1.0f, window_->layer()->opacity()); |
| 682 } | 711 } |
| 683 } | 712 } |
| 684 | 713 |
| 685 // Verifies the style of the drag phantom window is correct. | 714 // Verifies the style of the drag phantom window is correct. |
| 686 TEST_F(WorkspaceWindowResizerTest, CancelSnapPhantom) { | 715 TEST_F(WorkspaceWindowResizerTest, MAYBE_CancelSnapPhantom) { |
| 687 UpdateDisplay("800x600,800x600"); | 716 UpdateDisplay("800x600,800x600"); |
| 688 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); | 717 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); |
| 689 ASSERT_EQ(2U, root_windows.size()); | 718 ASSERT_EQ(2U, root_windows.size()); |
| 690 | 719 |
| 691 window_->SetBoundsInScreen(gfx::Rect(0, 0, 50, 60), | 720 window_->SetBoundsInScreen(gfx::Rect(0, 0, 50, 60), |
| 692 Shell::GetScreen()->GetPrimaryDisplay()); | 721 Shell::GetScreen()->GetPrimaryDisplay()); |
| 693 EXPECT_EQ(root_windows[0], window_->GetRootWindow()); | 722 EXPECT_EQ(root_windows[0], window_->GetRootWindow()); |
| 694 EXPECT_FLOAT_EQ(1.0f, window_->layer()->opacity()); | 723 EXPECT_FLOAT_EQ(1.0f, window_->layer()->opacity()); |
| 695 { | 724 { |
| 696 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( | 725 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( |
| (...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1364 | 1393 |
| 1365 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( | 1394 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( |
| 1366 window_.get(), gfx::Point(), HTLEFT, empty_windows())); | 1395 window_.get(), gfx::Point(), HTLEFT, empty_windows())); |
| 1367 ASSERT_TRUE(resizer.get()); | 1396 ASSERT_TRUE(resizer.get()); |
| 1368 resizer->Drag(CalculateDragPoint(*resizer, 0, 0), 0); | 1397 resizer->Drag(CalculateDragPoint(*resizer, 0, 0), 0); |
| 1369 EXPECT_EQ("99,200 21x30", window_->bounds().ToString()); | 1398 EXPECT_EQ("99,200 21x30", window_->bounds().ToString()); |
| 1370 } | 1399 } |
| 1371 | 1400 |
| 1372 // Verifies cursor's device scale factor is updated whe a window is moved across | 1401 // Verifies cursor's device scale factor is updated whe a window is moved across |
| 1373 // root windows with different device scale factors (http://crbug.com/154183). | 1402 // root windows with different device scale factors (http://crbug.com/154183). |
| 1374 TEST_F(WorkspaceWindowResizerTest, CursorDeviceScaleFactor) { | 1403 TEST_F(WorkspaceWindowResizerTest, MAYBE_CursorDeviceScaleFactor) { |
| 1375 // The secondary display is logically on the right, but on the system (e.g. X) | 1404 // The secondary display is logically on the right, but on the system (e.g. X) |
| 1376 // layer, it's below the primary one. See UpdateDisplay() in ash_test_base.cc. | 1405 // layer, it's below the primary one. See UpdateDisplay() in ash_test_base.cc. |
| 1377 UpdateDisplay("400x400,800x800*2"); | 1406 UpdateDisplay("400x400,800x800*2"); |
| 1378 shelf_layout_manager()->LayoutShelf(); | 1407 shelf_layout_manager()->LayoutShelf(); |
| 1379 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); | 1408 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); |
| 1380 ASSERT_EQ(2U, root_windows.size()); | 1409 ASSERT_EQ(2U, root_windows.size()); |
| 1381 | 1410 |
| 1382 test::CursorManagerTestApi cursor_test_api( | 1411 test::CursorManagerTestApi cursor_test_api( |
| 1383 Shell::GetInstance()->cursor_manager()); | 1412 Shell::GetInstance()->cursor_manager()); |
| 1384 MouseCursorEventFilter* event_filter = | 1413 MouseCursorEventFilter* event_filter = |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1722 ASSERT_TRUE(resizer.get()); | 1751 ASSERT_TRUE(resizer.get()); |
| 1723 // Move it 50 to the left, which should contract w1 and expand w2-3. | 1752 // Move it 50 to the left, which should contract w1 and expand w2-3. |
| 1724 resizer->Drag(CalculateDragPoint(*resizer, -50, 0), 0); | 1753 resizer->Drag(CalculateDragPoint(*resizer, -50, 0), 0); |
| 1725 EXPECT_EQ("100,100 98x100", window_->bounds().ToString()); | 1754 EXPECT_EQ("100,100 98x100", window_->bounds().ToString()); |
| 1726 EXPECT_EQ("198,100 101x100", window2_->bounds().ToString()); | 1755 EXPECT_EQ("198,100 101x100", window2_->bounds().ToString()); |
| 1727 EXPECT_EQ("299,100 101x100", window3_->bounds().ToString()); | 1756 EXPECT_EQ("299,100 101x100", window3_->bounds().ToString()); |
| 1728 } | 1757 } |
| 1729 | 1758 |
| 1730 } // namespace internal | 1759 } // namespace internal |
| 1731 } // namespace ash | 1760 } // namespace ash |
| OLD | NEW |