| 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/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_store.h" | 10 #include "ash/display/display_layout_store.h" |
| (...skipping 1414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1425 EXPECT_EQ("top, -70", | 1425 EXPECT_EQ("top, -70", |
| 1426 DisplayLayout(DisplayLayout::BOTTOM, 70).Invert().ToString()); | 1426 DisplayLayout(DisplayLayout::BOTTOM, 70).Invert().ToString()); |
| 1427 EXPECT_EQ("top, 80", | 1427 EXPECT_EQ("top, 80", |
| 1428 DisplayLayout(DisplayLayout::BOTTOM, -80).Invert().ToString()); | 1428 DisplayLayout(DisplayLayout::BOTTOM, -80).Invert().ToString()); |
| 1429 } | 1429 } |
| 1430 | 1430 |
| 1431 TEST_F(DisplayManagerTest, NotifyPrimaryChange) { | 1431 TEST_F(DisplayManagerTest, NotifyPrimaryChange) { |
| 1432 if (!SupportsMultipleDisplays()) | 1432 if (!SupportsMultipleDisplays()) |
| 1433 return; | 1433 return; |
| 1434 UpdateDisplay("500x500,500x500"); | 1434 UpdateDisplay("500x500,500x500"); |
| 1435 ash::Shell::GetInstance()->window_tree_host_manager()->SwapPrimaryDisplay(); | 1435 Shell::GetInstance()->window_tree_host_manager()->SwapPrimaryDisplayForTest(); |
| 1436 reset(); | 1436 reset(); |
| 1437 UpdateDisplay("500x500"); | 1437 UpdateDisplay("500x500"); |
| 1438 EXPECT_FALSE(changed_metrics() & gfx::DisplayObserver::DISPLAY_METRIC_BOUNDS); | 1438 EXPECT_FALSE(changed_metrics() & gfx::DisplayObserver::DISPLAY_METRIC_BOUNDS); |
| 1439 EXPECT_FALSE(changed_metrics() & | 1439 EXPECT_FALSE(changed_metrics() & |
| 1440 gfx::DisplayObserver::DISPLAY_METRIC_WORK_AREA); | 1440 gfx::DisplayObserver::DISPLAY_METRIC_WORK_AREA); |
| 1441 EXPECT_TRUE(changed_metrics() & | 1441 EXPECT_TRUE(changed_metrics() & |
| 1442 gfx::DisplayObserver::DISPLAY_METRIC_PRIMARY); | 1442 gfx::DisplayObserver::DISPLAY_METRIC_PRIMARY); |
| 1443 | 1443 |
| 1444 UpdateDisplay("500x500,500x500"); | 1444 UpdateDisplay("500x500,500x500"); |
| 1445 ash::Shell::GetInstance()->window_tree_host_manager()->SwapPrimaryDisplay(); | 1445 Shell::GetInstance()->window_tree_host_manager()->SwapPrimaryDisplayForTest(); |
| 1446 reset(); | 1446 reset(); |
| 1447 UpdateDisplay("500x400"); | 1447 UpdateDisplay("500x400"); |
| 1448 EXPECT_TRUE(changed_metrics() & gfx::DisplayObserver::DISPLAY_METRIC_BOUNDS); | 1448 EXPECT_TRUE(changed_metrics() & gfx::DisplayObserver::DISPLAY_METRIC_BOUNDS); |
| 1449 EXPECT_TRUE(changed_metrics() & | 1449 EXPECT_TRUE(changed_metrics() & |
| 1450 gfx::DisplayObserver::DISPLAY_METRIC_WORK_AREA); | 1450 gfx::DisplayObserver::DISPLAY_METRIC_WORK_AREA); |
| 1451 EXPECT_TRUE(changed_metrics() & | 1451 EXPECT_TRUE(changed_metrics() & |
| 1452 gfx::DisplayObserver::DISPLAY_METRIC_PRIMARY); | 1452 gfx::DisplayObserver::DISPLAY_METRIC_PRIMARY); |
| 1453 } | 1453 } |
| 1454 | 1454 |
| 1455 TEST_F(DisplayManagerTest, NotifyPrimaryChangeUndock) { | 1455 TEST_F(DisplayManagerTest, NotifyPrimaryChangeUndock) { |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2017 layout_store->RegisterLayoutForDisplayIdPair(id2, id1, bad); | 2017 layout_store->RegisterLayoutForDisplayIdPair(id2, id1, bad); |
| 2018 | 2018 |
| 2019 EXPECT_EQ(good.ToString(), layout_store->GetRegisteredDisplayLayout( | 2019 EXPECT_EQ(good.ToString(), layout_store->GetRegisteredDisplayLayout( |
| 2020 CreateDisplayIdPair(id1, id2)) | 2020 CreateDisplayIdPair(id1, id2)) |
| 2021 .ToString()); | 2021 .ToString()); |
| 2022 } | 2022 } |
| 2023 | 2023 |
| 2024 #endif // OS_CHROMEOS | 2024 #endif // OS_CHROMEOS |
| 2025 | 2025 |
| 2026 } // namespace ash | 2026 } // namespace ash |
| OLD | NEW |