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

Side by Side Diff: ash/display/display_manager_unittest.cc

Issue 1870733004: Clear the software mirroring display list when adding it to the updated list. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « ash/display/display_manager.cc ('k') | no next file » | no next file with comments »
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_manager.h" 5 #include "ash/display/display_manager.h"
6 6
7 #include "ash/accelerators/accelerator_commands.h" 7 #include "ash/accelerators/accelerator_commands.h"
8 #include "ash/ash_switches.h" 8 #include "ash/ash_switches.h"
9 #include "ash/display/display_info.h" 9 #include "ash/display/display_info.h"
10 #include "ash/display/display_layout_builder.h" 10 #include "ash/display/display_layout_builder.h"
(...skipping 1466 matching lines...) Expand 10 before | Expand all | Expand 10 after
1477 1477
1478 // Overscan insets are ignored. 1478 // Overscan insets are ignored.
1479 UpdateDisplay("400x600/o,600x800/o"); 1479 UpdateDisplay("400x600/o,600x800/o");
1480 EXPECT_FALSE(display_observer.changed_and_reset()); 1480 EXPECT_FALSE(display_observer.changed_and_reset());
1481 EXPECT_EQ("400x600", 1481 EXPECT_EQ("400x600",
1482 test_api.GetHost()->window()->bounds().size().ToString()); 1482 test_api.GetHost()->window()->bounds().size().ToString());
1483 1483
1484 gfx::Screen::GetScreen()->RemoveObserver(&display_observer); 1484 gfx::Screen::GetScreen()->RemoveObserver(&display_observer);
1485 } 1485 }
1486 1486
1487 TEST_F(DisplayManagerTest, RotateInSoftwareMirroring) {
1488 if (!SupportsMultipleDisplays())
1489 return;
1490
1491 DisplayManager* display_manager = Shell::GetInstance()->display_manager();
1492 UpdateDisplay("600x400,500x300");
1493 display_manager->SetMirrorMode(true);
1494
1495 EXPECT_EQ(1U, display_manager->GetNumDisplays());
1496 int64_t primary_id = gfx::Screen::GetScreen()->GetPrimaryDisplay().id();
1497 display_manager->SetDisplayRotation(primary_id, gfx::Display::ROTATE_180,
1498 gfx::Display::ROTATION_SOURCE_ACTIVE);
1499 display_manager->SetMirrorMode(false);
1500 }
1501
1487 TEST_F(DisplayManagerTest, SingleDisplayToSoftwareMirroring) { 1502 TEST_F(DisplayManagerTest, SingleDisplayToSoftwareMirroring) {
1488 if (!SupportsMultipleDisplays()) 1503 if (!SupportsMultipleDisplays())
1489 return; 1504 return;
1490 UpdateDisplay("600x400"); 1505 UpdateDisplay("600x400");
1491 1506
1492 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); 1507 DisplayManager* display_manager = Shell::GetInstance()->display_manager();
1493 display_manager->SetMultiDisplayMode(DisplayManager::MIRRORING); 1508 display_manager->SetMultiDisplayMode(DisplayManager::MIRRORING);
1494 UpdateDisplay("600x400,600x400"); 1509 UpdateDisplay("600x400,600x400");
1495 1510
1496 EXPECT_TRUE(display_manager->IsInMirrorMode()); 1511 EXPECT_TRUE(display_manager->IsInMirrorMode());
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after
2231 layout_store->RegisterLayoutForDisplayIdList(list, std::move(old_layout)); 2246 layout_store->RegisterLayoutForDisplayIdList(list, std::move(old_layout));
2232 const DisplayLayout& stored = layout_store->GetRegisteredDisplayLayout(list); 2247 const DisplayLayout& stored = layout_store->GetRegisteredDisplayLayout(list);
2233 2248
2234 EXPECT_EQ(id1, stored.placement_list[0].parent_display_id); 2249 EXPECT_EQ(id1, stored.placement_list[0].parent_display_id);
2235 EXPECT_EQ(id2, stored.placement_list[0].display_id); 2250 EXPECT_EQ(id2, stored.placement_list[0].display_id);
2236 } 2251 }
2237 2252
2238 #endif // OS_CHROMEOS 2253 #endif // OS_CHROMEOS
2239 2254
2240 } // namespace ash 2255 } // namespace ash
OLDNEW
« no previous file with comments | « ash/display/display_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698