| 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 "ui/display/manager/display_manager.h" | 5 #include "ui/display/manager/display_manager.h" |
| 6 | 6 |
| 7 #include "ash/accelerators/accelerator_commands_aura.h" | 7 #include "ash/accelerators/accelerator_commands_aura.h" |
| 8 #include "ash/common/ash_switches.h" | 8 #include "ash/common/ash_switches.h" |
| 9 #include "ash/common/material_design/material_design_controller.h" | 9 #include "ash/common/material_design/material_design_controller.h" |
| 10 #include "ash/common/wm/window_state.h" | 10 #include "ash/common/wm/window_state.h" |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 list, builder.Build()); | 355 list, builder.Build()); |
| 356 | 356 |
| 357 UpdateDisplay("640x480,320x200,400x300"); | 357 UpdateDisplay("640x480,320x200,400x300"); |
| 358 | 358 |
| 359 EXPECT_EQ(3U, display_manager()->GetNumDisplays()); | 359 EXPECT_EQ(3U, display_manager()->GetNumDisplays()); |
| 360 | 360 |
| 361 EXPECT_EQ("0,0 640x480", | 361 EXPECT_EQ("0,0 640x480", |
| 362 display_manager()->GetDisplayAt(0).bounds().ToString()); | 362 display_manager()->GetDisplayAt(0).bounds().ToString()); |
| 363 EXPECT_EQ("-320,10 320x200", | 363 EXPECT_EQ("-320,10 320x200", |
| 364 display_manager()->GetDisplayAt(1).bounds().ToString()); | 364 display_manager()->GetDisplayAt(1).bounds().ToString()); |
| 365 EXPECT_EQ("-310,-290 400x300", | 365 |
| 366 // The above layout causes an overlap between [P] and [2], making [2]'s |
| 367 // bounds be "-310,-290 400x300" if the overlap is not fixed. The overlap |
| 368 // must be detected and fixed and [2] is shifted up to remove the overlap. |
| 369 EXPECT_EQ("-310,-300 400x300", |
| 366 display_manager()->GetDisplayAt(2).bounds().ToString()); | 370 display_manager()->GetDisplayAt(2).bounds().ToString()); |
| 367 } | 371 } |
| 368 { | 372 { |
| 369 // Layout: [1] | 373 // Layout: [1] |
| 370 // [P][2] | 374 // [P][2] |
| 371 display::DisplayLayoutBuilder builder(primary_id); | 375 display::DisplayLayoutBuilder builder(primary_id); |
| 372 builder.AddDisplayPlacement(list[1], primary_id, | 376 builder.AddDisplayPlacement(list[1], primary_id, |
| 373 display::DisplayPlacement::TOP, 10); | 377 display::DisplayPlacement::TOP, 10); |
| 374 builder.AddDisplayPlacement(list[2], primary_id, | 378 builder.AddDisplayPlacement(list[2], primary_id, |
| 375 display::DisplayPlacement::RIGHT, 10); | 379 display::DisplayPlacement::RIGHT, 10); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 display_manager()->GetDisplayAt(4).bounds().ToString()); | 448 display_manager()->GetDisplayAt(4).bounds().ToString()); |
| 445 // 3rd is the left of 4th. | 449 // 3rd is the left of 4th. |
| 446 EXPECT_EQ("-290,480 300x200", | 450 EXPECT_EQ("-290,480 300x200", |
| 447 display_manager()->GetDisplayAt(3).bounds().ToString()); | 451 display_manager()->GetDisplayAt(3).bounds().ToString()); |
| 448 // 1st is the bottom of 3rd. | 452 // 1st is the bottom of 3rd. |
| 449 EXPECT_EQ("-280,680 320x200", | 453 EXPECT_EQ("-280,680 320x200", |
| 450 display_manager()->GetDisplayAt(1).bounds().ToString()); | 454 display_manager()->GetDisplayAt(1).bounds().ToString()); |
| 451 } | 455 } |
| 452 } | 456 } |
| 453 | 457 |
| 458 // Makes sure that layouts with overlapped displays are detected and fixed when |
| 459 // applied. |
| 460 TEST_P(DisplayManagerTest, NoOverlappedDisplays) { |
| 461 int64_t primary_id = display::Screen::GetScreen()->GetPrimaryDisplay().id(); |
| 462 { |
| 463 // Layout with multiple overlaps and special cases: |
| 464 // |
| 465 // +-----+ |
| 466 // +----+-+6 | |
| 467 // | 5 | | | |
| 468 // +----+----+ | | |
| 469 // | 7 | | | | |
| 470 // +----+----+-+---+---+-+---------+ |
| 471 // | | P | | 2 | |
| 472 // +------+ | | +----------+ |
| 473 // | | | | 3 | |
| 474 // | | | | | |
| 475 // +--+----+-+-+-+-----+--+ | |
| 476 // | 1 | | 4 | | | |
| 477 // | | | +--+-------+ |
| 478 // | | | | |
| 479 // +--------+ +--------+ |
| 480 |
| 481 display::DisplayIdList list = display::test::CreateDisplayIdListN( |
| 482 8, primary_id, primary_id + 1, primary_id + 2, primary_id + 3, |
| 483 primary_id + 4, primary_id + 5, primary_id + 6, primary_id + 7); |
| 484 display::DisplayLayoutBuilder builder(primary_id); |
| 485 builder.AddDisplayPlacement(list[1], primary_id, |
| 486 display::DisplayPlacement::BOTTOM, 50); |
| 487 builder.AddDisplayPlacement(list[2], list[1], |
| 488 display::DisplayPlacement::TOP, 300); |
| 489 builder.AddDisplayPlacement(list[3], list[2], |
| 490 display::DisplayPlacement::RIGHT, 30); |
| 491 builder.AddDisplayPlacement(list[4], list[2], |
| 492 display::DisplayPlacement::BOTTOM, 400); |
| 493 builder.AddDisplayPlacement(list[5], primary_id, |
| 494 display::DisplayPlacement::LEFT, -300); |
| 495 builder.AddDisplayPlacement(list[6], primary_id, |
| 496 display::DisplayPlacement::TOP, -250); |
| 497 builder.AddDisplayPlacement(list[7], list[6], |
| 498 display::DisplayPlacement::LEFT, 250); |
| 499 display_manager()->layout_store()->RegisterLayoutForDisplayIdList( |
| 500 list, builder.Build()); |
| 501 |
| 502 UpdateDisplay( |
| 503 "480x400,480x400,480x400,480x400,480x400,480x400,480x400,530x150"); |
| 504 |
| 505 // The resulting layout after overlaps had been removed: |
| 506 // |
| 507 // |
| 508 // +---------+ |
| 509 // | 7 +-----+ |
| 510 // +-+-------+ 6 | |
| 511 // | 5 | | |
| 512 // | | | |
| 513 // | | | |
| 514 // | |-+---+----+---------+ |
| 515 // | | | P | 2 | |
| 516 // +-------+ | | +----------+ |
| 517 // | | | 3 | |
| 518 // | | | | |
| 519 // +--+-----+-+-------+ | |
| 520 // | 1 | | | |
| 521 // | | +----+---+------+ |
| 522 // | | | 4 | |
| 523 // +-------+ | | |
| 524 // | | |
| 525 // +--------+ |
| 526 |
| 527 EXPECT_EQ(8U, display_manager()->GetNumDisplays()); |
| 528 |
| 529 EXPECT_EQ("0,0 480x400", |
| 530 display_manager()->GetDisplayAt(0).bounds().ToString()); |
| 531 EXPECT_EQ("50,400 480x400", |
| 532 display_manager()->GetDisplayAt(1).bounds().ToString()); |
| 533 EXPECT_EQ("480,0 480x400", |
| 534 display_manager()->GetDisplayAt(2).bounds().ToString()); |
| 535 EXPECT_EQ("960,30 480x400", |
| 536 display_manager()->GetDisplayAt(3).bounds().ToString()); |
| 537 EXPECT_EQ("730,430 480x400", |
| 538 display_manager()->GetDisplayAt(4).bounds().ToString()); |
| 539 EXPECT_EQ("-730,-300 480x400", |
| 540 display_manager()->GetDisplayAt(5).bounds().ToString()); |
| 541 EXPECT_EQ("-250,-400 480x400", |
| 542 display_manager()->GetDisplayAt(6).bounds().ToString()); |
| 543 EXPECT_EQ("-780,-450 530x150", |
| 544 display_manager()->GetDisplayAt(7).bounds().ToString()); |
| 545 |
| 546 // Expect that the displays have been reparented correctly, such that a |
| 547 // child is always touching its parent. |
| 548 display::DisplayLayoutBuilder expected_layout_builder(primary_id); |
| 549 expected_layout_builder.AddDisplayPlacement( |
| 550 list[1], primary_id, display::DisplayPlacement::BOTTOM, 50); |
| 551 expected_layout_builder.AddDisplayPlacement( |
| 552 list[2], list[1], display::DisplayPlacement::TOP, 430); |
| 553 expected_layout_builder.AddDisplayPlacement( |
| 554 list[3], list[2], display::DisplayPlacement::RIGHT, 30); |
| 555 // [4] became a child of [3] instead of [2] as they no longer touch. |
| 556 expected_layout_builder.AddDisplayPlacement( |
| 557 list[4], list[3], display::DisplayPlacement::BOTTOM, -230); |
| 558 // [5] became a child of [6] instead of [P] as they no longer touch. |
| 559 expected_layout_builder.AddDisplayPlacement( |
| 560 list[5], list[6], display::DisplayPlacement::LEFT, 100); |
| 561 expected_layout_builder.AddDisplayPlacement( |
| 562 list[6], primary_id, display::DisplayPlacement::TOP, -250); |
| 563 expected_layout_builder.AddDisplayPlacement( |
| 564 list[7], list[6], display::DisplayPlacement::LEFT, -50); |
| 565 |
| 566 const display::DisplayLayout& layout = |
| 567 display_manager()->GetCurrentResolvedDisplayLayout(); |
| 568 |
| 569 EXPECT_TRUE( |
| 570 layout.HasSamePlacementList(*(expected_layout_builder.Build()))); |
| 571 } |
| 572 |
| 573 { |
| 574 // The following is a special case where a child display is closer to the |
| 575 // origin than its parent. Test that we can handle it successfully without |
| 576 // introducing a circular dependency. |
| 577 // |
| 578 // +---------+ |
| 579 // | P | +---------+ |
| 580 // | | | 3 | |
| 581 // | | | | |
| 582 // | | | | |
| 583 // +------+--+----+ | |
| 584 // | 1 | | 2 +---------+ |
| 585 // | | | | |
| 586 // | | | | |
| 587 // | | | | |
| 588 // +------+--+----+ |
| 589 // |
| 590 |
| 591 display::DisplayIdList list = display::test::CreateDisplayIdListN( |
| 592 4, primary_id, primary_id + 1, primary_id + 2, primary_id + 3); |
| 593 display::DisplayLayoutBuilder builder(primary_id); |
| 594 builder.AddDisplayPlacement(list[1], primary_id, |
| 595 display::DisplayPlacement::BOTTOM, 0); |
| 596 builder.AddDisplayPlacement(list[2], primary_id, |
| 597 display::DisplayPlacement::BOTTOM, 464); |
| 598 builder.AddDisplayPlacement(list[3], list[2], |
| 599 display::DisplayPlacement::RIGHT, -700); |
| 600 display_manager()->layout_store()->RegisterLayoutForDisplayIdList( |
| 601 list, builder.Build()); |
| 602 UpdateDisplay("696x800,696x800,300x800,696x800"); |
| 603 |
| 604 // The expected layout should be: |
| 605 // |
| 606 // +---------+ |
| 607 // | P | +---------+ |
| 608 // | | | 3 | |
| 609 // | | | | |
| 610 // | | | | |
| 611 // +---------+-------+ | |
| 612 // | 1 | 2 +---------+ |
| 613 // | | | |
| 614 // | | | |
| 615 // | | | |
| 616 // +---------+-------+ |
| 617 // |
| 618 // |
| 619 |
| 620 EXPECT_EQ(4U, display_manager()->GetNumDisplays()); |
| 621 EXPECT_EQ("0,0 696x800", |
| 622 display_manager()->GetDisplayAt(0).bounds().ToString()); |
| 623 EXPECT_EQ("0,800 696x800", |
| 624 display_manager()->GetDisplayAt(1).bounds().ToString()); |
| 625 EXPECT_EQ("696,800 300x800", |
| 626 display_manager()->GetDisplayAt(2).bounds().ToString()); |
| 627 EXPECT_EQ("996,100 696x800", |
| 628 display_manager()->GetDisplayAt(3).bounds().ToString()); |
| 629 |
| 630 // This case if not handled correctly might lead to a cyclic dependency. |
| 631 // Make sure this doesn't happen. |
| 632 display::DisplayLayoutBuilder expected_layout_builder(primary_id); |
| 633 expected_layout_builder.AddDisplayPlacement( |
| 634 list[1], primary_id, display::DisplayPlacement::BOTTOM, 0); |
| 635 expected_layout_builder.AddDisplayPlacement( |
| 636 list[2], primary_id, display::DisplayPlacement::BOTTOM, 696); |
| 637 expected_layout_builder.AddDisplayPlacement( |
| 638 list[3], list[2], display::DisplayPlacement::RIGHT, -700); |
| 639 |
| 640 const display::DisplayLayout& layout = |
| 641 display_manager()->GetCurrentResolvedDisplayLayout(); |
| 642 EXPECT_TRUE( |
| 643 layout.HasSamePlacementList(*(expected_layout_builder.Build()))); |
| 644 } |
| 645 |
| 646 { |
| 647 // The following is a layout with an overlap to the left of the primary |
| 648 // display. |
| 649 // |
| 650 // +---------+---------+ |
| 651 // | 1 | P | |
| 652 // | | | |
| 653 // +---------+ | |
| 654 // | | | |
| 655 // +---------+---------+ |
| 656 // | 2 | |
| 657 // | | |
| 658 // +---------+ |
| 659 |
| 660 display::DisplayIdList list = display::test::CreateDisplayIdListN( |
| 661 3, primary_id, primary_id + 1, primary_id + 2); |
| 662 display::DisplayLayoutBuilder builder(primary_id); |
| 663 builder.AddDisplayPlacement(list[1], primary_id, |
| 664 display::DisplayPlacement::LEFT, 0); |
| 665 builder.AddDisplayPlacement(list[2], primary_id, |
| 666 display::DisplayPlacement::LEFT, 250); |
| 667 display_manager()->layout_store()->RegisterLayoutForDisplayIdList( |
| 668 list, builder.Build()); |
| 669 UpdateDisplay("696x500,696x500,696x500"); |
| 670 |
| 671 // The expected layout should be: |
| 672 // |
| 673 // +---------+---------+ |
| 674 // | 1 | P | |
| 675 // | | | |
| 676 // | | | |
| 677 // | | | |
| 678 // +---------+---------+ |
| 679 // | 2 | |
| 680 // | | |
| 681 // | | |
| 682 // | | |
| 683 // +---------+ |
| 684 |
| 685 EXPECT_EQ(3U, display_manager()->GetNumDisplays()); |
| 686 EXPECT_EQ("0,0 696x500", |
| 687 display_manager()->GetDisplayAt(0).bounds().ToString()); |
| 688 EXPECT_EQ("-696,0 696x500", |
| 689 display_manager()->GetDisplayAt(1).bounds().ToString()); |
| 690 EXPECT_EQ("-696,500 696x500", |
| 691 display_manager()->GetDisplayAt(2).bounds().ToString()); |
| 692 } |
| 693 |
| 694 { |
| 695 // The following is a layout with an overlap occuring above the primary |
| 696 // display. |
| 697 // |
| 698 // +------+--+------+ |
| 699 // | 2 | | 1 | |
| 700 // | | | | |
| 701 // | | | | |
| 702 // | | | | |
| 703 // +------+--+------+ |
| 704 // | P | |
| 705 // | | |
| 706 // | | |
| 707 // | | |
| 708 // +---------+ |
| 709 // |
| 710 |
| 711 display::DisplayIdList list = display::test::CreateDisplayIdListN( |
| 712 3, primary_id, primary_id + 1, primary_id + 2); |
| 713 display::DisplayLayoutBuilder builder(primary_id); |
| 714 builder.AddDisplayPlacement(list[1], primary_id, |
| 715 display::DisplayPlacement::TOP, 0); |
| 716 builder.AddDisplayPlacement(list[2], primary_id, |
| 717 display::DisplayPlacement::TOP, -348); |
| 718 display_manager()->layout_store()->RegisterLayoutForDisplayIdList( |
| 719 list, builder.Build()); |
| 720 UpdateDisplay("696x500,696x500,696x500"); |
| 721 |
| 722 // The expected layout should be: |
| 723 // |
| 724 // +---------+---------+ |
| 725 // | 2 | 1 | |
| 726 // | | | |
| 727 // | | | |
| 728 // | | | |
| 729 // +---------+---------+ |
| 730 // | P | |
| 731 // | | |
| 732 // | | |
| 733 // | | |
| 734 // +---------+ |
| 735 // |
| 736 |
| 737 EXPECT_EQ(3U, display_manager()->GetNumDisplays()); |
| 738 EXPECT_EQ("0,0 696x500", |
| 739 display_manager()->GetDisplayAt(0).bounds().ToString()); |
| 740 EXPECT_EQ("0,-500 696x500", |
| 741 display_manager()->GetDisplayAt(1).bounds().ToString()); |
| 742 EXPECT_EQ("-696,-500 696x500", |
| 743 display_manager()->GetDisplayAt(2).bounds().ToString()); |
| 744 } |
| 745 } |
| 746 |
| 747 TEST_P(DisplayManagerTest, NoOverlappedDisplaysNotFitBetweenTwo) { |
| 748 // +------+--+----+--+------+ |
| 749 // | 1 | | 2 | | 3 | |
| 750 // | | | | | | |
| 751 // | | | | | | |
| 752 // | | | | | | |
| 753 // +-+----+--+----+--+---+--+ |
| 754 // | P | |
| 755 // | | |
| 756 // | | |
| 757 // | | |
| 758 // +-------------------+ |
| 759 // |
| 760 |
| 761 int64_t primary_id = display::Screen::GetScreen()->GetPrimaryDisplay().id(); |
| 762 display::DisplayIdList list = display::test::CreateDisplayIdListN( |
| 763 4, primary_id, primary_id + 1, primary_id + 2, primary_id + 3); |
| 764 display::DisplayLayoutBuilder builder(primary_id); |
| 765 builder.AddDisplayPlacement(list[1], primary_id, |
| 766 display::DisplayPlacement::TOP, -110); |
| 767 builder.AddDisplayPlacement(list[2], primary_id, |
| 768 display::DisplayPlacement::TOP, 300); |
| 769 builder.AddDisplayPlacement(list[3], primary_id, |
| 770 display::DisplayPlacement::TOP, 600); |
| 771 display_manager()->layout_store()->RegisterLayoutForDisplayIdList( |
| 772 list, builder.Build()); |
| 773 UpdateDisplay("1200x500,600x500,600x500,600x500"); |
| 774 |
| 775 // The expected layout should be: |
| 776 // |
| 777 // +---------+---------+---------+ |
| 778 // | 1 | 2 | 3 | |
| 779 // | | | | |
| 780 // | | | | |
| 781 // | | | | |
| 782 // +-+-------+---------+-+-------+ |
| 783 // | P | |
| 784 // | | |
| 785 // | | |
| 786 // | | |
| 787 // +-------------------+ |
| 788 // |
| 789 |
| 790 EXPECT_EQ(4U, display_manager()->GetNumDisplays()); |
| 791 EXPECT_EQ("0,0 1200x500", |
| 792 display_manager()->GetDisplayAt(0).bounds().ToString()); |
| 793 EXPECT_EQ("-110,-500 600x500", |
| 794 display_manager()->GetDisplayAt(1).bounds().ToString()); |
| 795 EXPECT_EQ("490,-500 600x500", |
| 796 display_manager()->GetDisplayAt(2).bounds().ToString()); |
| 797 EXPECT_EQ("1090,-500 600x500", |
| 798 display_manager()->GetDisplayAt(3).bounds().ToString()); |
| 799 } |
| 800 |
| 801 TEST_P(DisplayManagerTest, NoOverlappedDisplaysAfterResolutionChange) { |
| 802 // Starting with a good layout with no overlaps, test that if the resolution |
| 803 // of one of the displays is changed, it won't result in any overlaps. |
| 804 // |
| 805 // +-------------------+ |
| 806 // | 4 | |
| 807 // | | |
| 808 // | | |
| 809 // | | |
| 810 // +----+----+---------+----+----+ |
| 811 // | 1 | 2 | 3 | |
| 812 // | | | | |
| 813 // | | | | |
| 814 // | | | | |
| 815 // +----+----+---------+----+----+ |
| 816 // | p | |
| 817 // | | |
| 818 // | | |
| 819 // | | |
| 820 // +-------------------+ |
| 821 // |
| 822 |
| 823 int64_t primary_id = display::Screen::GetScreen()->GetPrimaryDisplay().id(); |
| 824 display::DisplayIdList list = display::test::CreateDisplayIdListN( |
| 825 5, primary_id, primary_id + 1, primary_id + 2, primary_id + 3, |
| 826 primary_id + 4); |
| 827 display::DisplayLayoutBuilder builder(primary_id); |
| 828 builder.AddDisplayPlacement(list[1], primary_id, |
| 829 display::DisplayPlacement::TOP, -250); |
| 830 builder.AddDisplayPlacement(list[2], primary_id, |
| 831 display::DisplayPlacement::TOP, 250); |
| 832 builder.AddDisplayPlacement(list[3], primary_id, |
| 833 display::DisplayPlacement::TOP, 750); |
| 834 builder.AddDisplayPlacement(list[4], list[1], display::DisplayPlacement::TOP, |
| 835 250); |
| 836 display_manager()->layout_store()->RegisterLayoutForDisplayIdList( |
| 837 list, builder.Build()); |
| 838 UpdateDisplay("1000x500,500x500,500x500,500x500,1000x500"); |
| 839 |
| 840 // There should be no overlap at all. |
| 841 EXPECT_EQ(5U, display_manager()->GetNumDisplays()); |
| 842 EXPECT_EQ("0,0 1000x500", |
| 843 display_manager()->GetDisplayAt(0).bounds().ToString()); |
| 844 EXPECT_EQ("-250,-500 500x500", |
| 845 display_manager()->GetDisplayAt(1).bounds().ToString()); |
| 846 EXPECT_EQ("250,-500 500x500", |
| 847 display_manager()->GetDisplayAt(2).bounds().ToString()); |
| 848 EXPECT_EQ("750,-500 500x500", |
| 849 display_manager()->GetDisplayAt(3).bounds().ToString()); |
| 850 EXPECT_EQ("0,-1000 1000x500", |
| 851 display_manager()->GetDisplayAt(4).bounds().ToString()); |
| 852 |
| 853 // Change the resolution of display (2) and expect the following layout. |
| 854 // |
| 855 // +-------------------+ |
| 856 // | 4 | |
| 857 // | | |
| 858 // | | |
| 859 // | | |
| 860 // +----+-------------++ |
| 861 // | 2 | |
| 862 // +---------+ +---------+ |
| 863 // | 1 | | 3 | |
| 864 // | | | | |
| 865 // | | | | |
| 866 // | | | | |
| 867 // +----+----+-------------++--------+ |
| 868 // | p | |
| 869 // | | |
| 870 // | | |
| 871 // | | |
| 872 // +-------------------+ |
| 873 // |
| 874 |
| 875 UpdateDisplay("1000x500,500x500,600x600,500x500,1000x500"); |
| 876 |
| 877 EXPECT_EQ(5U, display_manager()->GetNumDisplays()); |
| 878 EXPECT_EQ("0,0 1000x500", |
| 879 display_manager()->GetDisplayAt(0).bounds().ToString()); |
| 880 EXPECT_EQ("-250,-500 500x500", |
| 881 display_manager()->GetDisplayAt(1).bounds().ToString()); |
| 882 EXPECT_EQ("250,-600 600x600", |
| 883 display_manager()->GetDisplayAt(2).bounds().ToString()); |
| 884 EXPECT_EQ("850,-500 500x500", |
| 885 display_manager()->GetDisplayAt(3).bounds().ToString()); |
| 886 EXPECT_EQ("0,-1100 1000x500", |
| 887 display_manager()->GetDisplayAt(4).bounds().ToString()); |
| 888 } |
| 889 |
| 454 TEST_P(DisplayManagerTest, NoMirrorInThreeDisplays) { | 890 TEST_P(DisplayManagerTest, NoMirrorInThreeDisplays) { |
| 455 UpdateDisplay("640x480,320x200,400x300"); | 891 UpdateDisplay("640x480,320x200,400x300"); |
| 456 ash::Shell::GetInstance()->display_configuration_controller()->SetMirrorMode( | 892 ash::Shell::GetInstance()->display_configuration_controller()->SetMirrorMode( |
| 457 true, true); | 893 true, true); |
| 458 EXPECT_FALSE(display_manager()->IsInMirrorMode()); | 894 EXPECT_FALSE(display_manager()->IsInMirrorMode()); |
| 459 EXPECT_EQ(3u, display_manager()->GetNumDisplays()); | 895 EXPECT_EQ(3u, display_manager()->GetNumDisplays()); |
| 460 EXPECT_EQ(l10n_util::GetStringUTF16(IDS_ASH_DISPLAY_MIRRORING_NOT_SUPPORTED), | 896 EXPECT_EQ(l10n_util::GetStringUTF16(IDS_ASH_DISPLAY_MIRRORING_NOT_SUPPORTED), |
| 461 GetDisplayErrorNotificationMessageForTest()); | 897 GetDisplayErrorNotificationMessageForTest()); |
| 462 } | 898 } |
| 463 | 899 |
| (...skipping 1973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2437 display::DisplayIdList list = display::test::CreateDisplayIdList2(id1, id2); | 2873 display::DisplayIdList list = display::test::CreateDisplayIdList2(id1, id2); |
| 2438 layout_store->RegisterLayoutForDisplayIdList(list, std::move(old_layout)); | 2874 layout_store->RegisterLayoutForDisplayIdList(list, std::move(old_layout)); |
| 2439 const display::DisplayLayout& stored = | 2875 const display::DisplayLayout& stored = |
| 2440 layout_store->GetRegisteredDisplayLayout(list); | 2876 layout_store->GetRegisteredDisplayLayout(list); |
| 2441 | 2877 |
| 2442 EXPECT_EQ(id1, stored.placement_list[0].parent_display_id); | 2878 EXPECT_EQ(id1, stored.placement_list[0].parent_display_id); |
| 2443 EXPECT_EQ(id2, stored.placement_list[0].display_id); | 2879 EXPECT_EQ(id2, stored.placement_list[0].display_id); |
| 2444 } | 2880 } |
| 2445 | 2881 |
| 2446 } // namespace ash | 2882 } // namespace ash |
| OLD | NEW |